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

Unified Diff: frog/leg/compile_time_constants.dart

Issue 9699033: Introduce FieldParameterElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 8 years, 9 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 | « no previous file | frog/leg/compiler.dart » ('j') | frog/leg/elements/elements.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/compile_time_constants.dart
diff --git a/frog/leg/compile_time_constants.dart b/frog/leg/compile_time_constants.dart
index cefe2f5f2a70f8d0f44862a181f09597555c33cf..56a8a91d68c4cad2c93953686eb207968701ef46 100644
--- a/frog/leg/compile_time_constants.dart
+++ b/frog/leg/compile_time_constants.dart
@@ -486,7 +486,8 @@ class ConstantHandler extends CompilerTask {
*/
void compileWorkItem(WorkItem work) {
assert(work.element.kind == ElementKind.FIELD
- || work.element.kind == ElementKind.PARAMETER);
+ || work.element.kind == ElementKind.PARAMETER
+ || work.element.kind == ElementKind.FIELD_PARAMETER);
VariableElement element = work.element;
// Shortcut if it has already been compiled.
if (initialVariableValues.containsKey(element)) return;
@@ -932,7 +933,12 @@ class CompileTimeConstantEvaluator extends AbstractVisitor {
}
int index = 0;
parameters.forEachParameter((Element parameter) {
- constructorDefinitions[parameter] = arguments[index++];
+ Constant argument = arguments[index++];
+ constructorDefinitions[parameter] = argument;
+ if (parameter.kind == ElementKind.FIELD_PARAMETER) {
+ FieldParameterElement fieldParameterElement = parameter;
+ constructorDefinitions[fieldParameterElement.fieldElement] = argument;
+ }
});
}
« no previous file with comments | « no previous file | frog/leg/compiler.dart » ('j') | frog/leg/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698