Index: test/message/type-profile/collect-type-profile.js |
diff --git a/test/message/type-profile/collect-type-profile.js b/test/message/type-profile/collect-type-profile.js |
index 45572af20c3d3ee3988942804d572871b87069d1..e0d8442161960e83d0b671ac3967fff64d0d66d7 100644 |
--- a/test/message/type-profile/collect-type-profile.js |
+++ b/test/message/type-profile/collect-type-profile.js |
@@ -4,19 +4,21 @@ |
// Flags: --type-profile --turbo |
-function test(param) { |
- var my_var1 = param; |
- var my_var2 = 17; |
+function testFunction(param, flag) { |
+ // We want to test 2 different return positions in one function. |
+ if (flag) { |
+ var first_var = param; |
+ return first_var; |
+ } |
+ var second_var = param; |
+ return second_var; |
} |
-test({}); |
-test(123); |
-test('hello'); |
-test(123); |
-test(undefined); |
-test('hello'); |
-test({x: 12}); |
-test({x: 12}); |
+testFunction({}); |
+testFunction(123); |
+testFunction('hello', true); |
+testFunction(undefined); |
+testFunction({x: 12}, true); |
class MyClass { |
constructor() {} |
@@ -31,4 +33,10 @@ testConstructorNames(new MyClass()); |
testConstructorNames({}); |
testConstructorNames(2); |
+function testReturnOfNonVariable() { |
+ return 32; |
+} |
+ |
+testReturnOfNonVariable(); |
+ |
throw "throw otherwise test fails with --stress-opt"; |