Skip to content
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

[Merged by Bors] - Remove empty expression in expression statement with top level await #630

Closed
wants to merge 3 commits into from

Conversation

dsherret
Copy link
Contributor

@dsherret dsherret commented Feb 6, 2020

Eats the semi-colon.

This doesn't compile (edit: doesn't compile the code in the tests) though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!

@dsherret dsherret changed the title Fix EmptyExpression parsed in top level await with no empty expression Remove empty expression in expression statement with top level await Feb 6, 2020
@kdy1
Copy link
Member

kdy1 commented Feb 6, 2020

bors r+

bors bot pushed a commit that referenced this pull request Feb 6, 2020
…630)

Eats the semi-colon.

This doesn't compile though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!
@bors
Copy link
Contributor

bors bot commented Feb 6, 2020

Build failed

  • continuous-integration/travis-ci/push

@dsherret
Copy link
Contributor Author

dsherret commented Feb 6, 2020

@kdy1 do you have any suggestions for resolving this failed test:

========== Running reference test await-expression/input.ts
Source:
await    test   ;


/home/runner/work/swc/swc/ecmascript/parser/tests/typescript/await-expression/input.ts.json:/home/runner/work/swc/swc/ecmascript/parser/target/swc-test-results/ui/tests/typescript/await-expression/input.ts.json
thread 'typescript::reference::await-expression/input.ts' panicked at 'called `Result::unwrap()` on an `Err` value: error: top level await requires target to es2017 or higher and topLevelAwait:true for ecmascript
 --> $DIR/tests/typescript/await-expression/input.ts:1:1
  |
1 | await    test   ;
  | ^^^^^

', ecmascript/parser/tests/typescript.rs:111:17

I feel like these AST parsing tests should not be dependent on the specified target and any target specific tests should live elsewhere. If I remove this requirement though then another test fails that checks for this error.

@kdy1
Copy link
Member

kdy1 commented Feb 7, 2020

Hmm... 🤔
I can move this to the top crate (swc), to use swcrc
Do you mind me adding some commits to your pr?

@dsherret
Copy link
Contributor Author

dsherret commented Feb 7, 2020

@kdy1 for sure. Please!

@kdy1 kdy1 added this to the v1.1.18 milestone Feb 7, 2020
@kdy1
Copy link
Member

kdy1 commented Feb 7, 2020

bors r+

bors bot pushed a commit that referenced this pull request Feb 7, 2020
…630)

Eats the semi-colon.

This doesn't compile (edit: doesn't compile the code in the tests) though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!
@bors
Copy link
Contributor

bors bot commented Feb 7, 2020

Build succeeded

  • continuous-integration/travis-ci/push

@bors
Copy link
Contributor

bors bot commented Feb 7, 2020

Pull request successfully merged into master.

@bors bors bot changed the title Remove empty expression in expression statement with top level await [Merged by Bors] - Remove empty expression in expression statement with top level await Feb 7, 2020
@bors bors bot closed this Feb 7, 2020
@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants