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

Method callMethod

lib/internal/debugger/inspect_client.js:251–266  ·  view source on GitHub ↗
(method, params)

Source from the content-addressed store, hash-verified

249 }
250
251 callMethod(method, params) {
252 return new Promise((resolve, reject) => {
253 if (!this._socket) {
254 reject(new ERR_DEBUGGER_ERROR('Use `run` to start the app again.'));
255 return;
256 }
257 const data = { id: ++this._lastId, method, params };
258 this._pending[data.id] = (error, result) => {
259 if (error) reject(unpackError(error));
260 else resolve(ObjectKeys(result).length ? result : undefined);
261 };
262 const json = JSONStringify(data);
263 debuglog('> %s', json);
264 this._socket.write(encodeFrameHybi17(Buffer.from(json)));
265 });
266 }
267
268 _fetchJSON(urlPath) {
269 return new Promise((resolve, reject) => {

Callers 3

callCdpMethod · 0.80
getFunction · 0.80
createReplFunction · 0.80

Calls 7

unpackErrorFunction · 0.85
encodeFrameHybi17Function · 0.85
rejectFunction · 0.50
resolveFunction · 0.50
debuglogFunction · 0.50
writeMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected