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 print("Check that inspector correctly passes caught/uncaught information."); |
| 6 |
| 7 InspectorTest.addScript( |
| 8 `function throwCaught() { try { throw new Error(); } catch (_) {} } |
| 9 function throwUncaught() { throw new Error(); } |
| 10 function schedule(f) { setTimeout(f, 0); } |
| 11 `); |
| 12 |
| 13 Protocol.Debugger.enable(); |
| 14 |
| 15 Protocol.Debugger.setPauseOnExceptions({ "state": "all" }); |
| 16 Protocol.Debugger.onPaused(message => { |
| 17 InspectorTest.log("paused in " + message.params.callFrames[0].functionName); |
| 18 InspectorTest.log("uncaught: " + message.params.data.uncaught); |
| 19 Protocol.Debugger.resume(); |
| 20 }); |
| 21 |
| 22 Protocol.Runtime.evaluate({ "expression": "schedule(throwCaught);" }) |
| 23 .then(() => Protocol.Runtime.evaluate( |
| 24 { "expression": "schedule(throwUncaught);" })) |
| 25 .then(() => InspectorTest.completeTest()); |
OLD | NEW |