awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.77k stars 342 forks source link

top-level await throws SyntaxError #124

Open teidesu opened 4 months ago

teidesu commented 4 months ago

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 commented 4 months ago

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 commented 2 months ago

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 commented 2 months ago

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.

nabetti1720 commented 1 week ago

Hi @richarddavison , This has already been resolved, correct?