mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
worker: 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:
committed by
Antoine du Hamel
parent
51e7f751c7
commit
b1c1f86389
@@ -55,6 +55,7 @@ const {
|
||||
} = workerIo;
|
||||
const { deserializeError } = require('internal/error_serdes');
|
||||
const { fileURLToPath, isURLInstance, pathToFileURL } = require('internal/url');
|
||||
const { kEmptyObject } = require('internal/util');
|
||||
const { validateArray } = require('internal/validators');
|
||||
|
||||
const {
|
||||
@@ -118,7 +119,7 @@ function assignEnvironmentData(data) {
|
||||
}
|
||||
|
||||
class Worker extends EventEmitter {
|
||||
constructor(filename, options = {}) {
|
||||
constructor(filename, options = kEmptyObject) {
|
||||
super();
|
||||
debug(`[${threadId}] create new worker`, filename, options);
|
||||
if (options.execArgv)
|
||||
|
||||
@@ -18,7 +18,10 @@ const {
|
||||
SymbolFor,
|
||||
} = primordials;
|
||||
|
||||
const { kEnumerableProperty } = require('internal/util');
|
||||
const {
|
||||
kEmptyObject,
|
||||
kEnumerableProperty,
|
||||
} = require('internal/util');
|
||||
|
||||
const {
|
||||
handle_onclose: handleOnCloseSymbol,
|
||||
@@ -123,7 +126,7 @@ class MessageEvent extends Event {
|
||||
lastEventId = '',
|
||||
source = null,
|
||||
ports = [],
|
||||
} = {}) {
|
||||
} = kEmptyObject) {
|
||||
super(type);
|
||||
this[kData] = data;
|
||||
this[kOrigin] = `${origin}`;
|
||||
|
||||
Reference in New Issue
Block a user