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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import '../../../sdk/lib/_internal/compiler/implementation/js_backend/js_backend
.dart'; | 6 import '../../../sdk/lib/_internal/compiler/implementation/js_backend/js_backend
.dart'; |
7 import '../../../sdk/lib/_internal/compiler/implementation/ssa/ssa.dart'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/ssa/ssa.dart'; |
8 | 8 |
9 import 'compiler_helper.dart'; | 9 import 'compiler_helper.dart'; |
10 import 'parser_helper.dart'; | 10 import 'parser_helper.dart'; |
11 | 11 |
12 void compileAndFind(String code, | 12 void compileAndFind(String code, |
13 String className, | 13 String className, |
14 String memberName, | 14 String memberName, |
15 bool disableInlining, | 15 bool disableInlining, |
16 check(compiler, element)) { | 16 check(compiler, element)) { |
17 Uri uri = new Uri.fromComponents(scheme: 'source'); | 17 Uri uri = new Uri(scheme: 'source'); |
18 var compiler = compilerFor(code, uri); | 18 var compiler = compilerFor(code, uri); |
19 compiler.disableInlining = disableInlining; | 19 compiler.disableInlining = disableInlining; |
20 compiler.runCompiler(uri); | 20 compiler.runCompiler(uri); |
21 var cls = findElement(compiler, className); | 21 var cls = findElement(compiler, className); |
22 var member = cls.lookupLocalMember(buildSourceString(memberName)); | 22 var member = cls.lookupLocalMember(buildSourceString(memberName)); |
23 return check(compiler, member); | 23 return check(compiler, member); |
24 } | 24 } |
25 | 25 |
26 const String TEST_1 = r""" | 26 const String TEST_1 = r""" |
27 class A { | 27 class A { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 defaultTypes.update(0, const SourceString("p2"), HType.INTEGER); | 284 defaultTypes.update(0, const SourceString("p2"), HType.INTEGER); |
285 defaultTypes.update(1, const SourceString("p3"), HType.STRING); | 285 defaultTypes.update(1, const SourceString("p3"), HType.STRING); |
286 runTest(TEST_17, [HType.INTEGER, HType.BOOLEAN, HType.DOUBLE], defaultTypes); | 286 runTest(TEST_17, [HType.INTEGER, HType.BOOLEAN, HType.DOUBLE], defaultTypes); |
287 | 287 |
288 runTest(TEST_18, [subclassOfInterceptor, subclassOfInterceptor]); | 288 runTest(TEST_18, [subclassOfInterceptor, subclassOfInterceptor]); |
289 } | 289 } |
290 | 290 |
291 void main() { | 291 void main() { |
292 test(); | 292 test(); |
293 } | 293 } |
OLD | NEW |