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 | 4 |
5 #import('dart:uri'); | 5 #import('dart:uri'); |
6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
7 #import("../../../lib/compiler/compiler.dart"); | 7 #import("../../../lib/compiler/compiler.dart"); |
8 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
9 | 9 |
10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 testDart2Dart('main(){final var x, y; final String s;}'); | 147 testDart2Dart('main(){final var x, y; final String s;}'); |
148 testDart2Dart('foo(f, g){}main(){foo(1, 2);}'); | 148 testDart2Dart('foo(f, g){}main(){foo(1, 2);}'); |
149 testDart2Dart('foo(f(arg)){}main(){foo(main);}'); | 149 testDart2Dart('foo(f(arg)){}main(){foo(main);}'); |
150 } | 150 } |
151 | 151 |
152 testGetSet() { | 152 testGetSet() { |
153 // Top-level get/set. | 153 // Top-level get/set. |
154 testDart2Dart('get foo(){return 5;}set foo(arg){}main(){foo; foo=5;}'); | 154 testDart2Dart('get foo(){return 5;}set foo(arg){}main(){foo; foo=5;}'); |
155 // Field get/set. | 155 // Field get/set. |
156 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}class A{set foo(a){}get f
oo(){return 5;}}'); | 156 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}class A{set foo(a){}get f
oo(){return 5;}}'); |
| 157 // Typed get/set. |
| 158 testDart2Dart('String get foo(){return "a";}main(){foo;}'); |
157 } | 159 } |
158 | 160 |
159 main() { | 161 main() { |
160 testGenericTypes(); | 162 testGenericTypes(); |
161 testForLoop(); | 163 testForLoop(); |
162 testEmptyList(); | 164 testEmptyList(); |
163 testClosure(); | 165 testClosure(); |
164 testIndexedOperatorDecl(); | 166 testIndexedOperatorDecl(); |
165 testNativeMethods(); | 167 testNativeMethods(); |
166 testPrefixIncrements(); | 168 testPrefixIncrements(); |
167 testConstModifier(); | 169 testConstModifier(); |
168 testSimpleFileUnparse(); | 170 testSimpleFileUnparse(); |
169 testSimpleObjectInstantiation(); | 171 testSimpleObjectInstantiation(); |
170 testSimpleTopLevelClass(); | 172 testSimpleTopLevelClass(); |
171 testClassWithSynthesizedConstructor(); | 173 testClassWithSynthesizedConstructor(); |
172 testClassWithMethod(); | 174 testClassWithMethod(); |
173 testVariableDefinitions(); | 175 testVariableDefinitions(); |
174 testGetSet(); | 176 testGetSet(); |
175 testTopLevelField(); | 177 testTopLevelField(); |
176 } | 178 } |
OLD | NEW |