Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 702bfa0

Browse filesBrowse 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
Copy full SHA for 702bfa0

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎lib/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/async_hooks.js
+2-1Lines changed: 2 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.