| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9ed424f commit 5aed83c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -499,11 +499,11 @@ function hasAsyncIdStack() { | |||
| 499 | 499 | // This is the equivalent of the native push_async_ids() call. | |
| 500 | 500 | function pushAsyncContext(asyncId, triggerAsyncId, resource) { | |
| 501 | 501 | const offset = async_hook_fields[kStackLength]; | |
| 502 | + execution_async_resources[offset] = resource; | ||
| 502 | 503 | if (offset * 2 >= async_wrap.async_ids_stack.length) | |
| 503 | 504 | return pushAsyncContext_(asyncId, triggerAsyncId); | |
| 504 | 505 | async_wrap.async_ids_stack[offset * 2] = async_id_fields[kExecutionAsyncId]; | |
| 505 | 506 | async_wrap.async_ids_stack[offset * 2 + 1] = async_id_fields[kTriggerAsyncId]; | |
| 506 | - execution_async_resources[offset] = resource; | ||
| 507 | 507 | async_hook_fields[kStackLength]++; | |
| 508 | 508 | async_id_fields[kExecutionAsyncId] = asyncId; | |
| 509 | 509 | async_id_fields[kTriggerAsyncId] = triggerAsyncId; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const { AsyncLocalStorage } = require('async_hooks'); | ||
| 4 | + | ||
| 5 | + // Regression test for: https://github.com/nodejs/node/issues/34556 | ||
| 6 | + | ||
| 7 | + const als = new AsyncLocalStorage(); | ||
| 8 | + | ||
| 9 | + const done = common.mustCall(); | ||
| 10 | + | ||
| 11 | + function run(count) { | ||
| 12 | + if (count !== 0) return als.run({}, run, --count); | ||
| 13 | + done(); | ||
| 14 | + } | ||
| 15 | + run(1000); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments