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

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

Issue 1170673002: Begin to compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix BinaryConstantExpression.getKnownType Created 5 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 | « pkg/compiler/lib/src/resolution/resolution_result.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mock_compiler.dart
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 3eb6a81f52b592cb75791008ac5bdc1d198208eb..f6c9cc87e433443859e1235213ee62db24650663 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -9,6 +9,7 @@ import 'dart:async';
import 'dart:collection';
import 'package:compiler/compiler.dart' as api;
+import 'package:compiler/src/constants/expressions.dart';
import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/js_backend/js_backend.dart'
show JavaScriptBackend;
@@ -360,6 +361,12 @@ class CollectingTreeElements extends TreeElementMapping {
void remove(Node node) {
map.remove(node);
}
+
+ List<ConstantExpression> get constants {
+ List<ConstantExpression> list = <ConstantExpression>[];
+ forEachConstantNode((_, c) => list.add(c));
+ return list;
+ }
}
// The mock compiler does not split the program in output units.
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_result.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698