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

Method _onMessage

test/common/inspector-helper.js:164–196  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

162 }
163
164 _onMessage(message) {
165 if (message.id) {
166 const { resolve, reject } = this._commandResponsePromises.get(message.id);
167 this._commandResponsePromises.delete(message.id);
168 if (message.result)
169 resolve(message.result);
170 else
171 reject(message.error);
172 } else {
173 if (message.method === 'Debugger.scriptParsed') {
174 const { scriptId, url } = message.params;
175 this._scriptsIdsByUrl.set(scriptId, url);
176 const fileUrl = url.startsWith('file:') ?
177 url : pathToFileURL(url).toString();
178 if (fileUrl === this.scriptURL().toString()) {
179 this.mainScriptId = scriptId;
180 }
181 }
182 if (message.method === 'Debugger.paused')
183 this._pausedDetails = message.params;
184 if (message.method === 'Debugger.resumed')
185 this._pausedDetails = null;
186
187 if (this._notificationCallback) {
188 // In case callback needs to install another
189 const callback = this._notificationCallback;
190 this._notificationCallback = null;
191 callback(message);
192 } else {
193 this._unprocessedNotifications.push(message);
194 }
195 }
196 }
197
198 unprocessedNotifications() {
199 return this._unprocessedNotifications;

Callers 1

constructorMethod · 0.95

Calls 10

scriptURLMethod · 0.95
resolveFunction · 0.70
getMethod · 0.65
deleteMethod · 0.65
rejectFunction · 0.50
pathToFileURLFunction · 0.50
callbackFunction · 0.50
setMethod · 0.45
toStringMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected