diff --git a/lib/async_hooks.js b/lib/async_hooks.js index fed0f07e647dcf..8638bb4d7b3497 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -20,6 +20,7 @@ const { ERR_ASYNC_TYPE, ERR_INVALID_ASYNC_ID } = require('internal/errors').codes; +const { kEmptyObject } = require('internal/util'); const { validateFunction, validateString, @@ -156,7 +157,7 @@ function createHook(fns) { const destroyedSymbol = Symbol('destroyed'); class AsyncResource { - constructor(type, opts = {}) { + constructor(type, opts = kEmptyObject) { validateString(type, 'type'); let triggerAsyncId = opts;