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

Side by Side Diff: tests/language/try_catch_test.dart

Issue 60343006: Revert 29947 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--optimization-counter-threshold=10 4 // VMOptions=--optimization-counter-threshold=10
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class MyException { } 8 class MyException { }
9 9
10 class MyException1 extends MyException { } 10 class MyException1 extends MyException { }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 try { 131 try {
132 throw "up"; 132 throw "up";
133 } on String { 133 } on String {
134 e = "s"; 134 e = "s";
135 } on int { 135 } on int {
136 e = "i"; 136 e = "i";
137 } 137 }
138 Expect.equals("s", e); 138 Expect.equals("s", e);
139 } 139 }
140 140
141 static void test10() {
142 try {
143 throw "up";
144 } on String catch (e) {
145 var e = 1; // ok, shadows exception variable.
146 Expect.equals(1, e);
147 }
148 }
149
150 static void testMain() { 141 static void testMain() {
151 test1(); 142 test1();
152 test2(); 143 test2();
153 test3(); 144 test3();
154 test4(); 145 test4();
155 test5(); 146 test5();
156 test6(); 147 test6();
157 test7(); 148 test7();
158 test8(); 149 test8();
159 test9(); 150 test9();
160 test10();
161 } 151 }
162 } 152 }
163 153
164 main() { 154 main() {
165 for (var i = 0; i < 20; i++) { 155 for (var i = 0; i < 20; i++) {
166 TryCatchTest.testMain(); 156 TryCatchTest.testMain();
167 } 157 }
168 } 158 }
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698