Skip to content

Commit ed5fa2a

Browse files
committed
fix: Reflect recent changes in tc39/ecma262#3395
1 parent 9279a84 commit ed5fa2a

8 files changed

Lines changed: 152 additions & 31 deletions

File tree

ecma262

src/main/resources/manuals/bugfix/2e161460ba8d084b734bb90e2379f43ceb3e8140.patch renamed to src/main/resources/manuals/bugfix/961f269c227b7892c21487d82b28d3e8b86e0d4f.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/spec.html b/spec.html
2-
index b3fa9123..94ffec3a 100644
2+
index ef6053e6..088e6e22 100644
33
--- a/spec.html
44
+++ b/spec.html
5-
@@ -29092,7 +29092,7 @@
5+
@@ -29176,7 +29176,7 @@
66
1. Let _F_ be _thisEnvRec_.[[FunctionObject]].
77
1. Set _inFunction_ to *true*.
88
1. Set _inMethod_ to _thisEnvRec_.HasSuperBinding().
@@ -11,7 +11,7 @@ index b3fa9123..94ffec3a 100644
1111
1. Let _classFieldInitializerName_ be _F_.[[ClassFieldInitializerName]].
1212
1. If _classFieldInitializerName_ is not ~empty~, set _inClassFieldInitializer_ to *true*.
1313
1. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
14-
@@ -42211,7 +42211,7 @@ THH:mm:ss.sss
14+
@@ -42295,7 +42295,7 @@ THH:mm:ss.sss
1515
1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)).
1616
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield.
1717
1. Set _numEntries_ to the number of elements in _entries_.
@@ -20,7 +20,7 @@ index b3fa9123..94ffec3a 100644
2020
1. Return CreateIteratorFromClosure(_closure_, *"%MapIteratorPrototype%"*, %MapIteratorPrototype%).
2121
</emu-alg>
2222
</emu-clause>
23-
@@ -42841,7 +42841,7 @@ THH:mm:ss.sss
23+
@@ -42925,7 +42925,7 @@ THH:mm:ss.sss
2424
1. Perform ? GeneratorYield(CreateIteratorResultObject(_e_, *false*)).
2525
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield.
2626
1. Set _numEntries_ to the number of elements in _entries_.
@@ -29,8 +29,8 @@ index b3fa9123..94ffec3a 100644
2929
1. Return CreateIteratorFromClosure(_closure_, *"%SetIteratorPrototype%"*, %SetIteratorPrototype%).
3030
</emu-alg>
3131
</emu-clause>
32-
@@ -48338,7 +48338,7 @@ THH:mm:ss.sss
33-
1. Let _internalSlotsList_ be « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] ».
32+
@@ -48862,7 +48862,7 @@ THH:mm:ss.sss
33+
1. Let _internalSlotsList_ be the list-concatenation of _extraSlots_ and « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] ».
3434
1. Let _generator_ be OrdinaryObjectCreate(_generatorPrototype_, _internalSlotsList_).
3535
1. Set _generator_.[[GeneratorBrand]] to _generatorBrand_.
3636
- 1. Set _generator_.[[GeneratorState]] to *undefined*.

src/main/resources/manuals/test262/filtered.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,5 +346,51 @@
346346
"language/expressions/assignment/target-member-computed-reference",
347347
"language/expressions/assignment/target-super-computed-reference",
348348
"language/expressions/member-expression/computed-reference-null-or-undefined"
349+
],
350+
"early-error": [
351+
"staging/sm/regress/regress-640075"
352+
],
353+
"tc39/ecma262#3457": [
354+
"built-ins/Iterator/prototype/drop/return-is-forwarded",
355+
"built-ins/Iterator/prototype/take/return-is-forwarded",
356+
"built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying",
357+
"built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying",
358+
"built-ins/Iterator/prototype/every/argument-validation-failure-closes-underlying",
359+
"built-ins/Iterator/prototype/filter/argument-validation-failure-closes-underlying",
360+
"built-ins/Iterator/prototype/find/argument-validation-failure-closes-underlying",
361+
"built-ins/Iterator/prototype/flatMap/argument-validation-failure-closes-underlying",
362+
"built-ins/Iterator/prototype/forEach/argument-validation-failure-closes-underlying",
363+
"built-ins/Iterator/prototype/map/argument-validation-failure-closes-underlying",
364+
"built-ins/Iterator/prototype/reduce/argument-validation-failure-closes-underlying",
365+
"built-ins/Iterator/prototype/some/argument-validation-failure-closes-underlying",
366+
"built-ins/Iterator/prototype/filter/return-is-forwarded",
367+
"built-ins/Iterator/prototype/flatMap/return-is-forwarded-to-underlying-iterator",
368+
"built-ins/Iterator/prototype/map/return-is-forwarded-to-underlying-iterator"
369+
],
370+
"tc39/ecma262#3009": [
371+
"built-ins/String/prototype/search/cstm-search-on-bigint-primitive",
372+
"built-ins/String/prototype/search/cstm-search-on-boolean-primitive",
373+
"built-ins/String/prototype/search/cstm-search-on-number-primitive",
374+
"built-ins/String/prototype/search/cstm-search-on-string-primitive",
375+
"built-ins/String/prototype/match/cstm-matcher-on-string-primitive",
376+
"built-ins/String/prototype/match/cstm-matcher-on-boolean-primitive",
377+
"built-ins/String/prototype/match/cstm-matcher-on-bigint-primitive",
378+
"built-ins/String/prototype/match/cstm-matcher-on-number-primitive",
379+
"built-ins/String/prototype/matchAll/cstm-matchall-on-bigint-primitive",
380+
"built-ins/String/prototype/matchAll/cstm-matchall-on-number-primitive",
381+
"built-ins/String/prototype/matchAll/cstm-matchall-on-string-primitive",
382+
"built-ins/String/prototype/matchAll/cstm-matchall-on-string-primitive",
383+
"built-ins/String/prototype/replaceAll/cstm-replaceall-on-bigint-primitive",
384+
"built-ins/String/prototype/replaceAll/cstm-replaceall-on-boolean-primitive",
385+
"built-ins/String/prototype/replaceAll/cstm-replaceall-on-number-primitive",
386+
"built-ins/String/prototype/replaceAll/cstm-replaceall-on-string-primitive",
387+
"built-ins/String/prototype/split/cstm-split-on-string-primitive",
388+
"built-ins/String/prototype/split/cstm-split-on-bigint-primitive",
389+
"built-ins/String/prototype/split/cstm-split-on-boolean-primitive",
390+
"built-ins/String/prototype/split/cstm-split-on-number-primitive",
391+
"built-ins/String/prototype/replace/cstm-replace-on-string-primitive",
392+
"built-ins/String/prototype/replace/cstm-replace-on-bigint-primitive",
393+
"built-ins/String/prototype/replace/cstm-replace-on-boolean-primitive",
394+
"built-ins/String/prototype/replace/cstm-replace-on-number-primitive"
349395
]
350396
}

src/main/resources/manuals/test262/supported-features.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"generators",
8484
"globalThis",
8585
"import.meta",
86+
"iterator-helpers",
8687
"json-superset",
8788
"let",
8889
"logical-assignment-operators",

src/main/resources/result/complete-funcs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ GetGeneratorKind
10741074
GetGlobalObject
10751075
GetIdentifierReference
10761076
GetIterator
1077+
GetIteratorDirect
1078+
GetIteratorFlattenable
10771079
GetIteratorFromMethod
10781080
GetMethod
10791081
GetModuleNamespace
@@ -1258,7 +1260,27 @@ INTRINSICS.GeneratorFunction
12581260
INTRINSICS.GeneratorPrototype.next
12591261
INTRINSICS.GeneratorPrototype.return
12601262
INTRINSICS.GeneratorPrototype.throw
1261-
INTRINSICS.IteratorPrototype[%Symbol.iterator%]
1263+
INTRINSICS.Iterator
1264+
INTRINSICS.Iterator.from
1265+
INTRINSICS.Iterator.prototype.drop
1266+
INTRINSICS.Iterator.prototype.drop:clo0
1267+
INTRINSICS.Iterator.prototype.every
1268+
INTRINSICS.Iterator.prototype.filter
1269+
INTRINSICS.Iterator.prototype.filter:clo0
1270+
INTRINSICS.Iterator.prototype.find
1271+
INTRINSICS.Iterator.prototype.flatMap
1272+
INTRINSICS.Iterator.prototype.flatMap:clo0
1273+
INTRINSICS.Iterator.prototype.forEach
1274+
INTRINSICS.Iterator.prototype.map
1275+
INTRINSICS.Iterator.prototype.map:clo0
1276+
INTRINSICS.Iterator.prototype.reduce
1277+
INTRINSICS.Iterator.prototype.some
1278+
INTRINSICS.Iterator.prototype.take
1279+
INTRINSICS.Iterator.prototype.take:clo0
1280+
INTRINSICS.Iterator.prototype.toArray
1281+
INTRINSICS.Iterator.prototype[%Symbol.iterator%]
1282+
INTRINSICS.IteratorHelperPrototype.next
1283+
INTRINSICS.IteratorHelperPrototype.return
12621284
INTRINSICS.Map
12631285
INTRINSICS.Map.groupBy
12641286
INTRINSICS.Map.prototype.clear
@@ -1479,6 +1501,8 @@ INTRINSICS.WeakRef.prototype.deref
14791501
INTRINSICS.WeakSet
14801502
INTRINSICS.WeakSet.prototype.add
14811503
INTRINSICS.WeakSet.prototype.has
1504+
INTRINSICS.WrapForValidIteratorPrototype.next
1505+
INTRINSICS.WrapForValidIteratorPrototype.return
14821506
INTRINSICS.decodeURI
14831507
INTRINSICS.decodeURIComponent
14841508
INTRINSICS.encodeURI
@@ -1493,6 +1517,8 @@ INTRINSICS.get Array[%Symbol.species%]
14931517
INTRINSICS.get DataView.prototype.buffer
14941518
INTRINSICS.get DataView.prototype.byteLength
14951519
INTRINSICS.get DataView.prototype.byteOffset
1520+
INTRINSICS.get Iterator.prototype.constructor
1521+
INTRINSICS.get Iterator.prototype[%Symbol.toStringTag%]
14961522
INTRINSICS.get Map.prototype.size
14971523
INTRINSICS.get Map[%Symbol.species%]
14981524
INTRINSICS.get Object.prototype.__proto__
@@ -1522,6 +1548,8 @@ INTRINSICS.get TypedArray[%Symbol.species%]
15221548
INTRINSICS.isFinite
15231549
INTRINSICS.isNaN
15241550
INTRINSICS.print
1551+
INTRINSICS.set Iterator.prototype.constructor
1552+
INTRINSICS.set Iterator.prototype[%Symbol.toStringTag%]
15251553
INTRINSICS.set Object.prototype.__proto__
15261554
INTRINSICS.yet:PromiseRejectFunction
15271555
INTRINSICS.yet:PromiseResolveFunction
@@ -2217,6 +2245,7 @@ SetImmutablePrototype
22172245
SetIntegrityLevel
22182246
SetTypedArrayFromArrayLike
22192247
SetTypedArrayFromTypedArray
2248+
SetterThatIgnoresPrototypeProperties
22202249
ShiftExpression[1,0].AssignmentTargetType
22212250
ShiftExpression[1,0].Evaluation
22222251
ShiftExpression[1,0].HasCallInTailPosition
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
- version: 2e161460ba8d084b734bb90e2379f43ceb3e8140
1+
- version: 961f269c227b7892c21487d82b28d3e8b86e0d4f
22
- grammar:
33
- productions: 373
44
- lexical: 162
55
- numeric string: 16
66
- syntactic: 195
77
- extended productions for web: 29
8-
- algorithms: 2786 (88.37%)
9-
- complete: 2462
8+
- algorithms: 2810 (88.47%)
9+
- complete: 2486
1010
- incomplete: 324
11-
- algorithm steps: 20799 (96.93%)
12-
- complete: 20161
11+
- algorithm steps: 21142 (96.98%)
12+
- complete: 20504
1313
- incomplete: 638
14-
- types: 7368 (97.45%)
15-
- known: 7180
16-
- yet: 188
17-
- unknown: 633
14+
- types: 7442 (97.46%)
15+
- known: 7253
16+
- yet: 189
17+
- unknown: 654
1818
- tables: 93
1919
- type model: 94

