diff options
-rw-r--r-- | lib/internal/worker.js | 3 | ||||
-rw-r--r-- | lib/internal/worker/io.js | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/internal/worker.js b/lib/internal/worker.js index 1d2cd8cefd2..0cede10ca4b 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -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) diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index 97d7d1d408e..9e2bbbdb33f 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -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}`; |