| 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 get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1821 error(node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': node}); | 1821 error(node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': node}); |
| 1822 } | 1822 } |
| 1823 return null; | 1823 return null; |
| 1824 } else if (node.isSuper()) { | 1824 } else if (node.isSuper()) { |
| 1825 if (!inInstanceContext) error(node, MessageKind.NO_SUPER_IN_STATIC); | 1825 if (!inInstanceContext) error(node, MessageKind.NO_SUPER_IN_STATIC); |
| 1826 if ((ElementCategory.SUPER & allowedCategory) == 0) { | 1826 if ((ElementCategory.SUPER & allowedCategory) == 0) { |
| 1827 error(node, MessageKind.INVALID_USE_OF_SUPER); | 1827 error(node, MessageKind.INVALID_USE_OF_SUPER); |
| 1828 } | 1828 } |
| 1829 return null; | 1829 return null; |
| 1830 } else { | 1830 } else { |
| 1831 Element element = lookup(node, node.source); | 1831 Element element = node.source.slowToString() == 'dynamic' |
| 1832 ? compiler.dynamicClass : lookup(node, node.source); |
| 1832 if (element == null) { | 1833 if (element == null) { |
| 1833 if (!inInstanceContext) { | 1834 if (!inInstanceContext) { |
| 1834 element = warnAndCreateErroneousElement( | 1835 element = warnAndCreateErroneousElement( |
| 1835 node, node.source, MessageKind.CANNOT_RESOLVE, | 1836 node, node.source, MessageKind.CANNOT_RESOLVE, |
| 1836 {'name': node}); | 1837 {'name': node}); |
| 1837 compiler.backend.registerThrowNoSuchMethod(mapping); | 1838 compiler.backend.registerThrowNoSuchMethod(mapping); |
| 1838 } | 1839 } |
| 1839 } else if (element.isErroneous()) { | 1840 } else if (element.isErroneous()) { |
| 1840 // Use the erroneous element. | 1841 // Use the erroneous element. |
| 1841 } else { | 1842 } else { |
| (...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4149 return e; | 4150 return e; |
| 4150 } | 4151 } |
| 4151 | 4152 |
| 4152 /// Assumed to be called by [resolveRedirectingFactory]. | 4153 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4153 Element visitReturn(Return node) { | 4154 Element visitReturn(Return node) { |
| 4154 Node expression = node.expression; | 4155 Node expression = node.expression; |
| 4155 return finishConstructorReference(visit(expression), | 4156 return finishConstructorReference(visit(expression), |
| 4156 expression, expression); | 4157 expression, expression); |
| 4157 } | 4158 } |
| 4158 } | 4159 } |
| OLD | NEW |