(n)
| 6 | // This test verifies that the async ID stack can grow indefinitely. |
| 7 | |
| 8 | function recurse(n) { |
| 9 | const a = new async_hooks.AsyncResource('foobar'); |
| 10 | a.runInAsyncScope(common.mustCall(() => { |
| 11 | assert.strictEqual(a.asyncId(), async_hooks.executionAsyncId()); |
| 12 | assert.strictEqual(a.triggerAsyncId(), async_hooks.triggerAsyncId()); |
| 13 | if (n >= 0) |
| 14 | recurse(n - 1); |
| 15 | assert.strictEqual(a.asyncId(), async_hooks.executionAsyncId()); |
| 16 | assert.strictEqual(a.triggerAsyncId(), async_hooks.triggerAsyncId()); |
| 17 | })); |
| 18 | } |
| 19 | |
| 20 | recurse(1000); |
no test coverage detected
searching dependent graphs…