summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/async_hooks.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-17 13:53:57 -0400
committerGitHub <noreply@github.com>2023-03-17 18:53:57 +0100
commit0bc6bf5d33b8198253954d7f04558270de45c925 (patch)
tree6b2f689c88da34677d25e77f0554b1fc36719410 /ext/node/polyfills/async_hooks.ts
parente6fe1630f0e6cbc16ccfda5a58cbe8ecdfea2694 (diff)
chore: add tests for node:async_hooks (#18004)
Closes https://github.com/denoland/deno/issues/17878 --------- Co-authored-by: crowlkats <crowlkats@toaxl.com>
Diffstat (limited to 'ext/node/polyfills/async_hooks.ts')
-rw-r--r--ext/node/polyfills/async_hooks.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/node/polyfills/async_hooks.ts b/ext/node/polyfills/async_hooks.ts
index 899e578cc..8111af73b 100644
--- a/ext/node/polyfills/async_hooks.ts
+++ b/ext/node/polyfills/async_hooks.ts
@@ -84,7 +84,7 @@ class AsyncContextFrame {
const propagate = (parent: AsyncContextFrame) => {
parent.storage = parent.storage.filter((entry) => !entry.key.isDead());
- parent.storage.forEach((entry) => this.storage.push(entry));
+ parent.storage.forEach((entry) => this.storage.push(entry.clone()));
if (maybeStorageEntry) {
const existingEntry = this.storage.find((entry) =>
@@ -250,6 +250,10 @@ class StorageEntry {
this.key = key;
this.value = value;
}
+
+ clone() {
+ return new StorageEntry(this.key, this.value);
+ }
}
class StorageKey {