-
-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(semantic)!: correct all ReferenceFlags::Write
according to the spec
#7388
fix(semantic)!: correct all ReferenceFlags::Write
according to the spec
#7388
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
ReferenceFlags
from Visit
methods
f3b83b8
to
edcf14b
Compare
ReferenceFlags
from Visit
methodsReferenceFlags
inferring approach
CodSpeed Performance ReportMerging #7388 will not alter performanceComparing Summary
|
bab338b
to
419b321
Compare
I prefer to fix transformer-related semantic errors in follow-up PR, but if you think should be fixed in this PR I am okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the test case to no-const-assign?
const FOO = 1;
({
files = FOO,
} = arg1);
Can
Can you add all the assignment cases to no object assign? |
Added
I have already added a lot of assignment-related tests in semantic. |
ReferenceFlags
inferring approachReferenceFlags::Write
according to the spec
b3a05fa
to
8c295bd
Compare
Merge activity
|
…spec (#7388) 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.
8c295bd
to
c28477b
Compare
…spec (#7388) 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.
c28477b
to
6f0fe38
Compare
@Dunqing Is |
close #7323
According to the specification re-design the JavaScript-part ReferenceFlags inferring approach.
Changes
AssignmentExpression
is alwaysReferenceFlags::Write
argument
ofUpdateExpression
is alwaysReferenceFlags::Read | Write
This change might cause some trouble for
Minfier
to remove this code, because ‘a’ is not used elsewhere. I have taken a look atesbuild
andTerser
. Only theTerser
can remove this code.