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

Strange input allowed in single-argument function shorthand #885

Closed
imm opened this issue Dec 19, 2023 · 1 comment · Fixed by #886
Closed

Strange input allowed in single-argument function shorthand #885

imm opened this issue Dec 19, 2023 · 1 comment · Fixed by #886
Assignees
Labels
bug Something isn't working

Comments

@imm
Copy link

imm commented Dec 19, 2023

After looking at the fun uses of await and delete that we get after #883, I found that civet accepts this kind of input

x.filter not.condition
x.forEach delete.old

↓↓↓

x.filter(($) => !$.condition);
x.forEach(($1) => delete$1.old);

In my opinion either this should be invalid syntax or there should be a space after delete

This trick doesn't work with await:

x.map await.json()
                 ^ ParseError
@edemaine edemaine added the bug Something isn't working label Dec 19, 2023
@edemaine edemaine self-assigned this Dec 19, 2023
edemaine added a commit that referenced this issue Dec 19, 2023
@edemaine
Copy link
Collaborator

Thanks for spotting this so quickly! Should be fixed by #886.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants