| 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:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend; | 9 import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 Expect.isFalse(compiler.compilationFailed); | 22 Expect.isFalse(compiler.compilationFailed); |
| 23 Expect.isFalse(backend | 23 Expect.isFalse(backend |
| 24 .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveElements); | 24 .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveElements); |
| 25 Expect.isFalse(backend | 25 Expect.isFalse(backend |
| 26 .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveStaticFields); | 26 .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveStaticFields); |
| 27 Expect.isFalse( | 27 Expect.isFalse( |
| 28 backend.mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveElements); | 28 backend.mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveElements); |
| 29 Expect.isFalse(backend | 29 Expect.isFalse(backend |
| 30 .mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveStaticFields); | 30 .mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveStaticFields); |
| 31 Expect.isFalse(compiler.disableTypeInference); | 31 Expect.isFalse(compiler.disableTypeInference); |
| 32 Expect.isFalse(backend.hasRetainedMetadata); | 32 Expect.isFalse(backend.mirrorsData.hasRetainedMetadata); |
| 33 }); | 33 }); |
| 34 } | 34 } |
| 35 | 35 |
| 36 const Map MEMORY_SOURCE_FILES = const { | 36 const Map MEMORY_SOURCE_FILES = const { |
| 37 'main.dart': r""" | 37 'main.dart': r""" |
| 38 import 'dart:mirrors'; | 38 import 'dart:mirrors'; |
| 39 | 39 |
| 40 class Foo { | 40 class Foo { |
| 41 noSuchMethod(invocation) { | 41 noSuchMethod(invocation) { |
| 42 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); | 42 print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); |
| 43 return reflect('foobar').delegate(invocation); | 43 return reflect('foobar').delegate(invocation); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 void main() { | 47 void main() { |
| 48 print(new Foo().substring(3)); | 48 print(new Foo().substring(3)); |
| 49 } | 49 } |
| 50 """, | 50 """, |
| 51 }; | 51 }; |
| OLD | NEW |