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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 107833002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/generated/scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index c9f655192cf5d1a6d0436c34c500eb4184278dfa..7a297fa62e0b2c21df522b29cad31358052e3b3f 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -239,12 +239,6 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
Object visitDefaultFormalParameter(DefaultFormalParameter node) {
ElementHolder holder = new ElementHolder();
- visit(holder, node.defaultValue);
- FunctionElementImpl initializer = new FunctionElementImpl();
- initializer.functions = holder.functions;
- initializer.labels = holder.labels;
- initializer.localVariables = holder.localVariables;
- initializer.parameters = holder.parameters;
SimpleIdentifier parameterName = node.parameter.identifier;
ParameterElementImpl parameter;
if (node.parameter is FieldFormalParameter) {
@@ -254,10 +248,17 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
}
parameter.const3 = node.isConst;
parameter.final2 = node.isFinal;
- parameter.initializer = initializer;
parameter.parameterKind = node.kind;
Expression defaultValue = node.defaultValue;
if (defaultValue != null) {
+ visit(holder, defaultValue);
+ FunctionElementImpl initializer = new FunctionElementImpl.con2(defaultValue.beginToken.offset);
+ initializer.functions = holder.functions;
+ initializer.labels = holder.labels;
+ initializer.localVariables = holder.localVariables;
+ initializer.parameters = holder.parameters;
+ initializer.synthetic = true;
+ parameter.initializer = initializer;
parameter.setDefaultValueRange(defaultValue.offset, defaultValue.length);
}
setParameterVisibleRange(node, parameter);
@@ -623,7 +624,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
} finally {
_inFieldContext = wasInFieldContext;
}
- FunctionElementImpl initializer = new FunctionElementImpl();
+ FunctionElementImpl initializer = new FunctionElementImpl.con2(node.initializer.beginToken.offset);
initializer.functions = holder.functions;
initializer.labels = holder.labels;
initializer.localVariables = holder.localVariables;
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/generated/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698