OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 InspectorTest.evaluateInPage( |
| 6 `function bar() |
| 7 { |
| 8 return 42; |
| 9 }`); |
| 10 |
| 11 InspectorTest.evaluateInPage( |
| 12 `function foo() |
| 13 { |
| 14 var a = bar(); |
| 15 return a + 1; |
| 16 } |
| 17 //# sourceURL=foo.js`); |
| 18 |
| 19 InspectorTest.evaluateInPage( |
| 20 `function qwe() |
| 21 { |
| 22 var a = foo(); |
| 23 return a + 1; |
| 24 } |
| 25 //# sourceURL=qwe.js`); |
| 26 |
| 27 InspectorTest.evaluateInPage( |
| 28 `function baz() |
| 29 { |
| 30 var a = qwe(); |
| 31 return a + 1; |
| 32 } |
| 33 //# sourceURL=baz.js`); |
| 34 |
| 35 InspectorTest.sendCommand("Debugger.enable", {}); |
| 36 InspectorTest.sendCommand("Debugger.setBlackboxPatterns", { patterns: [ "foo(["
] }, dumpError); |
| 37 |
| 38 function dumpError(message) |
| 39 { |
| 40 InspectorTest.log(message.error.message); |
| 41 InspectorTest.eventHandler["Debugger.paused"] = dumpStackAndRunNextCommand; |
| 42 InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { patterns: [ "
baz\.js", "foo\.js" ] }); |
| 43 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "debugger;b
az()" }); |
| 44 } |
| 45 |
| 46 var commands = [ "stepInto", "stepInto", "stepInto", "stepOut", "stepInto", "ste
pInto" ]; |
| 47 function dumpStackAndRunNextCommand(message) |
| 48 { |
| 49 InspectorTest.log("Paused in"); |
| 50 var callFrames = message.params.callFrames; |
| 51 for (var callFrame of callFrames) |
| 52 InspectorTest.log((callFrame.functionName || "(...)") + ":" + (callFrame.loc
ation.lineNumber + 1)); |
| 53 var command = commands.shift(); |
| 54 if (!command) { |
| 55 InspectorTest.completeTest(); |
| 56 return; |
| 57 } |
| 58 InspectorTest.sendCommandOrDie("Debugger." + command, {}); |
| 59 } |
OLD | NEW |