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. |