Browse Source

missing normalization improvement for has (#1578)

related to: #1445
pull/1585/head
neeldug 3 years ago committed by GitHub
parent
commit
21ef83940e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      boa/src/builtins/map/mod.rs

13
boa/src/builtins/map/mod.rs

@ -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]]).

Loading…
Cancel
Save