fix(parser): do not double-parse modifiers of ts index signature in class#6985
fix(parser): do not double-parse modifiers of ts index signature in class#6985branchseer wants to merge 3 commits intooxc-project:mainfrom
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
| assert_eq!(ret.errors.first().unwrap().to_string(), "Source length exceeds 4 GiB limit"); | ||
| } | ||
|
|
||
| #[test] |
There was a problem hiding this comment.
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.
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.
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
readonlyandspanin ast. https://oxc-project.github.io/oxc/playground/?code=3YCAAICvgICAgICAgICxG4jI43W9aqTWr3Wzy1UcIvgVm0uDVLP%2FHYReSN%2FJ0Mhppm0XIo%2F7DW7cd39qCwCA