Skip to content

Commit 702bfa0

Browse files
LiviaMedeirosdanielleadams
authored andcommitted
async_hooks: use kEmptyObject
PR-URL: #43159 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent b187d55 commit 702bfa0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/async_hooks.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const {
2020
ERR_ASYNC_TYPE,
2121
ERR_INVALID_ASYNC_ID
2222
} = require('internal/errors').codes;
23+
const { kEmptyObject } = require('internal/util');
2324
const {
2425
validateFunction,
2526
validateString,
@@ -156,7 +157,7 @@ function createHook(fns) {
156157
const destroyedSymbol = Symbol('destroyed');
157158

158159
class AsyncResource {
159-
constructor(type, opts = {}) {
160+
constructor(type, opts = kEmptyObject) {
160161
validateString(type, 'type');
161162

162163
let triggerAsyncId = opts;

0 commit comments

Comments
 (0)