| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
| 8 final String identifier; | 8 final String identifier; |
| 9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
| 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 void tryMakeLocalPlaceholder(Element element, Identifier node) { | 270 void tryMakeLocalPlaceholder(Element element, Identifier node) { |
| 271 bool isNamedOptionalParameter() { | 271 bool isNamedOptionalParameter() { |
| 272 FunctionTypedElement function = element.enclosingElement; | 272 FunctionTypedElement function = element.enclosingElement; |
| 273 FunctionSignature signature = function.functionSignature; | 273 FunctionSignature signature = function.functionSignature; |
| 274 if (!signature.optionalParametersAreNamed) return false; | 274 if (!signature.optionalParametersAreNamed) return false; |
| 275 for (Element parameter in signature.optionalParameters) { | 275 for (Element parameter in signature.optionalParameters) { |
| 276 if (identical(parameter, element)) return true; | 276 if (identical(parameter, element)) return true; |
| 277 } | 277 } |
| 278 return false; | 278 return false; |
| 279 } | 279 } |
| 280 if (element.isParameter && | 280 if (element.isRegularParameter && |
| 281 !isTypedefParameter(element) && | 281 !isTypedefParameter(element) && |
| 282 isNamedOptionalParameter()) { | 282 isNamedOptionalParameter()) { |
| 283 currentFunctionScope.registerParameter(node); | 283 currentFunctionScope.registerParameter(node); |
| 284 } else if (Elements.isLocal(element) && !isTypedefParameter(element)) { | 284 } else if (Elements.isLocal(element) && !isTypedefParameter(element)) { |
| 285 makeLocalPlaceholder(node); | 285 makeLocalPlaceholder(node); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 | 288 |
| 289 void tryMakeMemberPlaceholder(Identifier node) { | 289 void tryMakeMemberPlaceholder(Identifier node) { |
| 290 assert(node != null); | 290 assert(node != null); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 715 |
| 716 visitBlock(Block node) { | 716 visitBlock(Block node) { |
| 717 for (Node statement in node.statements.nodes) { | 717 for (Node statement in node.statements.nodes) { |
| 718 if (statement is VariableDefinitions) { | 718 if (statement is VariableDefinitions) { |
| 719 makeVarDeclarationTypePlaceholder(statement); | 719 makeVarDeclarationTypePlaceholder(statement); |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 node.visitChildren(this); | 722 node.visitChildren(this); |
| 723 } | 723 } |
| 724 } | 724 } |
| OLD | NEW |