]> git.kaiwu.me - njs.git/commit
Modules: fix top-level await handling in QuickJS
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 30 Oct 2026 01:46:09 +0000 (18:46 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 2 Nov 2026 14:42:35 +0000 (06:42 -0800)
commit9d99e848a403f7c6f2657e67572d41e1f109a28f
tree3bc390017e4c4f98c37d48bb4b6a77b62984fa1d
parent8aeef5101a90c0b89851eaf5d646403d499993c5
Modules: fix top-level await handling in QuickJS

Previously, the result of module evaluation was awaited, but the
outcome was not checked:

  - a rejected top-level await was silently ignored;
  - a top-level await on a promise settled only by a timer or another
    asynchronous event remained pending.

In both cases the module was considered loaded without its exports
and each request failed later with a misleading "js function not
found" error.

Now, both cases fail the context creation with an explicit error.

The issue was introduced in 9a5430e6 (0.9.5).
nginx/ngx_js.c