tc39 / test262

Official ECMAScript Conformance Test Suite
Other
2.31k stars 459 forks source link

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

Open gibson042 opened 11 months ago

gibson042 commented 11 months ago

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

bakkot commented 11 months ago

See also https://github.com/tc39/test262/issues/1362