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 // Test that tree-shaking hasn't been turned off. | 5 // Test that tree-shaking hasn't been turned off. |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 import 'memory_source_file_helper.dart'; | 8 import 'memory_source_file_helper.dart'; |
9 | 9 |
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
(...skipping 26 matching lines...) Expand all Loading... |
37 Compiler compiler = new Compiler(provider.readStringFromUri, | 37 Compiler compiler = new Compiler(provider.readStringFromUri, |
38 outputProvider, | 38 outputProvider, |
39 diagnosticHandler, | 39 diagnosticHandler, |
40 libraryRoot, | 40 libraryRoot, |
41 packageRoot, | 41 packageRoot, |
42 []); | 42 []); |
43 compiler.run(Uri.parse('memory:main.dart')); | 43 compiler.run(Uri.parse('memory:main.dart')); |
44 Expect.isFalse(compiler.compilationFailed); | 44 Expect.isFalse(compiler.compilationFailed); |
45 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything); | 45 Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything); |
46 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything); | 46 Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything); |
| 47 Expect.isFalse(compiler.disableTypeInference); |
47 } | 48 } |
48 | 49 |
49 const Map MEMORY_SOURCE_FILES = const { | 50 const Map MEMORY_SOURCE_FILES = const { |
50 'main.dart': r""" | 51 'main.dart': r""" |
51 import 'dart:mirrors'; | 52 import 'dart:mirrors'; |
52 | 53 |
53 class Foo { | 54 class Foo { |
54 noSuchMethod(invocation) { | 55 noSuchMethod(invocation) { |
55 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); | 56 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); |
56 return reflect('foobar').delegate(invocation); | 57 return reflect('foobar').delegate(invocation); |
57 } | 58 } |
58 } | 59 } |
59 | 60 |
60 void main() { | 61 void main() { |
61 print(new Foo().substring(3)); | 62 print(new Foo().substring(3)); |
62 } | 63 } |
63 """, | 64 """, |
64 }; | 65 }; |
OLD | NEW |