mirror of
https://github.com/danbulant/oxc
synced 2026-05-22 05:38:54 +00:00
compresses `a ? b = 0 : b = 1` into `b = a ? 0 : 1` This can be done when `b` is an IdentifierReference and the assignment operator is `=`. In this circumstance, the evaluation of `b = a ? 0 : 1` is: 1. Let lref be ? Evaluation of LeftHandSideExpression. (this does not have a side effect when LeftHandSideExpression is an IdentifierReference) 2. Let rref be ? Evaluation of AssignmentExpression. (ConditionalExpression is evaluated here) 3. Let rval be ? GetValue(rref). 4. Perform ? PutValue(lref, rval). 5. Return rval. **References** - [spec of `=`](https://262.ecma-international.org/15.0/index.html#sec-assignment-operators-runtime-semantics-evaluation) - [spec of `? :`](https://262.ecma-international.org/15.0/index.html#sec-conditional-operator-runtime-semantics-evaluation) |
||
|---|---|---|
| .. | ||
| ast_tools | ||
| benchmark | ||
| common | ||
| compat_data | ||
| coverage | ||
| javascript_globals | ||
| lint_rules | ||
| minsize | ||
| prettier_conformance | ||
| rulegen | ||
| transform_checker | ||
| transform_conformance | ||
| website | ||