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 breaks with parentheses #35276

Closed
kevinkassimo opened this issue Nov 21, 2019 · 2 comments
Closed

Top level await breaks with parentheses #35276

kevinkassimo opened this issue Nov 21, 2019 · 2 comments

Comments

@kevinkassimo
Copy link

kevinkassimo commented Nov 21, 2019

TypeScript Version: 3.7.2

Search Terms: Top

Code

const v = await (1);

Expected behavior:
No error thrown. (If renaming this file to .js extension, it would be accepted by runtimes that enables top-level await e.g. Deno, indicating this is accepted by engines like V8)

Actual behavior:

error TS2304: Cannot find name 'await'.

► file:///Users/kun/Projects/Deno/test/tla.ts:5:11

5 const v = await (1);
            ~~~~~

Playground Link: Not available

Related Issues: Not found

@kevinkassimo
Copy link
Author

Sorry, I thought 3.7 turns on top-level await support. Turns out Deno turns off top-level await warnings ourselves and TLA support for TS is not fully completed yet

@j-oliveras
Copy link
Contributor

As a reference, #25988 tracks adding top level await. Currently planed for 3.8.

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

2 participants