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

Unexpected SyntaxError while compiling await (() => 42) #27808

Open
Corei13 opened this issue Jan 24, 2025 · 1 comment
Open

Unexpected SyntaxError while compiling await (() => 42) #27808

Corei13 opened this issue Jan 24, 2025 · 1 comment
Labels
repl related to the Read-Eval-Print-Loop functionality of Deno

Comments

@Corei13
Copy link

Corei13 commented Jan 24, 2025

Version: Deno 2.1.7

> () => 42
[Function (anonymous)]
> await (() => 42)
Uncaught SyntaxError: Malformed arrow function parameter list
> await [() => 42]
[ [Function (anonymous)] ]
> const f = () => 42; await f
[Function: f]
> await function() { return 42 }
[Function (anonymous)]

await (() => 42) should be treated as a valid syntax.

@marvinhagemeister marvinhagemeister added the repl related to the Read-Eval-Print-Loop functionality of Deno label Jan 24, 2025
@marvinhagemeister
Copy link
Contributor

Can confirm. It doesn't reproduce in SWC and seems to only happens in repl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl related to the Read-Eval-Print-Loop functionality of Deno
Projects
None yet
Development

No branches or pull requests

2 participants