| 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 // Embed a user function in the snapshot and step through it. | |
| 6 | |
| 7 // Flags: --embed 'function c(f, ...args) { return f(...args); }' | |
| 8 | |
| 9 InspectorTest.setupScriptMap(); | |
| 10 | |
| 11 InspectorTest.addScript(` | |
| 12 function test() { | |
| 13 function f(x) { | |
| 14 return x * 2; | |
| 15 } | |
| 16 debugger; | |
| 17 c(f, 2); | |
| 18 } | |
| 19 //# sourceURL=test.js`); | |
| 20 | |
| 21 Protocol.Debugger.onPaused(message => { | |
| 22 InspectorTest.log("paused"); | |
| 23 var frames = message.params.callFrames; | |
| 24 InspectorTest.logSourceLocation(frames[0].location); | |
| 25 Protocol.Debugger.stepInto(); | |
| 26 }) | |
| 27 | |
| 28 Protocol.Debugger.enable() | |
| 29 .then(() => Protocol.Runtime.evaluate({ expression: 'test()' })) | |
| 30 .then(InspectorTest.completeTest); | |
| OLD | NEW |