OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Check that we can use pseudo keywords as names in function level code. | 4 // Check that we can use pseudo keywords as names in function level code. |
5 | 5 |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 | 8 |
9 class PseudoKWTest { | 9 class PseudoKWTest { |
10 static testMain() { | 10 static testMain() { |
(...skipping 20 matching lines...) Expand all Loading... |
31 // "native" is a per-implementation extension that is not a part of the | 31 // "native" is a per-implementation extension that is not a part of the |
32 // Dart language. While it is not an official built-in identifier, it | 32 // Dart language. While it is not an official built-in identifier, it |
33 // is useful to ensure that it remains a legal identifier. | 33 // is useful to ensure that it remains a legal identifier. |
34 var native = 0; | 34 var native = 0; |
35 | 35 |
36 | 36 |
37 // The code below adds a few additional variants of usage without any | 37 // The code below adds a few additional variants of usage without any |
38 // attempt at complete coverage. | 38 // attempt at complete coverage. |
39 { | 39 { |
40 void factory(set) { | 40 void factory(set) { |
41 return 0; /// 01: ok | 41 return; /// 01: ok |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 get: while (import > 0) { | 45 get: while (import > 0) { |
46 break get; | 46 break get; |
47 } | 47 } |
48 | 48 |
49 return | 49 return |
50 static + /// 01: ok | 50 static + /// 01: ok |
51 library * operator; | 51 library * operator; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Expect.equals(1, A.static()); /// 01: ok | 107 Expect.equals(1, A.static()); /// 01: ok |
108 typedef("T"); /// 01: ok | 108 typedef("T"); /// 01: ok |
109 Expect.equals("typedef T", typedef("T")); /// 01: ok | 109 Expect.equals("typedef T", typedef("T")); /// 01: ok |
110 static("true"); /// 01: ok | 110 static("true"); /// 01: ok |
111 Expect.equals(false, static("true")); /// 01: ok | 111 Expect.equals(false, static("true")); /// 01: ok |
112 Expect.equals(5, C.operator); | 112 Expect.equals(5, C.operator); |
113 Expect.equals(null, C.get); | 113 Expect.equals(null, C.get); |
114 C.set = 0; | 114 C.set = 0; |
115 Expect.equals(111, C.set); | 115 Expect.equals(111, C.set); |
116 } | 116 } |
OLD | NEW |