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 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' | 8 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
9 show TypeMask; | 9 show TypeMask; |
10 | 10 |
11 import 'compiler_helper.dart'; | 11 import 'compiler_helper.dart'; |
12 import 'parser_helper.dart'; | 12 import 'parser_helper.dart'; |
13 | 13 |
14 void compileAndFind(String code, | 14 void compileAndFind(String code, |
15 String className, | 15 String className, |
16 String memberName, | 16 String memberName, |
17 bool disableInlining, | 17 bool disableInlining, |
18 check(compiler, element)) { | 18 check(compiler, element)) { |
19 Uri uri = new Uri(scheme: 'source'); | 19 Uri uri = new Uri(scheme: 'source'); |
20 var compiler = compilerFor(code, uri); | 20 var compiler = compilerFor(code, uri); |
21 asyncTest(() => compiler.runCompiler(uri).then((_) { | 21 asyncTest(() => compiler.runCompiler(uri).then((_) { |
22 compiler.disableInlining = disableInlining; | 22 compiler.disableInlining = disableInlining; |
23 var cls = findElement(compiler, className); | 23 var cls = findElement(compiler, className); |
24 var member = cls.lookupMember(buildSourceString(memberName)); | 24 var member = cls.lookupMember(memberName); |
25 check(compiler, member); | 25 check(compiler, member); |
26 })); | 26 })); |
27 } | 27 } |
28 | 28 |
29 const String TEST_1 = r""" | 29 const String TEST_1 = r""" |
30 class A { | 30 class A { |
31 int f; | 31 int f; |
32 } | 32 } |
33 main() { new A(); } | 33 main() { new A(); } |
34 """; | 34 """; |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 'f5': (compiler) => compiler.typesTask.numType.nullable(), | 544 'f5': (compiler) => compiler.typesTask.numType.nullable(), |
545 'f6': (compiler) => compiler.typesTask.stringType.nullable()
}); | 545 'f6': (compiler) => compiler.typesTask.stringType.nullable()
}); |
546 | 546 |
547 runTest(TEST_25, {'f1': (compiler) => compiler.typesTask.intType }); | 547 runTest(TEST_25, {'f1': (compiler) => compiler.typesTask.intType }); |
548 runTest(TEST_26, {'f1': (compiler) => compiler.typesTask.intType }); | 548 runTest(TEST_26, {'f1': (compiler) => compiler.typesTask.intType }); |
549 } | 549 } |
550 | 550 |
551 void main() { | 551 void main() { |
552 test(); | 552 test(); |
553 } | 553 } |
OLD | NEW |