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')); |
+ } |
+]); |