diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-17 13:53:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-17 18:53:57 +0100 |
commit | 0bc6bf5d33b8198253954d7f04558270de45c925 (patch) | |
tree | 6b2f689c88da34677d25e77f0554b1fc36719410 /ext/node/polyfills/async_hooks.ts | |
parent | e6fe1630f0e6cbc16ccfda5a58cbe8ecdfea2694 (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.ts | 6 |
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 { |