| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 print('Checks that async chains for promises are correct.'); | 5 print('Checks that async chains for promises are correct.'); |
| 6 | 6 |
| 7 InspectorTest.addScript(` | 7 InspectorTest.addScript(` |
| 8 function foo1() { | 8 function foo1() { |
| 9 debugger; | 9 debugger; |
| 10 } | 10 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 return Promise.reject().catch(foo1); | 217 return Promise.reject().catch(foo1); |
| 218 } | 218 } |
| 219 | 219 |
| 220 //# sourceURL=test.js`, 7, 26); | 220 //# sourceURL=test.js`, 7, 26); |
| 221 | 221 |
| 222 InspectorTest.setupScriptMap(); | 222 InspectorTest.setupScriptMap(); |
| 223 Protocol.Debugger.onPaused(message => { | 223 Protocol.Debugger.onPaused(message => { |
| 224 InspectorTest.logCallFrames(message.params.callFrames); | 224 InspectorTest.logCallFrames(message.params.callFrames); |
| 225 var asyncStackTrace = message.params.asyncStackTrace; | 225 var asyncStackTrace = message.params.asyncStackTrace; |
| 226 while (asyncStackTrace) { | 226 while (asyncStackTrace) { |
| 227 InspectorTest.log(`-- ${asyncStackTrace.description} --`); | 227 if (asyncStackTrace.promiseCreationFrame) { |
| 228 var frame = asyncStackTrace.promiseCreationFrame; |
| 229 InspectorTest.log(`-- ${asyncStackTrace.description} (${frame.url |
| 230 }:${frame.lineNumber}:${frame.columnNumber})--`); |
| 231 } else { |
| 232 InspectorTest.log(`-- ${asyncStackTrace.description} --`); |
| 233 } |
| 228 InspectorTest.logCallFrames(asyncStackTrace.callFrames); | 234 InspectorTest.logCallFrames(asyncStackTrace.callFrames); |
| 229 asyncStackTrace = asyncStackTrace.parent; | 235 asyncStackTrace = asyncStackTrace.parent; |
| 230 } | 236 } |
| 231 InspectorTest.log(''); | 237 InspectorTest.log(''); |
| 232 Protocol.Debugger.resume(); | 238 Protocol.Debugger.resume(); |
| 233 }); | 239 }); |
| 234 | 240 |
| 235 Protocol.Debugger.enable(); | 241 Protocol.Debugger.enable(); |
| 236 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); | 242 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); |
| 237 var testList = [ | 243 var testList = [ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 256 Protocol.Runtime.evaluate({ expression: \`${name}() | 262 Protocol.Runtime.evaluate({ expression: \`${name}() |
| 257 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) | 263 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) |
| 258 .then(next); | 264 .then(next); |
| 259 }) | 265 }) |
| 260 `); | 266 `); |
| 261 })); | 267 })); |
| 262 | 268 |
| 263 function capitalize(string) { | 269 function capitalize(string) { |
| 264 return string.charAt(0).toUpperCase() + string.slice(1); | 270 return string.charAt(0).toUpperCase() + string.slice(1); |
| 265 } | 271 } |
| OLD | NEW |