| 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 resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2400 } | 2400 } |
| 2401 | 2401 |
| 2402 scope = new MethodScope(scope, function); | 2402 scope = new MethodScope(scope, function); |
| 2403 // Put the parameters in scope. | 2403 // Put the parameters in scope. |
| 2404 FunctionSignature functionParameters = function.functionSignature; | 2404 FunctionSignature functionParameters = function.functionSignature; |
| 2405 Link<Node> parameterNodes = (node.parameters == null) | 2405 Link<Node> parameterNodes = (node.parameters == null) |
| 2406 ? const Link<Node>() : node.parameters.nodes; | 2406 ? const Link<Node>() : node.parameters.nodes; |
| 2407 functionParameters.forEachParameter((ParameterElement element) { | 2407 functionParameters.forEachParameter((ParameterElement element) { |
| 2408 // TODO(karlklose): should be a list of [FormalElement]s, but the actual | 2408 // TODO(karlklose): should be a list of [FormalElement]s, but the actual |
| 2409 // implementation uses [Element]. | 2409 // implementation uses [Element]. |
| 2410 Link<Element> optionals = functionParameters.optionalParameters; | 2410 List<Element> optionals = functionParameters.optionalParameters; |
| 2411 if (!optionals.isEmpty && element == optionals.head) { | 2411 if (!optionals.isEmpty && element == optionals.first) { |
| 2412 NodeList nodes = parameterNodes.head; | 2412 NodeList nodes = parameterNodes.head; |
| 2413 parameterNodes = nodes.nodes; | 2413 parameterNodes = nodes.nodes; |
| 2414 } | 2414 } |
| 2415 visit(element.initializer); | 2415 visit(element.initializer); |
| 2416 VariableDefinitions variableDefinitions = parameterNodes.head; | 2416 VariableDefinitions variableDefinitions = parameterNodes.head; |
| 2417 Node parameterNode = variableDefinitions.definitions.nodes.head; | 2417 Node parameterNode = variableDefinitions.definitions.nodes.head; |
| 2418 // Field parameters (this.x) are not visible inside the constructor. The | 2418 // Field parameters (this.x) are not visible inside the constructor. The |
| 2419 // fields they reference are visible, but must be resolved independently. | 2419 // fields they reference are visible, but must be resolved independently. |
| 2420 if (element.isInitializingFormal) { | 2420 if (element.isInitializingFormal) { |
| 2421 registry.useElement(parameterNode, element); | 2421 registry.useElement(parameterNode, element); |
| (...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5161 } | 5161 } |
| 5162 | 5162 |
| 5163 /// The result for the resolution of the `assert` method. | 5163 /// The result for the resolution of the `assert` method. |
| 5164 class AssertResult implements ResolutionResult { | 5164 class AssertResult implements ResolutionResult { |
| 5165 const AssertResult(); | 5165 const AssertResult(); |
| 5166 | 5166 |
| 5167 Element get element => null; | 5167 Element get element => null; |
| 5168 | 5168 |
| 5169 String toString() => 'AssertResult()'; | 5169 String toString() => 'AssertResult()'; |
| 5170 } | 5170 } |
| OLD | NEW |