Parents: #465, #498 Depends on: #738 Related: #736
Implemented by: 840e24af
Problem
#738 admits source primitive literals, but equally environment-inert closed primitive expression trees remain rejected. Defaults such as -1, 1 + 2, false ? 1 : 2, and void 0 contain no identifier, call, member access, closure, class, object/array/regex creation, or dynamic lookup. Their operations may still allocate internal primitive backing or throw (for example BigInt division by zero), so they must execute normally in the ordered VM prologue rather than be folded or pre-evaluated.
Scope
- Admit a recursively closed grammar containing primitive literal leaves plus unary, binary, logical, conditional, and sequence expression nodes whose children are all in the same grammar.
- Evaluate the expression at every call only when the raw argument is exactly undefined, preserving short-circuiting, coercion, abrupt completion, BigInt behavior, and left-to-right entry ordering beside initializer-free patterns.
- Reuse #738’s exact immutable default-index metadata, unmapped arguments contract, malformed-layout validation, activation roots, and native/quick activation-elision guards.
- Cover signed Number/BigInt, arithmetic/comparison/bitwise/logical/conditional/sequence/void forms, provided-value bypass, throws/catches, methods/arrows/base constructors, recursion/reentrancy, moving GC, and shared-chunk no-GIL execution.
Identifiers (including source undefined), this, new.target, member/call/new expressions, functions/classes, object/array/regex/template literals, assignment/update/delete, yield/await, imports, and nested pattern expressions remain explicit barriers.
No-workaround rules
- No constant folding, host evaluation, source rewriting, tree-walker callback, truthiness substitution for undefined, swallowed throw/OOM, broadened grammar by a permissive default arm, or alternate metadata path.
- A newly added AST expression kind remains rejected until it receives an explicit semantic ruling.
- No stacks, queues, jobs, Promise, microtask, Worker lifecycle, or Map/Set iterator changes.
Acceptance
- Compiler tests prove every accepted recursive node family and stable rejection for every excluded family/rest mixture.
- Forced tree-walker and required bytecode agree on values, short-circuiting, abrupt completion, bypass, ordering, arguments, constructors/methods/arrows, recursion/reentrancy, and moving GC.
- Shared-chunk no-GIL/TSan and internal-allocation OOM witnesses remain exact.
- Full units, focused compiler/frontend/VM, threadfuzz, and exact nonzero Test262 default-parameter accounting pass with zero regressions.
- Conventional commit lands directly on main and cross-links #465, #498, #738, and #736.