Skip to content

Commit

Permalink
Add missing 'unscopables' to Array.prototype[@@unscopables] (#3111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 authored Jul 9, 2023
1 parent 1a2be79 commit fe9c8d9
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions boa_engine/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit fe9c8d9

Please sign in to comment.