OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 // Flags: --ignition |
| 6 |
| 7 InspectorTest.addScript(` |
| 8 function testFunction() |
| 9 { |
| 10 var o = 0; |
| 11 function f() { return 1; } |
| 12 function g() { o = 2; return o; } |
| 13 debugger; |
| 14 } |
| 15 //# sourceURL=foo.js`); |
| 16 |
| 17 Protocol.Debugger.enable(); |
| 18 |
| 19 Protocol.Debugger.oncePaused().then(debuggerPaused); |
| 20 |
| 21 Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0)" }); |
| 22 |
| 23 var topFrameId; |
| 24 |
| 25 function debuggerPaused(messageObject) |
| 26 { |
| 27 InspectorTest.log("Paused on 'debugger;'"); |
| 28 |
| 29 topFrameId = messageObject.params.callFrames[0].callFrameId; |
| 30 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
f()"}).then(evaluatedFirst); |
| 31 } |
| 32 |
| 33 function evaluatedFirst(response) |
| 34 { |
| 35 InspectorTest.log("f() returns " + response.result.result.value); |
| 36 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
g()"}).then(evaluatedSecond); |
| 37 } |
| 38 |
| 39 function evaluatedSecond(response) |
| 40 { |
| 41 InspectorTest.log("g() returns " + response.result.result.value); |
| 42 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
f()", throwOnSideEffect: true}).then(evaluatedThird); |
| 43 } |
| 44 |
| 45 function evaluatedThird(response) |
| 46 { |
| 47 InspectorTest.log("f() returns " + response.result.result.value); |
| 48 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
g()", throwOnSideEffect: true}).then(evaluatedFourth); |
| 49 InspectorTest.completeTest(); |
| 50 } |
| 51 |
| 52 function evaluatedFourth(response) |
| 53 { |
| 54 InspectorTest.log("g() throws " + response.result.result.className); |
| 55 InspectorTest.completeTest(); |
| 56 } |
OLD | NEW |