| 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 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 return null; | 2010 return null; |
| 2011 } | 2011 } |
| 2012 if (currentClass.supertype == null) { | 2012 if (currentClass.supertype == null) { |
| 2013 // This is just to guard against internal errors, so no need | 2013 // This is just to guard against internal errors, so no need |
| 2014 // for a real error message. | 2014 // for a real error message. |
| 2015 error(node.receiver, MessageKind.GENERIC, | 2015 error(node.receiver, MessageKind.GENERIC, |
| 2016 {'text': "Object has no superclass"}); | 2016 {'text': "Object has no superclass"}); |
| 2017 } | 2017 } |
| 2018 // TODO(johnniwinther): Ensure correct behavior if currentClass is a | 2018 // TODO(johnniwinther): Ensure correct behavior if currentClass is a |
| 2019 // patch. | 2019 // patch. |
| 2020 target = currentClass.lookupSuperSelector(selector); | 2020 target = currentClass.lookupSuperSelector(selector, compiler); |
| 2021 // [target] may be null which means invoking noSuchMethod on | 2021 // [target] may be null which means invoking noSuchMethod on |
| 2022 // super. | 2022 // super. |
| 2023 if (target == null) { | 2023 if (target == null) { |
| 2024 target = warnAndCreateErroneousElement( | 2024 target = warnAndCreateErroneousElement( |
| 2025 node, name, MessageKind.NO_SUCH_SUPER_MEMBER, | 2025 node, name, MessageKind.NO_SUCH_SUPER_MEMBER, |
| 2026 {'className': currentClass, 'memberName': name}); | 2026 {'className': currentClass, 'memberName': name}); |
| 2027 // We still need to register the invocation, because we might | 2027 // We still need to register the invocation, because we might |
| 2028 // call [:super.noSuchMethod:] which calls | 2028 // call [:super.noSuchMethod:] which calls |
| 2029 // [JSInvocationMirror._invokeOn]. | 2029 // [JSInvocationMirror._invokeOn]. |
| 2030 world.registerDynamicInvocation(selector.name, selector); | 2030 world.registerDynamicInvocation(selector.name, selector); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2343 Selector getterSelector; | 2343 Selector getterSelector; |
| 2344 if (selector.isSetter()) { | 2344 if (selector.isSetter()) { |
| 2345 getterSelector = new Selector.getterFrom(selector); | 2345 getterSelector = new Selector.getterFrom(selector); |
| 2346 } else { | 2346 } else { |
| 2347 assert(selector.isIndexSet()); | 2347 assert(selector.isIndexSet()); |
| 2348 getterSelector = new Selector.index(); | 2348 getterSelector = new Selector.index(); |
| 2349 } | 2349 } |
| 2350 registerSend(getterSelector, getter); | 2350 registerSend(getterSelector, getter); |
| 2351 mapping.setGetterSelectorInComplexSendSet(node, getterSelector); | 2351 mapping.setGetterSelectorInComplexSendSet(node, getterSelector); |
| 2352 if (node.isSuperCall) { | 2352 if (node.isSuperCall) { |
| 2353 getter = currentClass.lookupSuperSelector(getterSelector); | 2353 getter = currentClass.lookupSuperSelector(getterSelector, compiler); |
| 2354 if (getter == null) { | 2354 if (getter == null) { |
| 2355 target = warnAndCreateErroneousElement( | 2355 target = warnAndCreateErroneousElement( |
| 2356 node, selector.name, MessageKind.NO_SUCH_SUPER_MEMBER, | 2356 node, selector.name, MessageKind.NO_SUCH_SUPER_MEMBER, |
| 2357 {'className': currentClass, 'memberName': selector.name}); | 2357 {'className': currentClass, 'memberName': selector.name}); |
| 2358 compiler.backend.registerSuperNoSuchMethod(mapping); | 2358 compiler.backend.registerSuperNoSuchMethod(mapping); |
| 2359 } | 2359 } |
| 2360 } | 2360 } |
| 2361 useElement(node.selector, getter); | 2361 useElement(node.selector, getter); |
| 2362 | 2362 |
| 2363 // Make sure we include the + and - operators if we are using | 2363 // Make sure we include the + and - operators if we are using |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3960 return e; | 3960 return e; |
| 3961 } | 3961 } |
| 3962 | 3962 |
| 3963 /// Assumed to be called by [resolveRedirectingFactory]. | 3963 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3964 Element visitReturn(Return node) { | 3964 Element visitReturn(Return node) { |
| 3965 Node expression = node.expression; | 3965 Node expression = node.expression; |
| 3966 return finishConstructorReference(visit(expression), | 3966 return finishConstructorReference(visit(expression), |
| 3967 expression, expression); | 3967 expression, expression); |
| 3968 } | 3968 } |
| 3969 } | 3969 } |
| OLD | NEW |