mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
async_hooks: use kEmptyObject
PR-URL: https://github.com/nodejs/node/pull/43159 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
a9b1fd3987
commit
dc2a5d79c2
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue