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

Unified Diff: tests/language/type_cast_vm_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 4 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/try_catch_syntax_test.dart ('k') | tests/language/type_checks_in_factory_method_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_cast_vm_test.dart
diff --git a/tests/language/type_cast_vm_test.dart b/tests/language/type_cast_vm_test.dart
index b6740998ba849f9d2a40f052f930adae4a4c9f3e..a54da72789307b93aa745721614cd2b9df704f3d 100644
--- a/tests/language/type_cast_vm_test.dart
+++ b/tests/language/type_cast_vm_test.dart
@@ -13,7 +13,7 @@ class TypeTest {
int result = 0;
try {
var i = "hello" as int; // Throws a CastException
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 1;
Expect.isTrue(error is CastException);
Expect.equals("int", error.dstType);
@@ -42,7 +42,7 @@ class TypeTest {
a[0] = 0;
a[index()]++; // Type check succeeds, but does not create side effects.
Expect.equals(1, a[0]);
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 100;
}
return result;
@@ -55,7 +55,7 @@ class TypeTest {
}
try {
int i = f("hello" as int); // Throws a CastException
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 1;
Expect.isTrue(error is CastException);
Expect.equals("int", error.dstType);
@@ -80,7 +80,7 @@ class TypeTest {
}
try {
int i = f("hello");
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 1;
Expect.isTrue(error is CastException);
Expect.equals("int", error.dstType);
@@ -104,7 +104,7 @@ class TypeTest {
Expect.equals(5, (field as String).length);
try {
field as int; // Throws a CastException
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 1;
Expect.equals("int", error.dstType);
Expect.equals("String", error.srcType);
@@ -129,7 +129,7 @@ class TypeTest {
anyFunction = null as Function; // No error.
try {
var i = f as int; // Throws a TypeError if type checks are enabled.
- } catch (TypeError error) {
+ } on TypeError catch (error) {
result = 1;
Expect.equals("int", error.dstType);
Expect.equals("() => Dynamic", error.srcType);
« no previous file with comments | « tests/language/try_catch_syntax_test.dart ('k') | tests/language/type_checks_in_factory_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698