Chromium Code Reviews| 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 Element operator[](Node node); | 8 Element operator[](Node node); |
| 9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
| 10 Selector getGetterSelectorInComplexSendSet(SendSet node); | 10 Selector getGetterSelectorInComplexSendSet(SendSet node); |
| (...skipping 3539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3550 ElementKind.VARIABLE_LIST, enclosingElement); | 3550 ElementKind.VARIABLE_LIST, enclosingElement); |
| 3551 element = new FieldParameterElementX(name, fieldElement, variables, node); | 3551 element = new FieldParameterElementX(name, fieldElement, variables, node); |
| 3552 } | 3552 } |
| 3553 return element; | 3553 return element; |
| 3554 } | 3554 } |
| 3555 | 3555 |
| 3556 Element visitSendSet(SendSet node) { | 3556 Element visitSendSet(SendSet node) { |
| 3557 Element element; | 3557 Element element; |
| 3558 if (node.receiver != null) { | 3558 if (node.receiver != null) { |
| 3559 element = visitSend(node); | 3559 element = visitSend(node); |
| 3560 } else if (node.selector.asIdentifier() != null) { | 3560 } else if (node.selector.asIdentifier() != null || |
| 3561 node.selector.asFunctionExpression() != null) { | |
| 3561 Element variables = new VariableListElementX.node(currentDefinitions, | 3562 Element variables = new VariableListElementX.node(currentDefinitions, |
| 3562 ElementKind.VARIABLE_LIST, enclosingElement); | 3563 ElementKind.VARIABLE_LIST, enclosingElement); |
| 3563 element = new VariableElementX(node.selector.asIdentifier().source, | 3564 SourceString source = node.selector.asIdentifier() != null? |
|
ahe
2013/03/11 07:34:28
http://www.dartlang.org/articles/style-guide/#do-u
aam-me
2013/03/12 00:00:38
Thank you for pointing this out!
Done.
| |
| 3564 variables, ElementKind.PARAMETER, node); | 3565 node.selector.asIdentifier().source: |
| 3566 node.selector.asFunctionExpression().name.asIdentifier().source; | |
| 3567 element = new VariableElementX(source, variables, | |
| 3568 ElementKind.PARAMETER, node); | |
| 3565 } | 3569 } |
| 3566 // Visit the value. The compile time constant handler will | 3570 // Visit the value. The compile time constant handler will |
| 3567 // make sure it's a compile time constant. | 3571 // make sure it's a compile time constant. |
| 3568 resolveExpression(node.arguments.head); | 3572 resolveExpression(node.arguments.head); |
| 3569 return element; | 3573 return element; |
| 3570 } | 3574 } |
| 3571 | 3575 |
| 3572 Element visitFunctionExpression(FunctionExpression node) { | 3576 Element visitFunctionExpression(FunctionExpression node) { |
| 3573 // This is a function typed parameter. | 3577 // This is a function typed parameter. |
| 3574 // TODO(ahe): Resolve the function type. | 3578 // TODO(ahe): Resolve the function type. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3821 return e; | 3825 return e; |
| 3822 } | 3826 } |
| 3823 | 3827 |
| 3824 /// Assumed to be called by [resolveRedirectingFactory]. | 3828 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3825 Element visitReturn(Return node) { | 3829 Element visitReturn(Return node) { |
| 3826 Node expression = node.expression; | 3830 Node expression = node.expression; |
| 3827 return finishConstructorReference(visit(expression), | 3831 return finishConstructorReference(visit(expression), |
| 3828 expression, expression); | 3832 expression, expression); |
| 3829 } | 3833 } |
| 3830 } | 3834 } |
| OLD | NEW |