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

Method _asyncWaitForNotification

test/common/inspector-helper.js:235–251  ·  view source on GitHub ↗
(methodOrPredicate)

Source from the content-addressed store, hash-verified

233 }
234
235 async _asyncWaitForNotification(methodOrPredicate) {
236 function matchMethod(notification) {
237 return notification.method === methodOrPredicate;
238 }
239 const predicate =
240 typeof methodOrPredicate === 'string' ? matchMethod : methodOrPredicate;
241 let notification = null;
242 do {
243 if (this._unprocessedNotifications.length) {
244 notification = this._unprocessedNotifications.shift();
245 } else {
246 notification = await new Promise(
247 (resolve) => this._notificationCallback = resolve);
248 }
249 } while (!predicate(notification));
250 return notification;
251 }
252
253 _isBreakOnLineNotification(message, line, expectedScriptPath) {
254 if (message.method === 'Debugger.paused') {

Callers 1

waitForNotificationMethod · 0.95

Calls 2

predicateFunction · 0.50
shiftMethod · 0.45

Tested by

no test coverage detected