Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

keyehzy
Copy link
Contributor

@keyehzy keyehzy commented Nov 8, 2021

Right now quick-lint-js for the following code

let f = await () => { 
  await g(); 
};

correctly detects the intention of user to use async instead of await but throw another error for await expression inside the arrow function. This PR fix this by parsing the subsequent expression as a async expression if we detect such intention.

This PR should also fix #278.

If we detect that `await` is followed by an arrow function early inside
`is_identifier` function we can avoid treating `await` as an identifier
and correctly identify that the intention of the user was to use `async`.
We detect that the intention of the user was to use `async` and parse
its child as if so.
@keyehzy
Copy link
Contributor Author

keyehzy commented Nov 8, 2021

Not sure why dnf doesn't like, welp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7$: Improve error message for 'await () => {}'
1 participant