test262
test262 copied to clipboard
Iterator Helpers
@jugglinmike this will likely be relevant to your efforts in 2021. Please feel free to revise in any way that you see fit.
Dusting this off.
Today I was able to run these tests with SpiderMonkey's iterator helpers feature enabled. Here's how:
- Run
esvufor latest JS engines - In the root of this repo, run:
test262-harness -t 16 --hostType=sm --hostPath=$(which sm) --hostArgs='--enable-iterator-helpers' 'test/built-ins/AsyncIterator/**/*.js'
My current results:
λ test262-harness -t 16 --hostType=sm --hostPath=$(which sm) --hostArgs='--enable-iterator-helpers' 'test/built-ins/AsyncIterator/**/*.js'
FAIL test/built-ins/AsyncIterator/prop-desc.js (strict mode)
Expected no error, got ReferenceError: AsyncIterator is not defined
FAIL test/built-ins/AsyncIterator/prop-desc.js (default)
Expected no error, got ReferenceError: AsyncIterator is not defined
Ran 192 tests
190 passed
2 failed
test262-harness -t 16 --hostType=sm --hostPath=$(which sm) 8.56s user 2.99s system 222% cpu 5.191 total
@Ms2ger the proposal is now stage 3.
Would anyone like to pick up this PR and update it to match the current state of the proposal?
Do we want to use #3728?
I've updated the tests in this branch to cover just the sync iterator helpers, as the async iterator helpers have been split into their own proposal (and demoted to stage 2). Next, I'll review the existing tests for completeness and update/add tests as necessary, then I'll add tests to cover the remaining helpers that were not yet covered.
Does https://github.com/tc39/test262/blob/main/test/built-ins/Object/prototype/toString/symbol-tag-non-str-builtin.js#L29 need to be updated as well, since Iterator.prototype[Symbol.toStringTag] will now exist?
Status update:
- [X] Iterator constructor
- [X] Iterator.from
- [X] Symbol.toStringTag
- [X] drop
- [X] every
- [X] filter
- [X] find
- [X] flatMap
- [X] forEach
- [X] map
- [x] reduce
- [X] some
- [X] take
- [x] toArray
@tc39/test262-maintainers @syg Alright, iterator helpers tests should be complete. Please review.
just curious, why the switch from postincrement to preincrement?
@ljharb I just like them better.
@ljharb I just like them better.
preincrements are faster bro
Addressed feedback from @syg and rebased.
@tc39/test262-maintainers Any idea what the review process/timeline is going to look like for this? Implementations are already well underway, and we have approvals from both @syg and @ljharb.
@ptomato Tests are passing.