| 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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1814 Initializers.isConstructorRedirect(initializers.head)) { | 1814 Initializers.isConstructorRedirect(initializers.head)) { |
| 1815 Selector selector = | 1815 Selector selector = |
| 1816 getRedirectingThisOrSuperConstructorSelector(initializers.head); | 1816 getRedirectingThisOrSuperConstructorSelector(initializers.head); |
| 1817 final ClassElement classElement = constructor.getEnclosingClass(); | 1817 final ClassElement classElement = constructor.getEnclosingClass(); |
| 1818 return classElement.lookupConstructor(selector); | 1818 return classElement.lookupConstructor(selector); |
| 1819 } | 1819 } |
| 1820 return null; | 1820 return null; |
| 1821 } | 1821 } |
| 1822 | 1822 |
| 1823 void setupFunction(FunctionExpression node, FunctionElement function) { | 1823 void setupFunction(FunctionExpression node, FunctionElement function) { |
| 1824 Element enclosingElement = function.enclosingElement; |
| 1825 if (node.modifiers.isStatic() && |
| 1826 enclosingElement.kind != ElementKind.CLASS) { |
| 1827 compiler.reportErrorCode(node, MessageKind.ILLEGAL_STATIC); |
| 1828 } |
| 1829 |
| 1824 scope = new MethodScope(scope, function); | 1830 scope = new MethodScope(scope, function); |
| 1825 | |
| 1826 // Put the parameters in scope. | 1831 // Put the parameters in scope. |
| 1827 FunctionSignature functionParameters = | 1832 FunctionSignature functionParameters = |
| 1828 function.computeSignature(compiler); | 1833 function.computeSignature(compiler); |
| 1829 Link<Node> parameterNodes = (node.parameters == null) | 1834 Link<Node> parameterNodes = (node.parameters == null) |
| 1830 ? const Link<Node>() : node.parameters.nodes; | 1835 ? const Link<Node>() : node.parameters.nodes; |
| 1831 functionParameters.forEachParameter((Element element) { | 1836 functionParameters.forEachParameter((Element element) { |
| 1832 if (element == functionParameters.optionalParameters.head) { | 1837 if (element == functionParameters.optionalParameters.head) { |
| 1833 NodeList nodes = parameterNodes.head; | 1838 NodeList nodes = parameterNodes.head; |
| 1834 parameterNodes = nodes.nodes; | 1839 parameterNodes = nodes.nodes; |
| 1835 } | 1840 } |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3820 return e; | 3825 return e; |
| 3821 } | 3826 } |
| 3822 | 3827 |
| 3823 /// Assumed to be called by [resolveRedirectingFactory]. | 3828 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3824 Element visitReturn(Return node) { | 3829 Element visitReturn(Return node) { |
| 3825 Node expression = node.expression; | 3830 Node expression = node.expression; |
| 3826 return finishConstructorReference(visit(expression), | 3831 return finishConstructorReference(visit(expression), |
| 3827 expression, expression); | 3832 expression, expression); |
| 3828 } | 3833 } |
| 3829 } | 3834 } |
| OLD | NEW |