Compare commits

...

6 Commits

Author SHA1 Message Date
Fabrice Bellard
2d99c323a2 Iterator functions:
- removed memory leak
- don't close iterator when IteratorStepValue fails
- fixed  Iterator Wrap next() and return() arguments
- fixed Iterator.from()
2025-09-20 18:30:02 +02:00
Fabrice Bellard
cf0e179263 Iterator is an abstract class (bnoordhuis) 2025-09-20 17:05:13 +02:00
Fabrice Bellard
3dcca0d1d6 fix Iterator.prototype.constructor (initial patch by bnoordhuis) 2025-09-20 17:01:52 +02:00
Fabrice Bellard
b2ed2e91f5 added Iterator.prototype.[drop,filter,flatMap,map,take,every,find,forEach,some,reduce,[Symbol.toStringTag]] (saghul) 2025-09-20 16:47:43 +02:00
Fabrice Bellard
e924173c0f added Iterator.prototype.toArray and Iterator.from (bnoordhuis) 2025-09-20 16:27:45 +02:00
Fabrice Bellard
982b7aa14f added the Iterator object 2025-09-20 16:05:36 +02:00
4 changed files with 921 additions and 13 deletions

2
TODO
View File

@ -62,5 +62,5 @@ Optimization ideas:
Test262o: 0/11262 errors, 463 excluded
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
Result: 54/79801 errors, 1630 excluded, 6631 skipped
Result: 54/80760 errors, 1631 excluded, 6064 skipped
Test262 commit: e7e136756cd67c1ffcf7c09d03aeb8ad5a6cec0c

View File

@ -230,6 +230,9 @@ DEF(Map, "Map")
DEF(Set, "Set") /* Map + 1 */
DEF(WeakMap, "WeakMap") /* Map + 2 */
DEF(WeakSet, "WeakSet") /* Map + 3 */
DEF(Iterator, "Iterator")
DEF(IteratorHelper, "Iterator Helper")
DEF(IteratorWrap, "Iterator Wrap")
DEF(Map_Iterator, "Map Iterator")
DEF(Set_Iterator, "Set Iterator")
DEF(Array_Iterator, "Array Iterator")

924
quickjs.c

File diff suppressed because it is too large Load Diff

View File

@ -140,7 +140,7 @@ Intl.NumberFormat-v3=skip
Intl.RelativeTimeFormat=skip
Intl.Segmenter=skip
IsHTMLDDA
iterator-helpers=skip
iterator-helpers
iterator-sequencing=skip
json-modules
json-parse-with-source=skip
@ -304,6 +304,9 @@ test262/test/built-ins/String/prototype/split/cstm-split-on-string-primitive.js
# spec updates it in this case)
test262/test/staging/sm/Array/frozen-dense-array.js
# does not match spec
test262/test/staging/sm/Iterator/from/wrap-next-not-object-throws.js
# not supported
test262/test/staging/sm/extensions/censor-strict-caller.js
test262/test/staging/sm/JSON/parse-with-source.js