Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: test/inspector/debugger/return-break-locations.js

Issue 2758483002: [debugger] tuned StepNext and StepOut at return position (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/inspector/debugger/return-break-locations.js
diff --git a/test/inspector/debugger/return-break-locations.js b/test/inspector/debugger/return-break-locations.js
new file mode 100644
index 0000000000000000000000000000000000000000..73e0416b0d592131f0dca3145b6d8a8d3efa37ef
--- /dev/null
+++ b/test/inspector/debugger/return-break-locations.js
@@ -0,0 +1,26 @@
+// 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.
+
+InspectorTest.log('Return break locations within function');
+
+InspectorTest.addScript(`
+function fib(x) {
+ if (x < 0) return;
+ if (x === 0) return 1;
+ if (x === 1) return fib(0);
+ return x > 2 ? fib(x - 1) + fib(x - 2) : fib(1) + fib(0);
+}
+`);
+
+InspectorTest.runAsyncTestSuite([
+ async function testTailCall() {
+ var scriptPromise = Protocol.Debugger.onceScriptParsed();
+ Protocol.Debugger.enable();
+ var scriptId = (await scriptPromise).params.scriptId;
+ var locations = (await Protocol.Debugger.getPossibleBreakpoints({
+ start: { lineNumber: 0, columnNumber: 0, scriptId }
+ })).result.locations;
+ InspectorTest.logMessage(locations.filter(location => location.type === 'return'));
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698