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

Method post

lib/inspector.js:115–140  ·  view source on GitHub ↗

* Posts a message to the inspector back-end. * @param {string} method * @param {Record } [params] * @param {Function} [callback] * @returns {void}

(method, params, callback)

Source from the content-addressed store, hash-verified

113 * @returns {void}
114 */
115 post(method, params, callback) {
116 validateString(method, 'method');
117 if (!callback && typeof params === 'function') {
118 callback = params;
119 params = null;
120 }
121 if (params) {
122 validateObject(params, 'params');
123 }
124 if (callback) {
125 validateFunction(callback, 'callback');
126 }
127
128 if (!this.#connection) {
129 throw new ERR_INSPECTOR_NOT_CONNECTED();
130 }
131 const id = this.#nextId++;
132 const message = { id, method };
133 if (params) {
134 message.params = params;
135 }
136 if (callback) {
137 this.#messageCallbacks.set(id, callback);
138 }
139 this.#connection.dispatch(JSONStringify(message));
140 }
141
142 /**
143 * Immediately closes the session, all pending

Callers 15

testFunction · 0.95
testConsoleLogFunction · 0.95
testFunction · 0.95
testFunction · 0.95
testFunction · 0.95
testSampleDebugSessionFunction · 0.95
callInspectorResumeFunction · 0.95
enableCPUProfilerFunction · 0.95
createContextMethod · 0.45

Calls 2

dispatchMethod · 0.65
setMethod · 0.45

Tested by 4

testFunction · 0.76
testFunction · 0.76
testFunction · 0.76
testFunction · 0.76