summaryrefslogtreecommitdiff
path: root/lib/timers.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/timers.js')
-rw-r--r--lib/timers.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/timers.js b/lib/timers.js
index 5727de159a..9d32aed7a5 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -26,17 +26,21 @@ const TimerWrap = process.binding('timer_wrap').Timer;
const L = require('internal/linkedlist');
const internalUtil = require('internal/util');
const { createPromise, promiseResolve } = process.binding('util');
-const async_hooks = require('async_hooks');
const assert = require('assert');
const util = require('util');
const errors = require('internal/errors');
const debug = util.debuglog('timer');
const kOnTimeout = TimerWrap.kOnTimeout | 0;
-const initTriggerId = async_hooks.initTriggerId;
// Two arrays that share state between C++ and JS.
const { async_hook_fields, async_id_fields } = async_wrap;
-// The needed emit*() functions.
-const { emitInit, emitBefore, emitAfter, emitDestroy } = async_hooks;
+const {
+ initTriggerId,
+ // The needed emit*() functions.
+ emitInit,
+ emitBefore,
+ emitAfter,
+ emitDestroy
+} = require('async_hooks');
// Grab the constants necessary for working with internal arrays.
const { kInit, kDestroy, kAsyncIdCounter } = async_wrap.constants;
// Symbols for storing async id state.