MCPcopy Index your code
hub / github.com/nodejs/node / constructor

Method constructor

lib/internal/modules/esm/hooks.js:520–538  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518 #isReady = false;
519
520 constructor() {
521 const { InternalWorker } = require('internal/worker');
522 MessageChannel ??= require('internal/worker/io').MessageChannel;
523
524 const lock = constructSharedArrayBuffer(SHARED_MEMORY_BYTE_LENGTH);
525 this.#lock = new Int32Array(lock);
526
527 this.#worker = new InternalWorker('internal/modules/esm/worker', {
528 stderr: false,
529 stdin: false,
530 stdout: false,
531 trackUnmanagedFds: false,
532 workerData: {
533 lock,
534 },
535 });
536 this.#worker.unref(); // ! Allows the process to eventually exit.
537 this.#worker.on('exit', process.exit);
538 }
539
540 waitForWorker() {
541 if (!this.#isReady) {

Callers

nothing calls this directly

Calls 3

requireFunction · 0.50
unrefMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected