Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionScope.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionScope.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionScope.java |
| index ac23190cb5134bf58386b9a60554957144af783f..3f13a81b8e8cc03c8f9aaffa8ac7317597a4ac8d 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionScope.java |
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionScope.java |
| @@ -22,6 +22,9 @@ import com.google.dart.engine.element.ParameterElement; |
| * @coverage dart.engine.resolver |
| */ |
| public class FunctionScope extends EnclosedScope { |
| + private final ExecutableElement functionElement; |
| + private boolean parametersDefined; |
| + |
| /** |
| * Initialize a newly created scope enclosed within another scope. |
| * |
| @@ -30,15 +33,17 @@ public class FunctionScope extends EnclosedScope { |
| */ |
| public FunctionScope(Scope enclosingScope, ExecutableElement functionElement) { |
| super(new EnclosedScope(enclosingScope)); |
| - defineParameters(functionElement); |
| + this.functionElement = functionElement; |
| } |
| /** |
| * Define the parameters for the given function in the scope that encloses this function. |
| - * |
| - * @param functionElement the element representing the function represented by this scope |
| */ |
| - private void defineParameters(ExecutableElement functionElement) { |
| + public void defineParameters() { |
| + if (parametersDefined) { |
|
Brian Wilkerson
2013/09/27 12:26:10
Just out of curiosity, why are we invoking this me
scheglov
2013/09/27 23:40:07
It seems that ResolverVisitor redirects to two oth
|
| + return; |
| + } |
| + parametersDefined = true; |
| Scope parameterScope = getEnclosingScope(); |
| if (functionElement.getEnclosingElement() instanceof ExecutableElement) { |
| String name = functionElement.getName(); |