Index: pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart |
diff --git a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart |
index 4771a5bc6e44f27c3d9370cb97b5a89a27d675bb..0f66c0d7a968e3328caa821e80ee2f22d67a9600 100644 |
--- a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart |
+++ b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart |
@@ -41,11 +41,14 @@ class JavaScriptConstantTask extends ConstantCompilerTask { |
}); |
} |
- ConstantExpression compileNode(Node node, TreeElements elements) { |
+ ConstantExpression compileNode(Node node, TreeElements elements, |
+ {bool enforceConst: true}) { |
return measure(() { |
ConstantExpression result = |
- dartConstantCompiler.compileNode(node, elements); |
- jsConstantCompiler.compileNode(node, elements); |
+ dartConstantCompiler.compileNode(node, elements, |
+ enforceConst: enforceConst); |
+ jsConstantCompiler.compileNode(node, elements, |
+ enforceConst: enforceConst); |
return result; |
}); |
} |
@@ -163,8 +166,9 @@ class JavaScriptConstantCompiler extends ConstantCompilerBase |
return initialValue; |
} |
- ConstantExpression compileNode(Node node, TreeElements elements) { |
- return compileNodeWithDefinitions(node, elements); |
+ ConstantExpression compileNode(Node node, TreeElements elements, |
+ {bool enforceConst: true}) { |
+ return compileNodeWithDefinitions(node, elements, isConst: enforceConst); |
} |
ConstantExpression compileNodeWithDefinitions(Node node, |