Update Array.prototype[Symbol.unscopables] (#65)

Add change-array-by-copy methods to Array.prototype[Symbol.unscopables].
This commit is contained in:
Ben Noordhuis 2023-11-16 13:05:51 +01:00 committed by GitHub
parent feebfbc6ee
commit 48fc4bb26d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -47090,8 +47090,20 @@ void JS_AddIntrinsicBaseObjects(JSContext *ctx)
/* XXX: create auto_initializer */
{
/* initialize Array.prototype[Symbol.unscopables] */
char const unscopables[] = "copyWithin" "\0" "entries" "\0" "fill" "\0" "find" "\0"
"findIndex" "\0" "flat" "\0" "flatMap" "\0" "includes" "\0" "keys" "\0" "values" "\0";
static const char unscopables[] =
"copyWithin" "\0"
"entries" "\0"
"fill" "\0"
"find" "\0"
"findIndex" "\0"
"flat" "\0"
"flatMap" "\0"
"includes" "\0"
"keys" "\0"
"toReversed" "\0"
"toSorted" "\0"
"toSpliced" "\0"
"values" "\0";
const char *p = unscopables;
obj1 = JS_NewObjectProto(ctx, JS_NULL);
for(p = unscopables; *p; p += strlen(p) + 1) {

View file

@ -1,6 +1,4 @@
test262/test/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js:13: Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all
test262/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js:19: Test262Error: obj should have an own property toReversed
test262/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js:19: strict mode: Test262Error: obj should have an own property toReversed
test262/test/built-ins/AsyncGeneratorPrototype/return/return-state-completed-broken-promise.js:53: TypeError: $DONE() not called
test262/test/built-ins/AsyncGeneratorPrototype/return/return-state-completed-broken-promise.js:53: strict mode: TypeError: $DONE() not called
test262/test/built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-broken-promise.js:34: TypeError: $DONE() not called