-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Fix PartialEq
for JsBigInt
and f64
#2461
Conversation
Test262 conformance changes
Fixed tests (4):
|
Codecov Report
@@ Coverage Diff @@
## main #2461 +/- ##
==========================================
- Coverage 51.51% 51.07% -0.45%
==========================================
Files 339 344 +5
Lines 35515 35825 +310
==========================================
- Hits 18297 18296 -1
- Misses 17218 17529 +311
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! It turns out the operation doesn't need an if/else. Check the comments :)
boa_engine/src/bigint.rs
Outdated
@@ -453,21 +453,21 @@ impl PartialEq<JsBigInt> for i32 { | |||
impl PartialEq<f64> for JsBigInt { | |||
#[inline] | |||
fn eq(&self, other: &f64) -> bool { | |||
if other.fract() != 0.0 { | |||
return false; | |||
if other.fract().is_zero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be an &&
operation, right? Instead of an if/else
boa_engine/src/bigint.rs
Outdated
} | ||
} | ||
|
||
impl PartialEq<JsBigInt> for f64 { | ||
#[inline] | ||
fn eq(&self, other: &JsBigInt) -> bool { | ||
if self.fract() != 0.0 { | ||
return false; | ||
if self.fract().is_zero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, it could just be an &&
operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect now, thanks!
bors r+ |
Pull request successfully merged into main. Build succeeded: |
PartialEq
for JsBigInt
and f64
PartialEq
for JsBigInt
and f64
This Pull Request changes the following:
BigInt::from_f64
function when checkingJsBigInt
andf64
for eqality.