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

Unified Diff: test/message/type-profile/collect-type-profile.js

Issue 2768503002: [type-profile] Add test for fall-off return. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « no previous file | test/message/type-profile/collect-type-profile.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 881b875e13590b8fa00bb8567de054478b109357..d6876743c6f3085e60c5224c6a3ffbf3637524ab 100644
--- a/test/message/type-profile/collect-type-profile.js
+++ b/test/message/type-profile/collect-type-profile.js
@@ -14,6 +14,10 @@ function testFunction(param, flag) {
return second_var;
}
+class MyClass {
+ constructor() {}
+}
+
%PrintTypeProfile(testFunction);
testFunction({});
@@ -26,22 +30,10 @@ testFunction(undefined);
testFunction('hello', true);
testFunction({x: 12}, true);
testFunction({x: 12});
+testFunction(new MyClass());
%PrintTypeProfile(testFunction);
-class MyClass {
- constructor() {}
-}
-
-
-function testConstructorNames(param) {
- var my_var = param;
-}
-
-testConstructorNames(new MyClass());
-testConstructorNames({});
-testConstructorNames(2);
-
function testReturnOfNonVariable() {
return 32;
}
@@ -55,11 +47,18 @@ function try_finally() {
return "nope, string is better"
}
}
-
try_finally();
-
%PrintTypeProfile(try_finally);
+// TODO(franzih): 'undefined' should be the return type.
+function fall_off() {
+ //nothing
+}
+fall_off();
+%PrintTypeProfile(fall_off);
+
+
+
testReturnOfNonVariable();
« no previous file with comments | « no previous file | test/message/type-profile/collect-type-profile.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698