mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
close #7323 According to the specification re-design the JavaScript-part ReferenceFlags inferring approach. * https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation * https://tc39.es/ecma262/#sec-postfix-increment-operator-runtime-semantics-evaluation * https://tc39.es/ecma262/#sec-runtime-semantics-restdestructuringassignmentevaluation * ... See references of https://tc39.es/ecma262/#sec-putvalue ### Changes 1. The left-hand of `AssignmentExpression` is always `ReferenceFlags::Write` ```js let a = 0; console.log(a = 0); ^ Write only ``` 2. The `argument` of `UpdateExpression` is always `ReferenceFlags::Read | Write` ```js let a = 0; a++; ^ Read and Write ``` This change might cause some trouble for `Minfier` to remove this code, because ‘a’ is not used elsewhere. I have taken a look at `esbuild` and `Terser`. Only the `Terser` can remove this code. |
||
|---|---|---|
| .. | ||
| generated | ||
| class.rs | ||
| identifier.rs | ||
| keyword.rs | ||
| lib.rs | ||
| module_graph_visitor.rs | ||
| module_record.rs | ||
| node.rs | ||
| number.rs | ||
| operator.rs | ||
| precedence.rs | ||
| reference.rs | ||
| scope.rs | ||
| symbol.rs | ||
| xml_entities.rs | ||