From fe9c8d9e908948bf4d355d96010324ae31224394 Mon Sep 17 00:00:00 2001 From: Dirk de Visser Date: Sun, 9 Jul 2023 21:24:43 +0200 Subject: [PATCH] Add missing 'unscopables' to `Array.prototype[@@unscopables]` (#3111) --- boa_engine/src/builtins/array/mod.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/boa_engine/src/builtins/array/mod.rs b/boa_engine/src/builtins/array/mod.rs index 245b30a28e1..1d7f32e3d71 100644 --- a/boa_engine/src/builtins/array/mod.rs +++ b/boa_engine/src/builtins/array/mod.rs @@ -3022,11 +3022,6 @@ impl Array { /// `Array.prototype [ @@unscopables ]` /// - /// The initial value of the 'unscopables' data property is an ordinary object - /// with the following boolean properties set to true: - /// 'at', 'copyWithin', 'entries', 'fill', 'find', 'findIndex', 'flat', - /// 'flatMap', 'includes', 'keys', 'values' - /// /// More information: /// - [ECMAScript reference][spec] /// - [MDN documentation][mdn] @@ -3055,15 +3050,25 @@ impl Array { obj.insert(utf16!("find"), true_prop.clone()); // 7. Perform ! CreateDataPropertyOrThrow(unscopableList, "findIndex", true). obj.insert(utf16!("findIndex"), true_prop.clone()); - // 8. Perform ! CreateDataPropertyOrThrow(unscopableList, "flat", true). + // 8. Perform ! CreateDataPropertyOrThrow(unscopableList, "findLast", true). + obj.insert(utf16!("findLast"), true_prop.clone()); + // 9. Perform ! CreateDataPropertyOrThrow(unscopableList, "findLastIndex", true). + obj.insert(utf16!("findLastIndex"), true_prop.clone()); + // 10. Perform ! CreateDataPropertyOrThrow(unscopableList, "flat", true). obj.insert(utf16!("flat"), true_prop.clone()); - // 9. Perform ! CreateDataPropertyOrThrow(unscopableList, "flatMap", true). + // 11. Perform ! CreateDataPropertyOrThrow(unscopableList, "flatMap", true). obj.insert(utf16!("flatMap"), true_prop.clone()); - // 10. Perform ! CreateDataPropertyOrThrow(unscopableList, "includes", true). + // 12. Perform ! CreateDataPropertyOrThrow(unscopableList, "includes", true). obj.insert(utf16!("includes"), true_prop.clone()); - // 11. Perform ! CreateDataPropertyOrThrow(unscopableList, "keys", true). + // 13. Perform ! CreateDataPropertyOrThrow(unscopableList, "keys", true). obj.insert(utf16!("keys"), true_prop.clone()); - // 12. Perform ! CreateDataPropertyOrThrow(unscopableList, "values", true). + // 14. Perform ! CreateDataPropertyOrThrow(unscopableList, "toReversed", true). + obj.insert(utf16!("toReversed"), true_prop.clone()); + // 15. Perform ! CreateDataPropertyOrThrow(unscopableList, "toSorted", true). + obj.insert(utf16!("toSorted"), true_prop.clone()); + // 16. Perform ! CreateDataPropertyOrThrow(unscopableList, "toSpliced", true). + obj.insert(utf16!("toSpliced"), true_prop.clone()); + // 17. Perform ! CreateDataPropertyOrThrow(unscopableList, "values", true). obj.insert(utf16!("values"), true_prop); }