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

Unified Diff: tests/language/function_type/function_type28_test.dart

Issue 2879153005: Add support to dart2js for option --enable-asserts. (Closed)
Patch Set: Added !$checked to section predicate in co19 status file Created 3 years, 5 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: tests/language/function_type/function_type28_test.dart
diff --git a/tests/language/function_type/function_type28_test.dart b/tests/language/function_type/function_type28_test.dart
index 971f2ef17ca3c7b5100ba1a32601050009053e45..65e2da37c0edd47bf7a0ddc13af2f7536eefc7b9 100644
--- a/tests/language/function_type/function_type28_test.dart
+++ b/tests/language/function_type/function_type28_test.dart
@@ -19,60 +19,30 @@ import 'package:expect/expect.dart';
@AssumeDynamic()
confuse(f) => f;
-final bool inCheckedMode = (() {
- bool result = false;
- assert(result = true);
- return result;
-})();
-
-typedef F0<T>
- = int Function(int x1, [List<Function> x2]);
-typedef F1<T>
- = List<Function> Function([Function x1]);
-typedef F2<T>
- = List<T> Function(int x0);
-typedef F3<T>
- = Function(List<T> x0);
-typedef F4<T>
- = List<T> Function<A>(List<T> x);
-typedef F5<T>
- = int Function([Function x1]) Function();
-typedef F6<T>
- = int Function({core.List<core.int> x}) Function();
-typedef F7<T>
- = Function Function(int y, {int x}) Function();
-typedef F8<T>
- = Function Function(int x0, [core.List<core.int> x]) Function();
-typedef F9<T>
- = List<Function> Function(int x0) Function();
-typedef F10<T>
- = List<Function> Function(int x, [List<Function> x2]) Function();
-typedef F11<T>
- = List<Function> Function(int y, {List<T> x}) Function();
-typedef F12<T>
- = core.List<core.int> Function([List<Function> x]) Function();
-typedef F13<T>
- = core.List<core.int> Function(List<T> x0) Function();
-typedef F14<T>
- = List<T> Function(int x1, [Function x2]) Function();
-typedef F15<T>
- = List<T> Function(int x0, {core.List<core.int> x}) Function();
-typedef F16<T>
- = Function(Function x) Function();
-typedef F17<T>
- = Function(int y, [core.List<core.int> x]) Function();
-typedef F18<T>
- = void Function([int x1]) Function();
-typedef F19<T>
- = void Function({List<Function> x}) Function();
-typedef F20<T>
- = void Function() Function();
-typedef F21<T>
- = core.List<core.int> Function<A>(int x) Function();
-typedef F22<T>
- = A Function<A>(Function x) Function();
-typedef F23<T>
- = List<T> Function(B x) Function<B extends core.int>();
+typedef F0<T> = int Function(int x1, [List<Function> x2]);
+typedef F1<T> = List<Function> Function([Function x1]);
+typedef F2<T> = List<T> Function(int x0);
+typedef F3<T> = Function(List<T> x0);
+typedef F4<T> = List<T> Function<A>(List<T> x);
+typedef F5<T> = int Function([Function x1]) Function();
+typedef F6<T> = int Function({core.List<core.int> x}) Function();
+typedef F7<T> = Function Function(int y, {int x}) Function();
+typedef F8<T> = Function Function(int x0, [core.List<core.int> x]) Function();
+typedef F9<T> = List<Function> Function(int x0) Function();
+typedef F10<T> = List<Function> Function(int x, [List<Function> x2]) Function();
+typedef F11<T> = List<Function> Function(int y, {List<T> x}) Function();
+typedef F12<T> = core.List<core.int> Function([List<Function> x]) Function();
+typedef F13<T> = core.List<core.int> Function(List<T> x0) Function();
+typedef F14<T> = List<T> Function(int x1, [Function x2]) Function();
+typedef F15<T> = List<T> Function(int x0, {core.List<core.int> x}) Function();
+typedef F16<T> = Function(Function x) Function();
+typedef F17<T> = Function(int y, [core.List<core.int> x]) Function();
+typedef F18<T> = void Function([int x1]) Function();
+typedef F19<T> = void Function({List<Function> x}) Function();
+typedef F20<T> = void Function() Function();
+typedef F21<T> = core.List<core.int> Function<A>(int x) Function();
+typedef F22<T> = A Function<A>(Function x) Function();
+typedef F23<T> = List<T> Function(B x) Function<B extends core.int>();
int f0(int x0, [List<Function> x1]) => null;
List<Function> f1([Function x0]) => null;
@@ -262,7 +232,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m2 is F2<bool>);
Expect.equals(tIsDynamic, confuse(m2) is F2<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x2 = (f2 as dynamic);
});
@@ -314,7 +284,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m3 is F3<bool>);
Expect.equals(tIsDynamic, confuse(m3) is F3<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x3 = (f3 as dynamic);
});
@@ -366,7 +336,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m4 is F4<bool>);
Expect.equals(tIsDynamic, confuse(m4) is F4<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x4 = (f4 as dynamic);
});
@@ -565,7 +535,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m11 is F11<bool>);
Expect.equals(tIsDynamic, confuse(m11) is F11<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
@@ -642,7 +612,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m13 is F13<bool>);
Expect.equals(tIsDynamic, confuse(m13) is F13<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x13 = (f13 as dynamic);
});
@@ -694,7 +664,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m14 is F14<bool>);
Expect.equals(tIsDynamic, confuse(m14) is F14<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
@@ -747,7 +717,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m15 is F15<bool>);
Expect.equals(tIsDynamic, confuse(m15) is F15<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
@@ -967,7 +937,7 @@ class U28<T> {
Expect.equals(tIsDynamic, m23 is F23<bool>);
Expect.equals(tIsDynamic, confuse(m23) is F23<bool>);
} else {
- if (inCheckedMode) {
+ if (typeAssertionsEnabled) {
Expect.throws(() {
x23 = (f23 as dynamic);
});
« no previous file with comments | « tests/language/function_type/function_type27_test.dart ('k') | tests/language/function_type/function_type29_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698