| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}class A{set foo(a){}get f
oo(){return 5;}}'); | 160 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}class A{set foo(a){}get f
oo(){return 5;}}'); |
| 161 // Typed get/set. | 161 // Typed get/set. |
| 162 testDart2Dart('String get foo(){return "a";}main(){foo;}'); | 162 testDart2Dart('String get foo(){return "a";}main(){foo;}'); |
| 163 } | 163 } |
| 164 | 164 |
| 165 testFactoryConstructor() { | 165 testFactoryConstructor() { |
| 166 testDart2Dart('main(){new A.fromFoo();}class A{A.fromFoo();}'); | 166 testDart2Dart('main(){new A.fromFoo();}class A{A.fromFoo();}'); |
| 167 // Now more complicated, with normal constructor and factory parameters. | 167 // Now more complicated, with normal constructor and factory parameters. |
| 168 testDart2Dart('main(){new A.fromFoo(5);}' | 168 testDart2Dart('main(){new A.fromFoo(5);}' |
| 169 'class A{A(this.f);A.fromFoo(foo):this("f");final String f;}'); | 169 'class A{A(this.f);A.fromFoo(foo):this("f");final String f;}'); |
| 170 // Now even more complicated, with interface and default factory. |
| 171 testDart2Dart('main(){new A.fromFoo(5); new I.fromFoo();}' |
| 172 'class IFactory{factory I.fromFoo()=> new A(5);}' |
| 173 'interface I default IFactory{I.fromFoo();}' |
| 174 'class A implements I{A(this.f);A.fromFoo(foo):this("f");final String f;}'
); |
| 170 } | 175 } |
| 171 | 176 |
| 172 main() { | 177 main() { |
| 173 testGenericTypes(); | 178 testGenericTypes(); |
| 174 testForLoop(); | 179 testForLoop(); |
| 175 testEmptyList(); | 180 testEmptyList(); |
| 176 testClosure(); | 181 testClosure(); |
| 177 testIndexedOperatorDecl(); | 182 testIndexedOperatorDecl(); |
| 178 testNativeMethods(); | 183 testNativeMethods(); |
| 179 testPrefixIncrements(); | 184 testPrefixIncrements(); |
| 180 testConstModifier(); | 185 testConstModifier(); |
| 181 testSimpleFileUnparse(); | 186 testSimpleFileUnparse(); |
| 182 testSimpleObjectInstantiation(); | 187 testSimpleObjectInstantiation(); |
| 183 testSimpleTopLevelClass(); | 188 testSimpleTopLevelClass(); |
| 184 testClassWithSynthesizedConstructor(); | 189 testClassWithSynthesizedConstructor(); |
| 185 testClassWithMethod(); | 190 testClassWithMethod(); |
| 186 testVariableDefinitions(); | 191 testVariableDefinitions(); |
| 187 testGetSet(); | 192 testGetSet(); |
| 188 testFactoryConstructor(); | 193 testFactoryConstructor(); |
| 189 testTopLevelField(); | 194 testTopLevelField(); |
| 190 } | 195 } |
| OLD | NEW |