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 44b65d0

Browse filesBrowse files
LiviaMedeirosdanielleadams
authored andcommitted
worker: use kEmptyObject
PR-URL: #43159 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 7fc432f commit 44b65d0
Copy full SHA for 44b65d0

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/worker.js‎

Copy file name to clipboardExpand all lines: lib/internal/worker.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const {
5555
} = workerIo;
5656
const { deserializeError } = require('internal/error_serdes');
5757
const { fileURLToPath, isURLInstance, pathToFileURL } = require('internal/url');
58+
const { kEmptyObject } = require('internal/util');
5859
const { validateArray } = require('internal/validators');
5960

6061
const {
@@ -118,7 +119,7 @@ function assignEnvironmentData(data) {
118119
}
119120

120121
class Worker extends EventEmitter {
121-
constructor(filename, options = {}) {
122+
constructor(filename, options = kEmptyObject) {
122123
super();
123124
debug(`[${threadId}] create new worker`, filename, options);
124125
if (options.execArgv)
Collapse file

‎lib/internal/worker/io.js‎

Copy file name to clipboardExpand all lines: lib/internal/worker/io.js
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const {
1818
SymbolFor,
1919
} = primordials;
2020

21-
const { kEnumerableProperty } = require('internal/util');
21+
const {
22+
kEmptyObject,
23+
kEnumerableProperty,
24+
} = require('internal/util');
2225

2326
const {
2427
handle_onclose: handleOnCloseSymbol,
@@ -123,7 +126,7 @@ class MessageEvent extends Event {
123126
lastEventId = '',
124127
source = null,
125128
ports = [],
126-
} = {}) {
129+
} = kEmptyObject) {
127130
super(type);
128131
this[kData] = data;
129132
this[kOrigin] = `${origin}`;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.