Found while fixing #11692 (PR #11697). Both reproduce on pristine main 6a50907 and are unrelated to that fix.
super[Symbol.iterator]() recurses until the stack overflows
class B { *[Symbol.iterator]() { yield 1; yield 2; } }
class D extends B { [Symbol.iterator]() { return super[Symbol.iterator](); } }
console.log([...new D()]); // node: [ 1, 2 ]; perry: stack overflow
delete C.prototype[Symbol.iterator] doesn't remove the method
class C { *[Symbol.iterator]() { yield 1; } }
delete (C.prototype as any)[Symbol.iterator];
console.log(Symbol.iterator in new C()); // node: false; perry: true
Likely cause: symbol-keyed class methods are dispatched under internal names (@@iterator) and stored under the symbol key. super lookup and delete don't resolve that mapping the same way the call path does.
Found while fixing #11692 (PR #11697). Both reproduce on pristine main 6a50907 and are unrelated to that fix.
super[Symbol.iterator]()recurses until the stack overflowsdelete C.prototype[Symbol.iterator]doesn't remove the methodLikely cause: symbol-keyed class methods are dispatched under internal names (
@@iterator) and stored under the symbol key.superlookup anddeletedon't resolve that mapping the same way the call path does.