Skip to content

Commit dbd039f

Browse files
committed
Remove debugging code
1 parent 84160b5 commit dbd039f

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

lib/internal/modules/esm/hooks.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -498,33 +498,21 @@ class HooksProxy {
498498
}
499499

500500
TypedArrayPrototypeFill(this.#data, undefined); // Erase handled request/response data
501-
// console.log('sending request', method, args)
502501
const request = serialize({ method, args });
503502
TypedArrayPrototypeSet(this.#data, request);
504503

505-
// this.#awaitResponse();
506-
507504
const chunks = [];
508505
let done = false;
509506
try {
510507
while (done === false) {
511508
this.#awaitResponse();
512509

513510
const chunk = deserialize(this.#data);
514-
console.log('chunk:', chunk)
515-
516511
if (chunk instanceof Error) { throw chunk; }
517-
518512
({ done } = chunk);
519513
chunks.push(chunk.value);
520-
521-
console.log('awaiting next')
522514
}
523515
} catch (exception) {
524-
console.log('\nmakeRequest failed!\n');
525-
console.log(this.#data);
526-
console.log('byteLength:', this.#data.byteLength);
527-
console.log('this.#data[0]:', this.#data[0]);
528516
if (this.#data[0] === 0) { // Response should not be empty
529517
throw new ERR_INVALID_RETURN_VALUE('an object', method, undefined);
530518
} else {
@@ -533,9 +521,6 @@ class HooksProxy {
533521
}
534522

535523
const response = Buffer.concat(chunks);
536-
537-
console.log('[HooksProxy]::makeRequest() finished:', deserialize(response));
538-
539524
return response;
540525
}
541526

lib/internal/modules/esm/worker.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ function releaseLock() {
4949
try {
5050
initializeESM();
5151
hooks = await initializeHooks();
52-
process._rawDebug('[WORKER]:', 'hooks:', hooks);
5352
} catch (exception) {
5453
// If there was an error while parsing and executing a user loader, for example if because a loader contained a syntax error,
5554
// then we need to send the error to the main thread so it can be thrown and printed.
@@ -65,7 +64,6 @@ process._rawDebug('[WORKER]:', 'hooks:', hooks);
6564
Atomics.wait(lock, 0, 1); // This pauses the while loop
6665

6766
const { method, args } = deserialize(data);
68-
process._rawDebug('[WORKER]:', 'request received:', method, args);
6967
TypedArrayPrototypeFill(data, undefined);
7068

7169
// Each potential exception needs to be caught individually so that the correct error is sent to the main thread
@@ -85,26 +83,19 @@ process._rawDebug('[WORKER]:', 'hooks:', hooks);
8583
}
8684

8785
try {
88-
process._rawDebug('[WORKER]:', 'response:', response);
8986
const serializedResponseValue = serialize(response);
9087
const chunkCount = Math.ceil(serializedResponseValue.byteLength / CHUNK_THRESHOLD);
91-
process._rawDebug('[WORKER]:', 'chunkCount:', chunkCount)
9288
for (let i = 0; i < chunkCount; i++) {
9389
const chunk = {
9490
__proto__: null,
9591
done: i === chunkCount - 1,
9692
value: serializedResponseValue.slice(i),
9793
};
98-
process._rawDebug('[WORKER]:', 'chunk:', chunk);
9994
const serializedChunk = serialize(chunk);
100-
process._rawDebug('[WORKER]:', 'serializedChunk:', serializedChunk);
10195
// Send the method response (or exception) to the main thread
102-
10396
TypedArrayPrototypeSet(data, serializedChunk);
104-
// process._rawDebug('[WORKER]:', 'chunk set; releasing lock');
10597
releaseLock();
10698
}
107-
10899
} catch (exception) {
109100
TypedArrayPrototypeSet(data, serialize(exception));
110101
releaseLock();

0 commit comments

Comments
 (0)