| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 if (!Elements.isErroneous(constructor)) { | 496 if (!Elements.isErroneous(constructor)) { |
| 497 tryMakeConstructorPlaceholder(node.send.selector, constructor); | 497 tryMakeConstructorPlaceholder(node.send.selector, constructor); |
| 498 // TODO(smok): Should this be in visitNamedArgument? | 498 // TODO(smok): Should this be in visitNamedArgument? |
| 499 // Field names can be exposed as names of optional arguments, e.g. | 499 // Field names can be exposed as names of optional arguments, e.g. |
| 500 // class C { | 500 // class C { |
| 501 // final field; | 501 // final field; |
| 502 // C([this.field]); | 502 // C([this.field]); |
| 503 // } | 503 // } |
| 504 // Do not forget to rename them as well. | 504 // Do not forget to rename them as well. |
| 505 FunctionElement constructorFunction = constructor; | 505 FunctionElement constructorFunction = constructor; |
| 506 Link<Element> optionalParameters = | 506 List<Element> optionalParameters = |
| 507 constructorFunction.functionSignature.optionalParameters; | 507 constructorFunction.functionSignature.optionalParameters; |
| 508 for (final argument in send.argumentsNode) { | 508 for (final argument in send.argumentsNode) { |
| 509 NamedArgument named = argument.asNamedArgument(); | 509 NamedArgument named = argument.asNamedArgument(); |
| 510 if (named == null) continue; | 510 if (named == null) continue; |
| 511 Identifier name = named.name; | 511 Identifier name = named.name; |
| 512 String nameAsString = name.source; | 512 String nameAsString = name.source; |
| 513 for (final parameter in optionalParameters) { | 513 for (final parameter in optionalParameters) { |
| 514 if (parameter.isInitializingFormal) { | 514 if (parameter.isInitializingFormal) { |
| 515 if (parameter.name == nameAsString) { | 515 if (parameter.name == nameAsString) { |
| 516 tryMakeMemberPlaceholder(name); | 516 tryMakeMemberPlaceholder(name); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 718 |
| 719 visitBlock(Block node) { | 719 visitBlock(Block node) { |
| 720 for (Node statement in node.statements.nodes) { | 720 for (Node statement in node.statements.nodes) { |
| 721 if (statement is VariableDefinitions) { | 721 if (statement is VariableDefinitions) { |
| 722 makeVarDeclarationTypePlaceholder(statement); | 722 makeVarDeclarationTypePlaceholder(statement); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 node.visitChildren(this); | 725 node.visitChildren(this); |
| 726 } | 726 } |
| 727 } | 727 } |
| OLD | NEW |