summaryrefslogtreecommitdiff
path: root/core/01_core.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-12-06 15:58:18 -0500
committerGitHub <noreply@github.com>2022-12-06 15:58:18 -0500
commit5dbc07935d47eaad48ba0a7b1a816c644f9446cd (patch)
tree536acb528422897983836be30c72157750c372b2 /core/01_core.js
parentc03e0f3853490e804fe30fc566b45150061badc9 (diff)
fix(test): handle scenario where --trace-ops would cause an unhandled promise rejection (#16970)
Closes #16969
Diffstat (limited to 'core/01_core.js')
-rw-r--r--core/01_core.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/01_core.js b/core/01_core.js
index 5df11c382..02150674e 100644
--- a/core/01_core.js
+++ b/core/01_core.js
@@ -187,8 +187,8 @@
// Rethrow the error
throw err;
}
- handleOpCallTracing("${name}", id, promise);
- promise[promiseIdSymbol] = id;
+ promise = handleOpCallTracing("${name}", id, promise);
+ promise[promiseIdSymbol] = id;
return promise;
}
`,
@@ -218,10 +218,12 @@
if (opCallTracingEnabled) {
const stack = StringPrototypeSlice(new Error().stack, 6);
MapPrototypeSet(opCallTraces, promiseId, { opName, stack });
- p = PromisePrototypeFinally(
+ return PromisePrototypeFinally(
p,
() => MapPrototypeDelete(opCallTraces, promiseId),
);
+ } else {
+ return p;
}
}