]> git.kaiwu.me - njs.git/commit
Promise: do not track handled rejections with no list
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 28 Sep 2026 22:10:03 +0000 (15:10 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 29 Sep 2026 18:57:53 +0000 (11:57 -0700)
commit543995a05b6a7c4dbca873c592738f4eb44b1699
treeb11ab81f92559689fe88fe57d3d793c947785cf1
parent7922554d7099ac98374151674f9f5ffd0116a29f
Promise: do not track handled rejections with no list

Previously, when a handled promise was reported and the rejected promise
list was NULL, the trackers fell through and added it as unhandled.  In
the interactive shell, handling a promise after its rejection had been
reported caused another, false unhandled rejection.  The QuickJS nginx
module could do the same while formatting a rejection reason.

The fix is to return for every handled notification, removing the promise
from the list only when the list exists.  Apply this to both engines in the
shell and nginx module.
external/njs_shell.c
nginx/ngx_js.c
test/shell_test.exp