-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 string literal span on import/export specifiers to only include string literal #540
Conversation
…he string literal.
Filled this out based on other files.
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.
LGTM
I'll test it locally when I go home and merge it if the test successes
@@ -10,7 +10,7 @@ | |||
"type": "ImportDeclaration", | |||
"span": { | |||
"start": 0, | |||
"end": 26, | |||
"end": 27, |
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.
Import declaration should include the last semi-colon. This test and some others seem to be failing on master.
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.
Currently travis ci chokes on other tests for parser.
(It seems like a rustc version issue)
So I'll merge the pr after testing locally.
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.
Oh I see. By the way, feel free to make any edits to fix any mistakes I made. I am going a bit blind here because II'm not sure how to run the tests for this. (I tried cargo +nightly test --color always --all --all-features
, but it doesn't seem to run the input.json-like tests)
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.
cargo +nightly test --color always --all --all-features
invokes input.ts based reference testing, but it updates reference file when comparison failed. Note that this behavior was introduced to avoid updating test one by one.
@kdy1 thanks and no rush! I am building off the source anyway so this is not blocking me. What's the best way to run only one of these tests? I found I can run
|
The test issue_528 is declared on top level crate (swc), so you can just remove --all. |
I tested it locally, and got some failures. Related tests:
|
@kdy1 Oops... I accidentally looked at the 1-indexed "column" in my text editor instead of a 0-indexed value. I was correct originally then I changed it to be incorrect once I reviewed it. I fixed the other span issues. It's helpful to be able to run the tests, but there are a lot of changed files on my machine after running that (it changes them to all go from \r\n to \n). The tests should probably be changed to bring in everything as \n newlines from the file system... or I think perhaps I have a setting in git that's changing them to \r\n on Windows. |
Can you revert it?
Then I'll investigate. |
I changed the code to get the I think everything is good now! My "oops" was for a past mistake where I did it correctly, rechecked it in my editor and thought it was wrong (because the column value was 1-indexed), then made the numbers wrong based on that 1-index, then reverted it back to fix it. |
…verted it back to this)
I think it makes sense and you don't need to revert it. I'll merge pr soon. |
Merged it. Thank you for the pr!! |
Expanding on fix for #535. Took a look at the PR for that to figure this out.
Currently there's definitely going to be a failing test here. I still can't figure out how to compile the tests locally so I'm going to use the CI to test... (and to help me fill in the missing info in the json file that I know I'll get wrong the first time).