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>
8 lines
291 B
JavaScript
8 lines
291 B
JavaScript
// Nested ternary — right-associative: a ? b : c ? d : e → a ? b : (c ? d : e)
|
|
var a = true ? "first" : false ? "second" : "third";
|
|
console.log(a);
|
|
var b = false ? "first" : true ? "second" : "third";
|
|
console.log(b);
|
|
var c = false ? "first" : false ? "second" : "third";
|
|
console.log(c);
|