Parents: #475, #493 Related: #750, #751
Problem
The shared iteratorOf entry point is more permissive than ECMA-262 GetIterator:
- an ordinary object with a
.nextproperty but noSymbol.iteratoris accepted as iterable; - generator objects are returned before their observable
Symbol.iteratorproperty is read, so an override, getter, deletion, or non-callable value is ignored.
A current-main probe returns false,1,1,0 for [manualObjectThrew, manualNextCalls, overriddenGeneratorSum, iteratorGetterCalls]; the specified result is true,0,7,1. This affects consumers such as Math.sumPrecise even though their subsequent IteratorStep behavior is correct.
Scope
- Make the language GetIterator path perform ordinary GetMethod on
@@iterator, require it to be callable, call it once with the input as receiver, and require an Object result. - Honor observable overrides/deletions on generator and other built-in iterator objects.
- Keep deliberate GetIteratorDirect/GetIteratorFlattenable consumers distinct.
- Audit every
iteratorOfcaller for the correct abstract operation and retain one captured[[NextMethod]]per iterator record. - Preserve intrinsic array/string/Map/Set iteration behavior without changing their iterator storage or
nextimplementations.
No-workaround rules
- No
.next-property duck typing for GetIterator, generator/builtin bypass, array-only shortcut that skips observable@@iterator, repeated method lookup, source rewriting, or silent fallback after a missing/non-callable method. - No stack, queue, job, Promise, Worker, or Map/Set iterator implementation changes.
Acceptance
- Plain
.nextobjects are rejected without callingnext; an explicit@@iteratormakes them iterable. - Generator/builtin
@@iteratorgetters, overrides, deletion, non-callable values, receiver, and result validation are observed in spec order. - Every
iteratorOfcaller is classified as GetIterator, GetIteratorDirect, or GetIteratorFlattenable and captures[[NextMethod]]once where required. - Focused units, affected Test262 iterator/builtin subtrees, and full integration gates pass with exact nonzero accounting and zero unrelated flips.