Parent: #746 Parents of parent: #465, #498 Discovered by: #745
Problem
Base class constructors without instance fields already own ordinary VM chunks, but buildClass marks every constructor with instance initializers as plain_policy_class_constructor_semantics. The field AST is currently retained separately for tree-walk execution before parameter binding, so required bytecode cannot construct even a base class C { value = 1 }.
Scope
- Compile base-class instance initialization as a constructor-chunk prefix before arguments-object creation, parameter defaults/destructuring, and the constructor body.
- Resolve field initializer identifiers through the class-definition closure, never constructor parameter/body slots.
- Implement canonical public
CreateDataPropertyOrThrowand privatePrivateFieldAddoperations, including anonymous-function naming, computed names already evaluated once at class definition, private method/accessor brands before fields, and source-order initialization. - Preserve field-initializer lexical context for
this,superproperties,new.target === undefined, direct-eval restrictions, and arrows across nested calls, errors, moving GC, OOM, and shared no-GIL execution. - Remove the class-constructor policy barrier only for base constructors whose complete initializer prefix lowers; derived constructors remain under #746 until
super()activation is represented.
No-workaround rules
- No eager field evaluation at class definition, AST callback from bytecode, source rewriting, constructor-shape whitelist, parameter-slot aliasing, duplicate computed-name evaluation, setter-based public field assignment, skipped private brand checks, or hidden fallback in required mode.
- No stacks, queues, jobs, Promise, microtask, Worker lifecycle, or Map/Set iterator changes.
Acceptance
- Forced tree-walker and required bytecode agree on public/private fields, auto-accessor storage, computed names, anonymous naming, brand/field order, prototype-setter shadowing, non-extensible errors, and field-before-parameter ordering.
- Field initializers resolve the class closure rather than constructor parameters/body locals and preserve
this,super,new.target, direct-eval restrictions, and arrow lexical state. - Admission inventory compiles complete base-field constructors while derived constructors stay causally fail-closed under #746.
- Moving-GC, OOM restoration, shared no-GIL, TSan, focused frontend/compiler/VM, full units, threadfuzz, and exact nonzero relevant Test262 accounting pass with zero regressions.
- A conventional commit lands directly on
mainand cross-links #465, #498, #745, and #746.