Skip to content

Commit 3bd7375

Browse files
committed
code review suggestions addressed
1 parent 60c57d4 commit 3bd7375

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/internal/modules/esm/hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ class HooksProxy {
642642
* @returns {any}
643643
*/
644644
makeSyncRequest(method, transferList, ...args) {
645-
const fromHooksThread = this.#postMessageToWorker(method, 'Sync', transferList, ...args);
645+
const fromHooksThread = this.#postMessageToWorker(method, 'Sync', transferList, args);
646646

647647
let response;
648648
do {

lib/internal/modules/esm/worker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
ArrayPrototypePush,
45
AtomicsAdd,
56
AtomicsNotify,
67
DataViewPrototypeGetBuffer,
@@ -181,6 +182,12 @@ async function customizedModuleWorker(lock, syncCommPort, errorHandler) {
181182
});
182183

183184
const allThreadRegisteredHandlerPorts = [];
185+
/**
186+
* @callback registerHandler
187+
* @param {MessagePort} toWorkerThread - Upon Worker creation a message channel between the new Worker
188+
* and the Hooks thread is bein initialized. This is the message part that the Hooks thread will use post
189+
* messages to the worker. The other MessagePort is passed to the new Worker itself via LOAD_SCRIPT message
190+
*/
184191
function registerHandler(toWorkerThread) {
185192
toWorkerThread.on('message', handleMessage);
186193
ArrayPrototypePush(allThreadRegisteredHandlerPorts, toWorkerThread);

0 commit comments

Comments
 (0)