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

Method connectToMainThread

lib/inspector.js:74–82  ·  view source on GitHub ↗

* Connects the session to the main thread * inspector back-end. * @returns {void}

()

Source from the content-addressed store, hash-verified

72 * @returns {void}
73 */
74 connectToMainThread() {
75 if (isMainThread)
76 throw new ERR_INSPECTOR_NOT_WORKER();
77 if (this.#connection)
78 throw new ERR_INSPECTOR_ALREADY_CONNECTED('The inspector session');
79 this.#connection =
80 new MainThreadConnection(
81 (message) => queueMicrotask(() => this.#onMessage(message)));
82 }
83
84 #onMessage(message) {
85 const parsed = JSONParse(message);

Callers 5

mainFunction · 0.95
childMainFunction · 0.95
skipChildMainFunction · 0.95
worker-name.jsFile · 0.80

Calls 2

#onMessageMethod · 0.95
queueMicrotaskFunction · 0.85

Tested by

no test coverage detected