(fn, type)
| 60 | const nop = () => {}; |
| 61 | |
| 62 | function bindAsyncResource(fn, type) { |
| 63 | AsyncResource ??= require('async_hooks').AsyncResource; |
| 64 | const resource = new AsyncResource(type); |
| 65 | return function(...args) { |
| 66 | return resource.runInAsyncScope(fn, this, ...args); |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Returns the current stream error tracked by eos(), if any. |
no test coverage detected