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

Side by Side Diff: frog/tests/leg_only/label_test.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/tests/leg_only/is_operator_test.dart ('k') | frog/tests/leg_only/leg_only.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 // A break label must be declared where it's used.
6 undeclaredBreakLabel1() {
7 foo: { break bar; break foo; } /// 01: compile-time error
8 }
9
10 undeclaredBreakLabel2() {
11 foo: while (true) { break bar; break foo; } /// 02: compile-time error
12 }
13
14 // An unlabeled break must be inside a loop or switch.
15 noBreakTarget() {
16 foo: if (true) { break; break foo; } /// 03: compile-time error
17 }
18
19 // A continue label must be declared where it's used.
20 undeclaredContinueLabel() {
21 foo: for (;;) { continue bar; break foo; } /// 04: compile-time error
22 }
23
24 // An unlabeled continue must be inside a loop.
25 noContinueTarget() {
26 foo: if (true) continue; else break foo; /// 05: compile-time error
27 }
28
29 // A continue label must point to a continue-able statement.
30 wrongContinueLabel() {
31 foo: if (true) continue foo; /// 06: compile-time error
32 }
33
34 // Labels are not captured by closures.
35 noncaptureLabel() {
36 foo: { /// 07: compile-time error
37 (() { break foo; })(); /// 07: continued
38 break foo; /// 07: continued
39 } /// 07: continued
40 }
41
42 // Implicit break targets are not captured by closures.
43 noncaptureBreak() {
44 while(true) (() { break; })(); /// 08: compile-time error
45 }
46
47 // Implicit continue targets are not captured by closures.
48 noncaptureContinue() {
49 while(true) (() { continue; })(); /// 09: compile-time error
50 }
51
52 main() {
53 undeclaredBreakLabel1();
54 undeclaredBreakLabel2();
55 noBreakTarget();
56 undeclaredContinueLabel();
57 noContinueTarget();
58 wrongContinueLabel();
59 noncaptureLabel();
60 noncaptureBreak();
61 noncaptureContinue();
62 }
OLDNEW
« no previous file with comments | « frog/tests/leg_only/is_operator_test.dart ('k') | frog/tests/leg_only/leg_only.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698