Skip to content

Commit

Permalink
missing normalization improvement for has
Browse files Browse the repository at this point in the history
related to: boa-dev#1445
  • Loading branch information
neeldug committed Sep 15, 2021
1 parent c5a4be0 commit 4479e5e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boa/src/builtins/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,19 @@ impl Map {
) -> JsResult<JsValue> {
let key = args.get_or_undefined(0);

const JS_ZERO: &JsValue = &JsValue::Rational(0f64);

let key = match key {
JsValue::Rational(r) => {
if r.is_zero() {
JS_ZERO
} else {
key
}
}
_ => key,
};

// 1. Let M be the this value.
if let JsValue::Object(ref object) = this {
// 2. Perform ? RequireInternalSlot(M, [[MapData]]).
Expand Down

0 comments on commit 4479e5e

Please sign in to comment.