()
| 34 | } |
| 35 | |
| 36 | function enable() { |
| 37 | if (hook === undefined) lazyHookCreation(); |
| 38 | if (config.bits < 64) { |
| 39 | // V8 Inspector stores task ids as (void*) pointers. |
| 40 | // async_hooks store ids as 64bit numbers. |
| 41 | // As a result, we cannot reliably translate async_hook ids to V8 async_task |
| 42 | // ids on 32bit platforms. |
| 43 | process.emitWarning( |
| 44 | 'Warning: Async stack traces in debugger are not available ' + |
| 45 | `on ${config.bits}bit platforms. The feature is disabled.`, |
| 46 | { |
| 47 | code: 'INSPECTOR_ASYNC_STACK_TRACES_NOT_AVAILABLE', |
| 48 | }); |
| 49 | } else { |
| 50 | hook.enable(); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | function disable() { |
| 55 | if (hook === undefined) lazyHookCreation(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…