diff options
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 { |