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

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

Issue 1334203002: Compute Compiler.proxyConstant on demand. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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: tests/compiler/dart2js/minimal_resolution_test.dart
diff --git a/tests/compiler/dart2js/minimal_resolution_test.dart b/tests/compiler/dart2js/minimal_resolution_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ca61f80488476083c1c8c75b676b355de71313a0
--- /dev/null
+++ b/tests/compiler/dart2js/minimal_resolution_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// 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 elements are not needlessly required by dart2js.
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:expect/expect.dart';
+import 'memory_compiler.dart';
+
+main() {
+ asyncTest(() async {
+ await analyze('main() {}');
+ await analyze('main() => proxy;', proxyConstant: true);
+ });
+}
+
+analyze(String code,
+ {bool proxyConstant: false}) async {
+ CompilationResult result = await runCompiler(
+ memorySourceFiles: {'main.dart': code},
+ options: ['--analyze-only']);
+ Expect.isTrue(result.isSuccess);
+ Compiler compiler = result.compiler;
+ Expect.equals(proxyConstant, compiler.proxyConstant != null);
+}
« pkg/compiler/lib/src/ssa/nodes.dart ('K') | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698