| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 testVariableDefinitions() { | 180 testVariableDefinitions() { |
| 181 testDart2Dart('main(){final var x,y; final String s;}'); | 181 testDart2Dart('main(){final var x,y; final String s;}'); |
| 182 testDart2Dart('foo(f,g){}main(){foo(1,2);}'); | 182 testDart2Dart('foo(f,g){}main(){foo(1,2);}'); |
| 183 testDart2Dart('foo(f(arg)){}main(){foo(main);}'); | 183 testDart2Dart('foo(f(arg)){}main(){foo(main);}'); |
| 184 // A couple of static/finals inside a class. | 184 // A couple of static/finals inside a class. |
| 185 testDart2Dart('main(){A.a; A.b;}class A{static final String a="5";' | 185 testDart2Dart('main(){A.a; A.b;}class A{static final String a="5";' |
| 186 'static final String b="4";}'); | 186 'static final String b="4";}'); |
| 187 // Class member of typedef-ed function type. | 187 // Class member of typedef-ed function type. |
| 188 // Maybe typedef should be included in the result too, but it | 188 // Maybe typedef should be included in the result too, but it |
| 189 // works fine without it. | 189 // works fine without it. |
| 190 testDart2Dart('typedef void foofunc(arg);' | 190 testDart2Dart( |
| 191 'class A {' | 191 'main(){new A((arg){});}typedef void foofunc(arg);' |
| 192 'final foofunc handler;' | 192 'class A{A(foofunc this.handler);final foofunc handler;}'); |
| 193 'A(foofunc this.handler);' | |
| 194 '}' | |
| 195 'main() {new A((arg) {});}', (result) { | |
| 196 Expect.equals( | |
| 197 'main(){new A((arg){});}' | |
| 198 'class A{A(foofunc this.handler);final foofunc handler;}', result); | |
| 199 }); | |
| 200 } | 193 } |
| 201 | 194 |
| 202 testGetSet() { | 195 testGetSet() { |
| 203 // Top-level get/set. | 196 // Top-level get/set. |
| 204 testDart2Dart('get foo(){return 5;}set foo(arg){}main(){foo; foo=5;}'); | 197 testDart2Dart('get foo(){return 5;}set foo(arg){}main(){foo; foo=5;}'); |
| 205 // Field get/set. | 198 // Field get/set. |
| 206 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}' | 199 testDart2Dart('main(){var a=new A(); a.foo; a.foo=5;}' |
| 207 'class A{set foo(a){}get foo(){return 5;}}'); | 200 'class A{set foo(a){}get foo(){return 5;}}'); |
| 208 // Typed get/set. | 201 // Typed get/set. |
| 209 testDart2Dart('String get foo(){return "a";}main(){foo;}'); | 202 testDart2Dart('String get foo(){return "a";}main(){foo;}'); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 testFactoryConstructor(); | 419 testFactoryConstructor(); |
| 427 testTopLevelField(); | 420 testTopLevelField(); |
| 428 testAbstractClass(); | 421 testAbstractClass(); |
| 429 testConflictLibraryClassRename(); | 422 testConflictLibraryClassRename(); |
| 430 testNoConflictSendsRename(); | 423 testNoConflictSendsRename(); |
| 431 testConflictSendsRename(); | 424 testConflictSendsRename(); |
| 432 // Disabled with revert of https://chromiumcodereview.appspot.com/10824062/ | 425 // Disabled with revert of https://chromiumcodereview.appspot.com/10824062/ |
| 433 // testDefaultClassWithArgs(); | 426 // testDefaultClassWithArgs(); |
| 434 testClassExtendsWithArgs(); | 427 testClassExtendsWithArgs(); |
| 435 } | 428 } |
| OLD | NEW |