tc39 / tc39/test262

Missing tests for `next` caching in array-destructuring?

Open
#3,937 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

coverage
Dominant language
JavaScript
Stars
2.8k
Forks
564
Avg merge
3d 7h
Merged PRs (30d)
10

Description

Statements like const [] = iterable and const [x, y] = iterable should get an iterator from iterable and cache its next method, resulting in exactly one observable read thereof. But we may be missing coverage for this, as evidenced by https://github.com/Moddable-OpenSource/moddable/issues/1223 (unless the coverage is present and I've just missed it).

Related: https://github.com/tc39/ecma262/pull/1021

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching the test262 repository for existing array-destructuring and iterator tests, then review the behavior described in Moddable issue 1223 and the related ECMAScript pull request. Add coverage for empty and multi-element array destructuring, and confirm the tests observe exactly one read of the iterator's next method.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.