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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 InspectorTest.log(`-- ${asyncStackTrace.description} --`); |
228 InspectorTest.logCallFrames(asyncStackTrace.callFrames); | 228 InspectorTest.logCallFrames(asyncStackTrace.callFrames); |
| 229 if (asyncStackTrace.creationFrame) { |
| 230 InspectorTest.log('--- created in ---'); |
| 231 InspectorTest.logCallFrames([asyncStackTrace.creationFrame]); |
| 232 } |
229 asyncStackTrace = asyncStackTrace.parent; | 233 asyncStackTrace = asyncStackTrace.parent; |
230 } | 234 } |
231 InspectorTest.log(''); | 235 InspectorTest.log(''); |
232 Protocol.Debugger.resume(); | 236 Protocol.Debugger.resume(); |
233 }); | 237 }); |
234 | 238 |
235 Protocol.Debugger.enable(); | 239 Protocol.Debugger.enable(); |
236 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); | 240 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); |
237 var testList = [ | 241 var testList = [ |
238 'promise', | 242 'promise', |
(...skipping 17 matching lines...) Expand all Loading... |
256 Protocol.Runtime.evaluate({ expression: \`${name}() | 260 Protocol.Runtime.evaluate({ expression: \`${name}() |
257 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) | 261 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) |
258 .then(next); | 262 .then(next); |
259 }) | 263 }) |
260 `); | 264 `); |
261 })); | 265 })); |
262 | 266 |
263 function capitalize(string) { | 267 function capitalize(string) { |
264 return string.charAt(0).toUpperCase() + string.slice(1); | 268 return string.charAt(0).toUpperCase() + string.slice(1); |
265 } | 269 } |
OLD | NEW |