-
Notifications
You must be signed in to change notification settings - Fork 3
Support optional chaining assignment #1024
Copy link
Copy link
Open
Labels
engineTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMnew featureNew feature or requestNew feature or requestspec complianceMismatch against official JavaScript/TypeScript specificationMismatch against official JavaScript/TypeScript specification
Milestone
Description
Metadata
Metadata
Assignees
Labels
engineTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMnew featureNew feature or requestNew feature or requestspec complianceMismatch against official JavaScript/TypeScript specificationMismatch against official JavaScript/TypeScript specification
Summary
Implement the Stage 1 TC39 proposal: https://github.com/tc39/proposal-optional-chaining-assignment
Implement all current proposal assignment forms with nullish short-circuiting, single base/key/RHS evaluation, and correct result semantics.
Why
This proposal fits GocciaScript's modern ECMAScript surface and the 0.13.0 proposal roadmap. It should extend the engine's existing architecture rather than arrive as a userland shim.
Current behavior
Optional chaining works for reads and calls but is rejected as an assignment target.
Expected behavior
Implement all current proposal assignment forms with nullish short-circuiting, single base/key/RHS evaluation, and correct result semantics.
Scope notes
Extend assignment-target validation and bytecode reference lowering without duplicating getters, keys, proxies, or side effects. Preserve strict-mode/private-field rules and early errors. Previously-invalid additive syntax: no flag.
Related bytecode roadmap: #871 and #875. Update relevant documentation and the Goccia proposal inventory. Use the current proposal specification at implementation time; add focused project tests and matching pinned Test262/proposal coverage without regressions.
Acceptance criteria