Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

WIP: Better error messaging for incorrect use of 'await' #194

Closed
wants to merge 1 commit into from

Conversation

kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented Oct 22, 2016

Fixes #113

This PR does two things:

Marking this as WIP because I haven't been able to figure out how to warn for await outside of functions safely. Please see comment below.

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token, expected ; (1:6)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still unsure how we can safely insert a better error message for this case, given that this needs to be allowed: https://github.com/babel/babylon/blob/master/test/fixtures/esprima/es2015-identifier/valid_await/actual.js

If it must be surrounded by parens, we can definitely make that warning. Otherwise, not sure how to do that one. Any ideas?

@kaicataldo
Copy link
Member Author

kaicataldo commented Oct 22, 2016

Whoops, was just made aware of #125. Going to go ahead and close this.

@kaicataldo kaicataldo closed this Oct 22, 2016
@kaicataldo kaicataldo deleted the awaitbug branch October 22, 2016 19:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant