Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2565)

Unified Diff: dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart

Issue 16817002: Be smarter about when disabling tree-shaking. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 78%
copy from dart/tests/compiler/dart2js/unneeded_part_js_test.dart
copy to dart/tests/compiler/dart2js/mirror_tree_shaking_test.dart
index aa1e641dbdbeb9dc454641db8bc933bd41a9086a..b7f3f0927f5171d0eff248bb7707f2815b748dc4 100644
--- a/dart/tests/compiler/dart2js/unneeded_part_js_test.dart
+++ b/dart/tests/compiler/dart2js/mirror_tree_shaking_test.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));
}
""",
};
« dart/sdk/lib/_internal/lib/js_mirrors.dart ('K') | « dart/sdk/lib/_internal/lib/js_mirrors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698