| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /** | 7 /** |
| 8 * [SignatureResolver] resolves function signatures. | 8 * [SignatureResolver] resolves function signatures. |
| 9 */ | 9 */ |
| 10 class SignatureResolver extends MappingVisitor<ParameterElementX> { | 10 class SignatureResolver extends MappingVisitor<ParameterElementX> { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 Element visitSendSet(SendSet node) { | 192 Element visitSendSet(SendSet node) { |
| 193 ParameterElementX element; | 193 ParameterElementX element; |
| 194 if (node.receiver != null) { | 194 if (node.receiver != null) { |
| 195 element = createFieldParameter(node, node.arguments.first); | 195 element = createFieldParameter(node, node.arguments.first); |
| 196 } else if (node.selector.asIdentifier() != null || | 196 } else if (node.selector.asIdentifier() != null || |
| 197 node.selector.asFunctionExpression() != null) { | 197 node.selector.asFunctionExpression() != null) { |
| 198 element = createParameter(getParameterName(node), node.arguments.first); | 198 element = createParameter(getParameterName(node), node.arguments.first); |
| 199 } | 199 } |
| 200 Node defaultValue = node.arguments.head; | 200 Node defaultValue = node.arguments.head; |
| 201 if (!defaultValuesAllowed) { | 201 if (!defaultValuesAllowed) { |
| 202 error(defaultValue, defaultValuesError); | 202 compiler.reportError(defaultValue, defaultValuesError); |
| 203 } | 203 } |
| 204 // Visit the value. The compile time constant handler will | 204 // Visit the value. The compile time constant handler will |
| 205 // make sure it's a compile time constant. | 205 // make sure it's a compile time constant. |
| 206 resolveExpression(defaultValue); | 206 resolveExpression(defaultValue); |
| 207 return element; | 207 return element; |
| 208 } | 208 } |
| 209 | 209 |
| 210 Element visitFunctionExpression(FunctionExpression node) { | 210 Element visitFunctionExpression(FunctionExpression node) { |
| 211 // This is a function typed parameter. | 211 // This is a function typed parameter. |
| 212 Modifiers modifiers = currentDefinitions.modifiers; | 212 Modifiers modifiers = currentDefinitions.modifiers; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (node == null) return; | 358 if (node == null) return; |
| 359 node.accept(resolver); | 359 node.accept(resolver); |
| 360 } | 360 } |
| 361 | 361 |
| 362 // TODO(ahe): This is temporary. | 362 // TODO(ahe): This is temporary. |
| 363 ClassElement get currentClass { | 363 ClassElement get currentClass { |
| 364 return enclosingElement.isMember() | 364 return enclosingElement.isMember() |
| 365 ? enclosingElement.getEnclosingClass() : null; | 365 ? enclosingElement.getEnclosingClass() : null; |
| 366 } | 366 } |
| 367 } | 367 } |
| OLD | NEW |