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 // The type annotations on a typedef do not imply type checks. | |
ngeoffray
2013/03/01 11:18:15
Please also reference the bug you just filed.
karlklose
2013/03/01 11:22:57
Done.
| |
1640 inCheckContext = compiler.enableTypeAssertions && | 1641 inCheckContext = compiler.enableTypeAssertions && |
1642 !element.isTypedef() && | |
1641 (element.enclosingElement == null || | 1643 (element.enclosingElement == null || |
1642 !element.enclosingElement.isTypedef()), | 1644 !element.enclosingElement.isTypedef()), |
1643 inCatchBlock = false, | 1645 inCatchBlock = false, |
1644 super(compiler); | 1646 super(compiler); |
1645 | 1647 |
1646 ResolutionEnqueuer get world => compiler.enqueuer.resolution; | 1648 ResolutionEnqueuer get world => compiler.enqueuer.resolution; |
1647 | 1649 |
1648 Element lookup(Node node, SourceString name) { | 1650 Element lookup(Node node, SourceString name) { |
1649 Element result = scope.lookup(name); | 1651 Element result = scope.lookup(name); |
1650 if (!Elements.isUnresolved(result)) { | 1652 if (!Elements.isUnresolved(result)) { |
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3800 return e; | 3802 return e; |
3801 } | 3803 } |
3802 | 3804 |
3803 /// Assumed to be called by [resolveRedirectingFactory]. | 3805 /// Assumed to be called by [resolveRedirectingFactory]. |
3804 Element visitReturn(Return node) { | 3806 Element visitReturn(Return node) { |
3805 Node expression = node.expression; | 3807 Node expression = node.expression; |
3806 return finishConstructorReference(visit(expression), | 3808 return finishConstructorReference(visit(expression), |
3807 expression, expression); | 3809 expression, expression); |
3808 } | 3810 } |
3809 } | 3811 } |
OLD | NEW |