From 218bd62c33ea81a43174d42eb04d4cf220459da2 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sat, 21 May 2022 17:49:57 +0800 Subject: [PATCH] async_hooks: use `kEmptyObject` PR-URL: https://github.com/nodejs/node/pull/43159 Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel --- lib/async_hooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/async_hooks.js b/lib/async_hooks.js index 6cc2052474d..52ef6e9f92a 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;