OLD | NEW |
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 --no-background-compilation | 4 // VMOptions=--optimization-counter-threshold=10 --no-background-compilation |
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 static void test12() { | 162 static void test12() { |
163 const x = const []; | 163 const x = const []; |
164 try { | 164 try { |
165 throw "up"; | 165 throw "up"; |
166 } catch (e) { | 166 } catch (e) { |
167 Expect.equals("up", e); | 167 Expect.equals("up", e); |
168 } on String catch (e) { | 168 } on String catch (e) { |
169 // Compile-time constants in unreachable catch blocks are still | 169 // Compile-time constants in unreachable catch blocks are still |
170 // compiled. | 170 // compiled. |
171 const y = x[0]; /// 01: compile-time error | 171 const y = x[0]; //# 01: compile-time error |
172 Expect.fail("unreachable"); | 172 Expect.fail("unreachable"); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 static void testMain() { | 177 static void testMain() { |
178 test1(); | 178 test1(); |
179 test2(); | 179 test2(); |
180 test3(); | 180 test3(); |
181 test4(); | 181 test4(); |
182 test5(); | 182 test5(); |
183 test6(); | 183 test6(); |
184 test7(); | 184 test7(); |
185 test8(); | 185 test8(); |
186 test9(); | 186 test9(); |
187 test10(); | 187 test10(); |
188 test11(); | 188 test11(); |
189 test12(); | 189 test12(); |
190 } | 190 } |
191 } | 191 } |
192 | 192 |
193 main() { | 193 main() { |
194 for (var i = 0; i < 20; i++) { | 194 for (var i = 0; i < 20; i++) { |
195 TryCatchTest.testMain(); | 195 TryCatchTest.testMain(); |
196 } | 196 } |
197 } | 197 } |
OLD | NEW |