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:
LiviaMedeiros 2022-05-21 17:49:57 +08:00 committed by Antoine du Hamel
parent a9b1fd3987
commit dc2a5d79c2
No known key found for this signature in database
GPG key ID: 21D900FFDB233756

View file

@ -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;