-
Notifications
You must be signed in to change notification settings - Fork 48
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
Error trying to use top-level await? #186
Comments
@KFlash to support this, is it just removing |
NVM, it seems more complex that that. |
hmm long time since I was focused on that kind of simple code :) You can't just remove that context, then tons of async tests will fail. Validate if you come directly from TopLevel when parsing out await is one option. If not in a func body, but on top level, parse it out. Follow the specs. But Meriyah is all about no-lookahead, so what if you do it simple and just add a 'await' keyword in 'StatementListItem'. It will only be invoked if on TopLevel. And deal with it from there? |
I will study the spec when I got more time. |
https://tc39.es/proposal-top-level-await/#sec-modules Adding it to StatementListItem seems not enough, there is also top-level AwaitExpression and few others. export const output = process((await dynamic).default, await data); |
PrimaryExpression? |
I don't understand that spec notation well enough to understand what's changed in the above proposed spec change. |
then open an issue and mark it as "Good first issue" 👍 |
Any plans to implement this? |
No. I have not spent any time on this. |
TLA has been stage-4 now. refs: tc39/proposals@99fa42a |
@aladdin-add Stage 4? So it needs to be implemented in Kataw too? |
yes! |
and class fields. refs: tc39/ecma262#1668 |
Any eta on when this may get looked ? It's completely fine if the answer is "not for a while", we're just looking for a fix in Snowpack and may move back to acorn (at least for now) if that's the case FredKSchott/snowpack#2987 |
At least I am not working on this, not much spare time. @KFlash ? |
Everyone can do a PR. I'm busy with Kataw. @FredKSchott Acorn's implementation has some flaws / bugs. They recently fixed one bug. |
It's super easy to get this implemented. Swap this line with this code Need ofc. fix the non failing. See Kataw on how I solved that |
v4.2.0 is released with this feature. |
I found #29 but it looks like that issue may have been closed without implementation.
Top-level await is now stage 3, and supported in Node.js v14+.
The text was updated successfully, but these errors were encountered: