v8/test/inspector/debugger/step-snapshot.js
yangguo aaaaa80f02 [inspector] always include user scripts in the snapshot.
V8 can bundle user scripts in the start up snapshot. These are
shared across contexts, and do not work well context groups.

R=kozyatinskiy@chromium.org
BUG=v8:6274

Review-Url: https://codereview.chromium.org/2836623002
Cr-Original-Commit-Position: refs/heads/master@{#44847}
Committed: 9685cfd310
Review-Url: https://codereview.chromium.org/2836623002
Cr-Commit-Position: refs/heads/master@{#44897}
2017-04-26 15:13:14 +00:00

31 lines
801 B
JavaScript

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Embed a user function in the snapshot and step through it.
// Flags: --embed 'function c(f, ...args) { return f(...args); }'
InspectorTest.setupScriptMap();
InspectorTest.addScript(`
function test() {
function f(x) {
return x * 2;
}
debugger;
c(f, 2);
}
//# sourceURL=test.js`);
Protocol.Debugger.onPaused(message => {
InspectorTest.log("paused");
var frames = message.params.callFrames;
InspectorTest.logSourceLocation(frames[0].location);
Protocol.Debugger.stepInto();
})
Protocol.Debugger.enable()
.then(() => Protocol.Runtime.evaluate({ expression: 'test()' }))
.then(InspectorTest.completeTest);