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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart

Issue 1109393012: Allow use of deferred type-literals in non-constant contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 8 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/deferred_load.dart ('k') | pkg/compiler/lib/src/js_backend/type_variable_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/js_backend/type_variable_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698