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

7$: Error if await or yield is used in parameter list #241

Open
strager opened this issue Apr 24, 2021 · 2 comments
Open

7$: Error if await or yield is used in parameter list #241

strager opened this issue Apr 24, 2021 · 2 comments
Labels
false negative Bug: quick-lint-js accepts syntatically-invalid code for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html

Comments

@strager
Copy link
Collaborator

strager commented Apr 24, 2021

await and yield expressions are not allowed in function or arrow function parameter lists. Error if one is seen.

Example:

async function f(x = await null) {}
@strager strager added good third issue for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html labels Apr 24, 2021
strager added a commit that referenced this issue Apr 28, 2021
@bruno-costanzo
Copy link

what are you looking for? that the function allow the await function or to parse it to avoid the error?

@strager
Copy link
Collaborator Author

strager commented Apr 30, 2021

what are you looking for? that the function allow the await function or to parse it to avoid the error?

I want quick-lint-js to report an error. Currently quick-lint-js reports no error. Example of what I expect:

async function f(x = await null) {}
                     ^^^^^ error: await is not allowed in parameter default values

await is already allowed inside the body of an async function. This task is about await specifically in the parameter list, which is disallowed per the language standard.

@strager strager added the false negative Bug: quick-lint-js accepts syntatically-invalid code label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false negative Bug: quick-lint-js accepts syntatically-invalid code 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