| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import "package:async_helper/async_helper.dart"; |
| 6 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' | 7 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
| 7 show TypeMask; | 8 show TypeMask; |
| 8 | 9 |
| 9 import 'compiler_helper.dart'; | 10 import 'compiler_helper.dart'; |
| 10 import 'parser_helper.dart'; | 11 import 'parser_helper.dart'; |
| 11 | 12 |
| 12 void compileAndFind(String code, | 13 void compileAndFind(String code, |
| 13 String className, | 14 String className, |
| 14 String memberName, | 15 String memberName, |
| 15 bool disableInlining, | 16 bool disableInlining, |
| 16 check(compiler, element)) { | 17 check(compiler, element)) { |
| 17 Uri uri = new Uri(scheme: 'source'); | 18 Uri uri = new Uri(scheme: 'source'); |
| 19 asyncStart(); |
| 18 var compiler = compilerFor(code, uri); | 20 var compiler = compilerFor(code, uri); |
| 19 compiler.disableInlining = disableInlining; | 21 compiler.disableInlining = disableInlining; |
| 20 compiler.runCompiler(uri); | 22 compiler.runCompiler(uri).then((_) { |
| 21 var cls = findElement(compiler, className); | 23 var cls = findElement(compiler, className); |
| 22 var member = cls.lookupLocalMember(buildSourceString(memberName)); | 24 var member = cls.lookupLocalMember(buildSourceString(memberName)); |
| 23 return check(compiler, member); | 25 return check(compiler, member); |
| 26 }).whenComplete(() => asyncEnd()); |
| 24 } | 27 } |
| 25 | 28 |
| 26 const String TEST_1 = r""" | 29 const String TEST_1 = r""" |
| 27 class A { | 30 class A { |
| 28 x(p) => p; | 31 x(p) => p; |
| 29 } | 32 } |
| 30 main() { new A().x("s"); } | 33 main() { new A().x("s"); } |
| 31 """; | 34 """; |
| 32 | 35 |
| 33 const String TEST_2 = r""" | 36 const String TEST_2 = r""" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 compiler.typesTask.boolType, | 281 compiler.typesTask.boolType, |
| 279 compiler.typesTask.doubleType]); | 282 compiler.typesTask.doubleType]); |
| 280 | 283 |
| 281 runTest(TEST_18, (compiler) => [subclassOfInterceptor(compiler), | 284 runTest(TEST_18, (compiler) => [subclassOfInterceptor(compiler), |
| 282 subclassOfInterceptor(compiler)]); | 285 subclassOfInterceptor(compiler)]); |
| 283 } | 286 } |
| 284 | 287 |
| 285 void main() { | 288 void main() { |
| 286 test(); | 289 test(); |
| 287 } | 290 } |
| OLD | NEW |