Index: pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart |
diff --git a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart |
index b5d6caee9de3b3ed6d883e066022522185bb1103..bce66ac01bd93fbfaa0004d59c4b5b24975dd6d0 100644 |
--- a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart |
+++ b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart |
@@ -166,21 +166,25 @@ class ResolvedAstSerializer extends Visitor { |
serializeLabelDefinition(labelDefinition, list.createObject()); |
} |
} |
+ |
if (element is FunctionElement) { |
- FunctionElement function = element; |
- function.functionSignature.forEachParameter((ParameterElement parameter) { |
- ParameterElement parameterImpl = parameter.implementation; |
- // TODO(johnniwinther): Should we support element->node mapping as well? |
- getNodeDataEncoder(parameterImpl.node) |
- .setElement(PARAMETER_NODE, parameter); |
- if (parameter.initializer != null) { |
- getNodeDataEncoder(parameterImpl.initializer) |
- .setElement(PARAMETER_INITIALIZER, parameter); |
- } |
- }); |
+ serializeParameterNodes(element); |
} |
} |
+ void serializeParameterNodes(FunctionElement function) { |
+ function.functionSignature.forEachParameter((ParameterElement parameter) { |
+ ParameterElement parameterImpl = parameter.implementation; |
+ // TODO(johnniwinther): Should we support element->node mapping as well? |
+ getNodeDataEncoder(parameterImpl.node) |
+ .setElement(PARAMETER_NODE, parameter); |
+ if (parameter.initializer != null) { |
+ getNodeDataEncoder(parameterImpl.initializer) |
+ .setElement(PARAMETER_INITIALIZER, parameter); |
+ } |
+ }); |
+ } |
+ |
/// Serialize [target] into [encoder]. |
void serializeJumpTarget(JumpTarget jumpTarget, ObjectEncoder encoder) { |
encoder.setElement(Key.EXECUTABLE_CONTEXT, jumpTarget.executableContext); |
@@ -318,6 +322,7 @@ class ResolvedAstSerializer extends Visitor { |
if (function != null && function.isFunction && function.isLocal) { |
// Mark root nodes of local functions; these need their own ResolvedAst. |
getNodeDataEncoder(node).setElement(Key.FUNCTION, function); |
+ serializeParameterNodes(function); |
} |
} |
} |