Converting the rejection reason to a log string may reject another
promise. Disable the tracker before reporting so new rejections
cannot leave references in the request context after its list has
been drained.
ngx_qjs_clear_events(ctx);
+ JS_SetHostPromiseRejectionTracker(JS_GetRuntime(cx), NULL, NULL);
+
if (ngx_qjs_unhandled_rejection(ctx)) {
ngx_qjs_log_exception(e, ctx->log, "unhandled rejection");
}
- JS_SetHostPromiseRejectionTracker(JS_GetRuntime(cx), NULL, NULL);
ngx_qjs_detach_ctx(ctx, cx);
if (JS_IsJobPending(JS_GetRuntime(cx))) {