summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-08-10 05:30:25 +0200
committerGitHub <noreply@github.com>2023-08-10 09:00:25 +0530
commit2507d6fa102488ed77b41a5893b311830f6fe9c9 (patch)
treea4546df8940b45366b4e94f0145e34fa587b8f77
parent04a259e2c8b3fdca8371f35e923bc239e8bb9ec0 (diff)
fix(node/async_hooks): don't pop async context frame if stack if empty (#20077)
Closes https://github.com/denoland/deno/issues/20076
-rw-r--r--ext/node/polyfills/async_hooks.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/polyfills/async_hooks.ts b/ext/node/polyfills/async_hooks.ts
index c97e81ef5..d0fc6a65e 100644
--- a/ext/node/polyfills/async_hooks.ts
+++ b/ext/node/polyfills/async_hooks.ts
@@ -22,8 +22,9 @@ function pushAsyncFrame(frame: AsyncContextFrame) {
}
function popAsyncFrame() {
- assert(asyncContextStack.length > 0);
- asyncContextStack.pop();
+ if (asyncContextStack.length > 0) {
+ asyncContextStack.pop();
+ }
}
let rootAsyncFrame: AsyncContextFrame | undefined = undefined;