test262 icon indicating copy to clipboard operation
test262 copied to clipboard

Iterator Helpers

Open rwaldron opened this issue 5 years ago • 2 comments
trafficstars

rwaldron avatar Sep 24 '20 18:09 rwaldron

@jugglinmike this will likely be relevant to your efforts in 2021. Please feel free to revise in any way that you see fit.

rwaldron avatar Jan 18 '21 17:01 rwaldron

Dusting this off.

Today I was able to run these tests with SpiderMonkey's iterator helpers feature enabled. Here's how:

  1. Run esvu for latest JS engines
  2. 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

rwaldron avatar Dec 02 '21 15:12 rwaldron

@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?

michaelficarra avatar Dec 01 '22 13:12 michaelficarra

Do we want to use #3728?

Ms2ger avatar Dec 01 '22 15:12 Ms2ger

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.

michaelficarra avatar Mar 10 '23 18:03 michaelficarra

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?

ljharb avatar Mar 22 '23 21:03 ljharb

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

michaelficarra avatar Apr 26 '23 02:04 michaelficarra

@tc39/test262-maintainers @syg Alright, iterator helpers tests should be complete. Please review.

michaelficarra avatar May 25 '23 21:05 michaelficarra

just curious, why the switch from postincrement to preincrement?

ljharb avatar May 25 '23 22:05 ljharb

@ljharb I just like them better.

michaelficarra avatar May 25 '23 22:05 michaelficarra

@ljharb I just like them better.

preincrements are faster bro

syg avatar May 26 '23 14:05 syg

Addressed feedback from @syg and rebased.

michaelficarra avatar May 31 '23 19:05 michaelficarra

@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.

michaelficarra avatar Jun 09 '23 17:06 michaelficarra

@ptomato Tests are passing.

michaelficarra avatar Jun 12 '23 16:06 michaelficarra