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

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: Address comments 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
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_mirrors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
""",
};
« no previous file with comments | « 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