Index: dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
diff --git a/dart/tests/compiler/dart2js/unneeded_part_js_test.dart b/dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
similarity index 75% |
copy from dart/tests/compiler/dart2js/unneeded_part_js_test.dart |
copy to dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
index aa1e641dbdbeb9dc454641db8bc933bd41a9086a..7025c417240f72f8ad3c868ac98e1e13e7ce4a9c 100644 |
--- a/dart/tests/compiler/dart2js/unneeded_part_js_test.dart |
+++ b/dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart |
@@ -2,7 +2,7 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-// Test that no parts are emitted when deferred loading isn't used. |
+// Test that tree-shaking hasn't been turned off. |
import 'package:expect/expect.dart'; |
import 'memory_source_file_helper.dart'; |
@@ -24,14 +24,13 @@ main() { |
var provider = new MemorySourceFileProvider(); |
void diagnosticHandler(Uri uri, int begin, int end, |
String message, Diagnostic kind) { |
- if (kind == Diagnostic.VERBOSE_INFO) { |
+ if (kind == Diagnostic.VERBOSE_INFO || kind == Diagnostic.WARNING) { |
return; |
} |
throw '$uri:$begin:$end:$message:$kind'; |
} |
EventSink<String> outputProvider(String name, String extension) { |
- if (name != '') throw 'Attempt to output file "$name.$extension"'; |
return new NullSink('$name.$extension'); |
} |
@@ -43,23 +42,23 @@ main() { |
[]); |
compiler.run(Uri.parse('memory:main.dart')); |
Expect.isFalse(compiler.compilationFailed); |
+ Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedEverything); |
+ Expect.isFalse(compiler.enqueuer.codegen.hasEnqueuedEverything); |
} |
const Map MEMORY_SOURCE_FILES = const { |
- 'main.dart': """ |
-class Greeting { |
- final message; |
- const Greeting(this.message); |
-} |
- |
-const fisk = const Greeting('Hello, World!'); |
+ 'main.dart': r""" |
+import 'dart:mirrors'; |
-main() { |
- var x = fisk; |
- if (new DateTime.now().millisecondsSinceEpoch == 42) { |
- x = new Greeting(\"I\'m confused\"); |
+class Foo { |
+ noSuchMethod(invocation) { |
+ print('Invoked ${MirrorSystem.getName(invocation.memberName)}'); |
+ return reflect('foobar').delegate(invocation); |
} |
- print(x.message); |
+} |
+ |
+void main() { |
+ print(new Foo().substring(3)); |
} |
""", |
}; |