-
-
Notifications
You must be signed in to change notification settings - Fork 475
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(parser): do not double-parse modifiers of ts index signature in class #6985
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. |
79a93e0
to
ae388ec
Compare
@@ -696,6 +696,23 @@ mod test { | |||
assert_eq!(ret.errors.first().unwrap().to_string(), "Source length exceeds 4 GiB limit"); | |||
} | |||
|
|||
#[test] |
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.
This file is for integration tests; parser tests should go into https://github.com/oxc-project/oxc/tree/main/tasks/coverage/misc/pass
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.
I think this fix can only be verified by examining the ast. It can't be done in there, can it?
I'm curious what project you are working on with |
CodSpeed Performance ReportMerging #6985 will not alter performanceComparing Summary
|
ae388ec
to
5ec7fbe
Compare
Just experimenting something 😄. Don't wanna spoil it now because I'm not sure if it's even viable. But if it is, I will surely let you guys know. |
Conformance tests say |
× TS(1071): 'static' modifier cannot appear on an index signature. | ||
╭─[typescript/tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature4.ts:12:5] | ||
11 │ interface IB { | ||
12 │ static [s: string]: number; |
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.
Looks like you forgot to check if static
is being used within an interface
Modifiers of ts index signatures in classes are parsed twice. The first one is ignored and the second one is always empty, causing the incorrect
readonly
andspan
in ast. https://oxc-project.github.io/oxc/playground/?code=3YCAAICvgICAgICAgICxG4jI43W9aqTWr3Wzy1UcIvgVm0uDVLP%2FHYReSN%2FJ0Mhppm0XIo%2F7DW7cd39qCwCA