mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
A constructor read on a class instance through an untyped value answered the class itself whenever the class's prototype object did not hold an own `constructor`. After `delete Object.getPrototypeOf(new Middle()).constructor`, Node reads the property the base class's prototype holds, and past the last class's prototype Object.prototype's. The read now checks the instance's own property, then walks the class's prototypes: each answers its own `constructor`; a prototype without one answers its class unless reflection had populated it, in which case the program deleted the property and the read continues to the base class's prototype, and from the last one to Object.prototype. Reflection sets a per-class flag when the prototype initializes, so the answer does not depend on whether the reflection was compiled before the read. Corpus 8260 gains the deletion case.