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

Function evaluate

deps/v8/test/inspector/debugger/breakpoints.js:100–117  ·  view source on GitHub ↗
(expression, expectedBreakpoint)

Source from the content-addressed store, hash-verified

98]);
99
100async function evaluate(expression, expectedBreakpoint) {
101 InspectorTest.log('evaluating ' + expression + ':');
102 let paused = Protocol.Debugger.oncePaused();
103 let evaluate = Protocol.Runtime.evaluate({expression});
104 let result = await Promise.race([paused, evaluate]);
105 if (result.method === 'Debugger.paused') {
106 if (result.params.hitBreakpoints) {
107 if (result.params.hitBreakpoints.find(b => b === expectedBreakpoint)) {
108 InspectorTest.log(' hit expected breakpoint')
109 } else {
110 InspectorTest.log(' hit unexpected breakpoint');
111 }
112 }
113 await Protocol.Debugger.resume();
114 } else {
115 InspectorTest.log(' not paused');
116 }
117}

Calls 4

findMethod · 0.65
resumeMethod · 0.65
logMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected