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).
Statements like
const [] = iterable
andconst [x, y] = iterable
should get an iterator fromiterable
and cache itsnext
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