src/main/scala/esmeta/es/builtin/Intrinsics.scala

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ case class Intrinsics(cfg: CFG) {
461461
typeName = "OrdinaryObject",
462462
imap = List(
463463
"Extensible" -> Bool(true),
464-
"Prototype" -> intrAddr("IteratorPrototype"),
464+
"Prototype" -> intrAddr("Iterator.prototype"),
465465
),
466466
nmap = List(
467467
"%Symbol.toStringTag%" -> DataProperty(Str("String Iterator"), F, F, T),
@@ -558,7 +558,7 @@ case class Intrinsics(cfg: CFG) {
558558
typeName = "OrdinaryObject",
559559
imap = List(
560560
"Extensible" -> Bool(true),
561-
"Prototype" -> intrAddr("IteratorPrototype"),
561+
"Prototype" -> intrAddr("Iterator.prototype"),
562562
),
563563
nmap = List(
564564
"%Symbol.toStringTag%" -> DataProperty(Str("Array Iterator"), F, F, T),
@@ -590,7 +590,7 @@ case class Intrinsics(cfg: CFG) {
590590
typeName = "OrdinaryObject",
591591
imap = List(
592592
"Extensible" -> Bool(true),
593-
"Prototype" -> intrAddr("IteratorPrototype"),
593+
"Prototype" -> intrAddr("Iterator.prototype"),
594594
),
595595
nmap = List(
596596
"%Symbol.toStringTag%" -> DataProperty(Str("Map Iterator"), F, F, T),
@@ -627,7 +627,7 @@ case class Intrinsics(cfg: CFG) {
627627
typeName = "OrdinaryObject",
628628
imap = List(
629629
"Extensible" -> Bool(true),
630-
"Prototype" -> intrAddr("IteratorPrototype"),
630+
"Prototype" -> intrAddr("Iterator.prototype"),
631631
),
632632
nmap = List(
633633
"%Symbol.toStringTag%" -> DataProperty(Str("Set Iterator"), F, F, T),
@@ -728,17 +728,31 @@ case class Intrinsics(cfg: CFG) {
728728
"%Symbol.toStringTag%" -> DataProperty(Str("Map"), F, F, T),
729729
),
730730
),
731-
"IteratorPrototype" -> Struct(
731+
"Iterator.prototype" -> Struct(
732732
typeName = "OrdinaryObject",
733733
imap = List(
734734
"Extensible" -> Bool(true),
735735
"Prototype" -> intrAddr("Object.prototype"),
736736
),
737+
nmap = List(
738+
"constructor" -> AccessorProperty(
739+
intrAddr("get Iterator.prototype.constructor"),
740+
intrAddr("set Iterator.prototype.constructor"),
741+
F,
742+
T,
743+
),
744+
"%Symbol.toStringTag%" -> AccessorProperty(
745+
intrAddr("get Iterator.prototype[%Symbol.toStringTag%]"),
746+
intrAddr("set Iterator.prototype[%Symbol.toStringTag%]"),
747+
F,
748+
T,
749+
),
750+
),
737751
),
738752
"ForInIteratorPrototype" -> Struct(
739753
typeName = "OrdinaryObject",
740754
imap = List(
741-
"Prototype" -> intrAddr("IteratorPrototype"),
755+
"Prototype" -> intrAddr("Iterator.prototype"),
742756
),
743757
),
744758
"AsyncIteratorPrototype" -> Struct(
@@ -850,18 +864,18 @@ case class Intrinsics(cfg: CFG) {
850864
typeName = "OrdinaryObject",
851865
imap = List(
852866
"Extensible" -> Bool(true),
853-
"Prototype" -> intrAddr("IteratorPrototype"),
867+
"Prototype" -> intrAddr("Iterator.prototype"),
854868
),
855869
nmap = List(
856870
"constructor" ->
857871
DataProperty(intrAddr("GeneratorFunction.prototype"), F, F, T),
858872
// XXX need to be documented
859-
"next" -> DataProperty(
860-
intrAddr("GeneratorPrototype.next"),
861-
T,
862-
F,
863-
T,
864-
),
873+
// "next" -> DataProperty(
874+
// intrAddr("GeneratorPrototype.next"),
875+
// T,
876+
// F,
877+
// T,
878+
// ),
865879
"%Symbol.toStringTag%" -> DataProperty(Str("Generator"), F, F, T),
866880
),
867881
),
@@ -956,6 +970,37 @@ case class Intrinsics(cfg: CFG) {
956970
"name" -> DataProperty(Str(""), F, F, F),
957971
),
958972
),
973+
"Iterator" -> Struct(
974+
typeName = "BuiltinFunctionObject",
975+
imap = List(
976+
"Construct" -> clo("Record[BuiltinFunctionObject].Construct"),
977+
),
978+
nmap = List(
979+
"prototype" -> DataProperty(
980+
intrAddr("Iterator.prototype"),
981+
F,
982+
F,
983+
F,
984+
),
985+
"%Symbol.toStringTag%" -> DataProperty(Str("Iterator"), F, F, T),
986+
),
987+
),
988+
"IteratorHelperPrototype" -> Struct(
989+
typeName = "OrdinaryObject",
990+
imap = List(
991+
"Extensible" -> Bool(true),
992+
"Prototype" -> intrAddr("Iterator.prototype"),
993+
),
994+
nmap = List(
995+
"%Symbol.toStringTag%" -> DataProperty(Str("Iterator Helper"), F, F, T),
996+
),
997+
),
998+
"WrapForValidIteratorPrototype" -> Struct(
999+
typeName = "OrdinaryObject",
1000+
imap = List(
1001+
"Prototype" -> intrAddr("Iterator.prototype"),
1002+
),
1003+
),
9591004
)
9601005

9611006
// error constructors

tests/test262

Submodule test262 updated 4873 files

0 commit comments

Comments
 (0)