summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/debugger/regress-crbug-481896.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/inspector/debugger/regress-crbug-481896.js')
-rw-r--r--deps/v8/test/inspector/debugger/regress-crbug-481896.js57
1 files changed, 57 insertions, 0 deletions
diff --git a/deps/v8/test/inspector/debugger/regress-crbug-481896.js b/deps/v8/test/inspector/debugger/regress-crbug-481896.js
new file mode 100644
index 0000000000..f301254dc2
--- /dev/null
+++ b/deps/v8/test/inspector/debugger/regress-crbug-481896.js
@@ -0,0 +1,57 @@
+// Copyright 2018 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('Set breakpoint before function call.');
+
+contextGroup.addScript(`
+function static() {
+ console.log("> static"); // Break
+}
+
+function install() {
+ eval("this.dynamic = function dynamic() { \\n" +
+ " console.log(\\"> dynamic\\"); // Break\\n" +
+ "}\\n" +
+ "//# sourceURL=dynamicScript");
+}
+
+install();
+//# sourceURL=staticScript`);
+
+(async function test() {
+ session.setupScriptMap();
+ Protocol.Debugger.enable();
+ await session.logSourceLocation((await Protocol.Debugger.setBreakpointByUrl({
+ url: 'dynamicScript',
+ lineNumber: 1
+ })).result.locations[0]);
+ await session.logSourceLocation((await Protocol.Debugger.setBreakpointByUrl({
+ url: 'staticScript',
+ lineNumber: 2
+ })).result.locations[0]);
+
+ Protocol.Runtime.evaluate({ expression: 'dynamic(); static();' });
+ {
+ const {
+ params:{
+ callFrames:[{location}]
+ }
+ } = await Protocol.Debugger.oncePaused();
+ InspectorTest.log('Paused at:');
+ await session.logSourceLocation(location);
+ }
+ {
+ InspectorTest.log('Resume..');
+ Protocol.Debugger.resume();
+ const {
+ params:{
+ callFrames:[{location}]
+ }
+ } = await Protocol.Debugger.oncePaused();
+ InspectorTest.log('Paused at:');
+ await session.logSourceLocation(location);
+ }
+ InspectorTest.completeTest();
+})();