Skip to content

Commit

Permalink
Check for -0
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Aug 12, 2021
1 parent 7135a6f commit 23e99eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions boa/src/value/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ impl JsValue {
Err(_) => f64::NAN,
}),
Self::Rational(num) => Self::new(-num),
Self::Integer(num) if num == 0 => Self::new(-f64::new(0)),
Self::Integer(num) => Self::new(-num),
Self::Boolean(true) => Self::new(1),
Self::Boolean(false) | Self::Null => Self::new(0),
Expand Down

0 comments on commit 23e99eb

Please sign in to comment.