Commit 5cd870b4 authored by franzih's avatar franzih Committed by Commit bot

[type-profile] Add test for return in try-finally.

Add a test case as reminder for future work.

The return statement is in a try
finally and is never used when returning. The type should
not be collected.

R=mstarzinger@chromium.org
BUG=v8:5935

Review-Url: https://codereview.chromium.org/2765863002
Cr-Commit-Position: refs/heads/master@{#44006}
parent e35ec4a7
......@@ -46,6 +46,21 @@ function testReturnOfNonVariable() {
return 32;
}
// Return statement is reached but its expression is never really returned.
// TODO(franzih): The only return type should be 'string'.
function try_finally() {
try {
return 23;
} finally {
return "nope, string is better"
}
}
try_finally();
%PrintTypeProfile(try_finally);
testReturnOfNonVariable();
throw "throw otherwise test fails with --stress-opt";
......@@ -14,6 +14,10 @@ Function: testFunction
374: Object
424: Object
*%(basename)s:51: throw otherwise test fails with --stress-opt
Function: try_finally
1157: number
1186: string
*%(basename)s:66: throw otherwise test fails with --stress-opt
throw "throw otherwise test fails with --stress-opt";
^
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment