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

8$: Error on await () => {} #279

Closed
strager opened this issue May 10, 2021 · 2 comments
Closed

8$: Error on await () => {} #279

strager opened this issue May 10, 2021 · 2 comments
Assignees
Labels
for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html

Comments

@strager
Copy link
Collaborator

strager commented May 10, 2021

Within async functions, await () => {} is invalid syntax, at least according to Node.js v15.5.1:

async function g() {
  f(await () => {});
}
g();
hello.js:2
  f(await () => {});
    ^^^^^^^

SyntaxError: Malformed arrow function parameter list

quick-lint-js reports no error for this code. Assuming that Node.js is standards-conforming, quick-lint-js should report an error for an attempted await for an arrow function.

@strager
Copy link
Collaborator Author

strager commented May 10, 2021

#278 is a related issue. #278 is about async()=>{} outside async functions. This task is about async()=>{} inside async functions. Perhaps the end result should be the same (i.e. same diagnostic and error recovery), but the parsing code seems to be different, so I thought they deserved separate tasks.

@strager strager changed the title Error on await () => {} 8$: Error on await () => {} May 10, 2021
@strager strager added the for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html label May 10, 2021
@keyehzy
Copy link
Contributor

keyehzy commented May 17, 2021

Will try this one, PR'ing soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html
Projects
None yet
Development

No branches or pull requests

2 participants