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 InspectorTest.log('Async caught exception prediction and blackboxing.'); |
| 6 |
| 7 InspectorTest.addScript(` |
| 8 function constructorThrow() { |
| 9 return new Promise((resolve, reject) => |
| 10 Promise.resolve().then(() => |
| 11 reject("f") // Exception f |
| 12 ) |
| 13 ); |
| 14 } |
| 15 |
| 16 function dotCatch(producer) { |
| 17 Promise.resolve(producer()).catch(() => {}); |
| 18 } |
| 19 //# sourceURL=framework.js`); |
| 20 |
| 21 InspectorTest.setupScriptMap(); |
| 22 (async function test() { |
| 23 Protocol.Debugger.enable(); |
| 24 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
| 25 Protocol.Debugger.setPauseOnExceptions({state: 'all'}); |
| 26 Protocol.Runtime.evaluate({expression: 'dotCatch(constructorThrow);'}); |
| 27 // Should break at this debugger statement, not at reject. |
| 28 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'}); |
| 29 await waitPauseAndDumpLocation(); |
| 30 InspectorTest.completeTest(); |
| 31 })(); |
| 32 |
| 33 async function waitPauseAndDumpLocation() { |
| 34 var message = await Protocol.Debugger.oncePaused(); |
| 35 InspectorTest.log('paused at:'); |
| 36 InspectorTest.logSourceLocation(message.params.callFrames[0].location); |
| 37 return message; |
| 38 } |
OLD | NEW |