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

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

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 7 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 | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/message_kind_helper.dart
diff --git a/tests/compiler/dart2js/message_kind_helper.dart b/tests/compiler/dart2js/message_kind_helper.dart
index 9fd6638292f3bdbab1d53f710c4c3ab359b90e5e..7bc63ce886e2ac8c8f43aee22e330994993db919 100644
--- a/tests/compiler/dart2js/message_kind_helper.dart
+++ b/tests/compiler/dart2js/message_kind_helper.dart
@@ -10,6 +10,8 @@ import 'dart:async';
import 'package:compiler/src/dart2jslib.dart' show
Compiler,
MessageKind;
+import 'package:compiler/src/dart_backend/dart_backend.dart' show
+ DartBackend;
import 'memory_compiler.dart';
@@ -69,12 +71,21 @@ Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
messages.add(message);
}
+ bool oldBackendIsDart;
+ if (cachedCompiler != null) {
+ oldBackendIsDart = cachedCompiler.backend is DartBackend;
+ }
+ bool newBackendIsDart = kind.options.contains('--output-type=dart');
+
Compiler compiler = compilerFor(
example,
diagnosticHandler: collect,
options: ['--analyze-only',
'--enable-experimental-mirrors']..addAll(kind.options),
- cachedCompiler: cachedCompiler);
+ cachedCompiler:
+ // TODO(johnniwinther): Remove this restriction when constant
+ // values can be computed directly from the expressions.
+ oldBackendIsDart == newBackendIsDart ? cachedCompiler : null);
return compiler.run(Uri.parse('memory:main.dart')).then((_) {
« no previous file with comments | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698