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

Top level await in REPL #5446

Closed
pannous opened this issue May 15, 2020 · 3 comments
Closed

Top level await in REPL #5446

pannous opened this issue May 15, 2020 · 3 comments

Comments

@pannous
Copy link

pannous commented May 15, 2020

Please run the topmost context in async mode, or allow top level await, akin to

https://bugs.chromium.org/p/v8/issues/detail?id=9344

@SyrupThinker
Copy link
Contributor

Top level await is already supported, see here.
Please check out said issue in case your particular issue has already been discussed there.

@pannous
Copy link
Author

pannous commented May 15, 2020

Sorry reading through the link's comments I couldn't find the option to activate this feature

> deno
Deno 1.0.0
exit using ctrl+d or close()
> console.log(await Promise.resolve('Success'))
  
> await fetch('http://test.com')
Uncaught SyntaxError: await is only valid in async function

@pannous pannous changed the title Top level await Top level await in REPL May 15, 2020
@bartlomieju
Copy link
Member

Duplicate of #3029

@bartlomieju bartlomieju marked this as a duplicate of #3029 May 15, 2020
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

No branches or pull requests

3 participants