Some checks failed
ci / fast (linux) (push) Failing after 12m31s
Implements the conditional/ternary operator across tokenizer, parser, and VM with correct precedence (between assignment and logical-or), right-associativity, short-circuit evaluation, and nesting depth guard. Promotes js262-ternary-operator to pass and adds 3 new conformance tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9 lines
145 B
JavaScript
9 lines
145 B
JavaScript
// Only the taken branch should be evaluated
|
|
var x = 0;
|
|
true ? x = 1 : x = 2;
|
|
console.log(x);
|
|
|
|
var y = 0;
|
|
false ? y = 1 : y = 2;
|
|
console.log(y);
|