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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1630 // When the element is a field, we are actually resolving its | 1630 // When the element is a field, we are actually resolving its |
1631 // initial value, which should not have access to instance | 1631 // initial value, which should not have access to instance |
1632 // fields. | 1632 // fields. |
1633 inInstanceContext = (element.isInstanceMember() && !element.isField()) | 1633 inInstanceContext = (element.isInstanceMember() && !element.isField()) |
1634 || element.isGenerativeConstructor(), | 1634 || element.isGenerativeConstructor(), |
1635 this.currentClass = element.isMember() ? element.getEnclosingClass() | 1635 this.currentClass = element.isMember() ? element.getEnclosingClass() |
1636 : null, | 1636 : null, |
1637 this.statementScope = new StatementScope(), | 1637 this.statementScope = new StatementScope(), |
1638 typeResolver = new TypeResolver(compiler), | 1638 typeResolver = new TypeResolver(compiler), |
1639 scope = element.buildScope(), | 1639 scope = element.buildScope(), |
1640 inCheckContext = compiler.enableTypeAssertions, | 1640 inCheckContext = compiler.enableTypeAssertions && |
1641 !element.enclosingElement.isTypedef(), | |
ngeoffray
2013/03/01 08:36:00
Please add a comment.
| |
1641 inCatchBlock = false, | 1642 inCatchBlock = false, |
1642 super(compiler); | 1643 super(compiler); |
1643 | 1644 |
1644 ResolutionEnqueuer get world => compiler.enqueuer.resolution; | 1645 ResolutionEnqueuer get world => compiler.enqueuer.resolution; |
1645 | 1646 |
1646 Element lookup(Node node, SourceString name) { | 1647 Element lookup(Node node, SourceString name) { |
1647 Element result = scope.lookup(name); | 1648 Element result = scope.lookup(name); |
1648 if (!Elements.isUnresolved(result)) { | 1649 if (!Elements.isUnresolved(result)) { |
1649 if (!inInstanceContext && result.isInstanceMember()) { | 1650 if (!inInstanceContext && result.isInstanceMember()) { |
1650 compiler.reportErrorCode( | 1651 compiler.reportErrorCode( |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3801 return e; | 3802 return e; |
3802 } | 3803 } |
3803 | 3804 |
3804 /// Assumed to be called by [resolveRedirectingFactory]. | 3805 /// Assumed to be called by [resolveRedirectingFactory]. |
3805 Element visitReturn(Return node) { | 3806 Element visitReturn(Return node) { |
3806 Node expression = node.expression; | 3807 Node expression = node.expression; |
3807 return finishConstructorReference(visit(expression), | 3808 return finishConstructorReference(visit(expression), |
3808 expression, expression); | 3809 expression, expression); |
3809 } | 3810 } |
3810 } | 3811 } |
OLD | NEW |