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

Unified Diff: tests/language/on_catch_malformed_type_test.dart

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 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
« no previous file with comments | « tests/language/new_expression_type_args_test.dart ('k') | tests/language/prefix16_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/on_catch_malformed_type_test.dart
diff --git a/tests/language/on_catch_malformed_type_test.dart b/tests/language/on_catch_malformed_type_test.dart
index ae5e0432f08a5440ed89ff1ab85622cfedc3b611..a7e18ef190f2f3d99ea5a33493814cc63a34381e 100644
--- a/tests/language/on_catch_malformed_type_test.dart
+++ b/tests/language/on_catch_malformed_type_test.dart
@@ -2,29 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Check that malformed types in on-catch are handled correctly, that is
-// catches all in production mode and throws a type error in checked mode.
-
-isCheckedMode() {
- try {
- String s = 1;
- return false;
- } on TypeError catch(e) {
- return true;
- }
-}
-
-checkTypeError(f()) {
- if(isCheckedMode()) {
- try {
- f();
- Expect.fail("Type error expected in checking mode");
- } on TypeError catch(ok) {
- }
- } else {
- f();
- }
-}
+// Check that malformed types in on-catch are handled correctly, that is,
+// are treated as dynamic and thus catches all in bith production and checked
+// mode.
catchUnresolvedBefore() {
try {
@@ -43,8 +23,7 @@ catchUnresolvedAfter() {
Expect.fail("This code shouldn't be executed");
} on Unavailable catch(ex) {
// This is tested before the catch block below.
- // In production mode the test is always true, in checked mode
- // it throws a type error.
+ // In both production and checked mode the test is always true.
} on String catch(oks) {
Expect.fail("This code shouldn't be executed");
}
@@ -52,5 +31,5 @@ catchUnresolvedAfter() {
main() {
catchUnresolvedBefore();
- checkTypeError(catchUnresolvedAfter);
+ catchUnresolvedAfter();
}
« no previous file with comments | « tests/language/new_expression_type_args_test.dart ('k') | tests/language/prefix16_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698