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 throws SyntaxError #124

Open
teidesu opened this issue Feb 12, 2024 · 3 comments
Open

top-level await throws SyntaxError #124

teidesu opened this issue Feb 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@teidesu
Copy link

teidesu commented Feb 12, 2024

basically the subject

// llrt-test.mjs
function foo() {
  return Promise.resolve(42)
}

console.log(await foo())
$ ./llrt llrt-test.mjs
SyntaxError: unexpected 'await' keyword
    at llrt-test.mjs:5:12
@richarddavison
Copy link
Contributor

Thanks for reporting. Top-Level await is not yet supported. It's recently been added to QuickJS so will eventually be supported by LLRT.

@nabetti1720
Copy link
Contributor

nabetti1720 commented May 2, 2024

Hi, @richarddavison ,
It seems that rquickjs, which was just released last week, links quickjs with top-level await support.
For your information, the latest version is v0.6.1 at this time.

@richarddavison
Copy link
Contributor

Hi @nabetti1720 . Thanks for the info, I’m aware and already been working on a PR. This will also introduce ES2023 language support. The blocker I have now is synonymously wait for imports without blocking the async runtime. I have created a PR in rquickjs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants