mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 10:27:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/42657 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
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.
|
|
|
|
let {session, contextGroup, Protocol} = InspectorTest.start('Debugger breaks in next script after stepOut from previous one.');
|
|
|
|
contextGroup.addInlineScript(
|
|
`
|
|
function test() {
|
|
setTimeout('var a = 1;//# sourceURL=timeout1.js', 0);
|
|
setTimeout(foo, 0);
|
|
setTimeout('var a = 3;//# sourceURL=timeout3.js', 0);
|
|
debugger;
|
|
}`,
|
|
'foo.js');
|
|
|
|
contextGroup.addInlineScript(
|
|
`
|
|
function foo() {
|
|
return 42;
|
|
}`,
|
|
'timeout2.js');
|
|
|
|
session.setupScriptMap();
|
|
var stepAction;
|
|
Protocol.Debugger.onPaused(message => {
|
|
session.logCallFrames(message.params.callFrames);
|
|
InspectorTest.log('');
|
|
Protocol.Debugger[stepAction]();
|
|
});
|
|
Protocol.Debugger.enable()
|
|
InspectorTest.runTestSuite([
|
|
function testStepOut(next) {
|
|
stepAction = 'stepOut';
|
|
Protocol.Runtime.evaluate({ expression: 'test()' })
|
|
.then(() => InspectorTest.waitForPendingTasks())
|
|
.then(next);
|
|
},
|
|
|
|
function testStepOver(next) {
|
|
stepAction = 'stepOver';
|
|
Protocol.Runtime.evaluate({ expression: 'test()' })
|
|
.then(() => InspectorTest.waitForPendingTasks())
|
|
.then(next);
|
|
},
|
|
|
|
function testStepInto(next) {
|
|
stepAction = 'stepInto';
|
|
Protocol.Runtime.evaluate({ expression: 'test()' })
|
|
.then(() => InspectorTest.waitForPendingTasks())
|
|
.then(next);
|
|
}
|
|
]);
|