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

Unified Diff: test/mjsunit/harmony/typesystem/type-query.js

Issue 1817353003: Add tests for variable declarations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types
Patch Set: Created 4 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/mjsunit/harmony/typesystem/type-query.js
diff --git a/test/mjsunit/harmony/typesystem/type-query.js b/test/mjsunit/harmony/typesystem/type-query.js
index c8627ee0cc118c331977cf6b752d3a90b097b821..d082e9d9ccac01355cdcbe85c511e45c2f6cd25a 100644
--- a/test/mjsunit/harmony/typesystem/type-query.js
+++ b/test/mjsunit/harmony/typesystem/type-query.js
@@ -4,32 +4,26 @@
// Flags: --harmony-types
-function CheckValid(type) {
- // print("V:", type);
- assertDoesNotThrow("'use types'; var x: " + type + ";");
-}
-function CheckInvalid(type) {
- // print("I:", type);
- assertThrows("'use types'; var x: " + type + ";", SyntaxError);
-}
+load("test/mjsunit/harmony/typesystem/testgen.js");
+
function valid(type) {
- CheckValid(type);
- CheckValid(type + "[]");
- CheckValid(type + " & any");
- CheckValid(type + " | any");
- CheckValid("(" + type + ")[]");
- CheckValid("(a: " + type + ") => any");
+ CheckValidType(type);
+ CheckValidType(type + "[]");
+ CheckValidType(type + " & any");
+ CheckValidType(type + " | any");
+ CheckValidType("(" + type + ")[]");
+ CheckValidType("(a: " + type + ") => any");
}
function invalid(type) {
- CheckInvalid(type);
- CheckInvalid(type + "[]");
- CheckInvalid(type + " & any");
- CheckInvalid(type + " | any");
- CheckInvalid("(" + type + ")[]");
- CheckInvalid("(a: " + type + ") => any");
+ CheckInvalidType(type);
+ CheckInvalidType(type + "[]");
+ CheckInvalidType(type + " & any");
+ CheckInvalidType(type + " | any");
+ CheckInvalidType("(" + type + ")[]");
+ CheckInvalidType("(a: " + type + ") => any");
}
(function TestTypeQueries() {
« no previous file with comments | « test/mjsunit/harmony/typesystem/type-parameters.js ('k') | test/mjsunit/harmony/typesystem/variable-declarations.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698