| 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 DartType getType(Node node); | 10 DartType getType(Node node); |
| (...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 compiler.withCurrentElement(constructor, () { | 2420 compiler.withCurrentElement(constructor, () { |
| 2421 FunctionExpression tree = constructor.parseNode(compiler); | 2421 FunctionExpression tree = constructor.parseNode(compiler); |
| 2422 compiler.resolver.resolveConstructorImplementation(constructor, tree); | 2422 compiler.resolver.resolveConstructorImplementation(constructor, tree); |
| 2423 }); | 2423 }); |
| 2424 // [constructor.defaultImplementation] might be the implementation element | 2424 // [constructor.defaultImplementation] might be the implementation element |
| 2425 // and only declaration elements may be registered. | 2425 // and only declaration elements may be registered. |
| 2426 world.registerStaticUse(constructor.defaultImplementation.declaration); | 2426 world.registerStaticUse(constructor.defaultImplementation.declaration); |
| 2427 ClassElement cls = constructor.defaultImplementation.getEnclosingClass(); | 2427 ClassElement cls = constructor.defaultImplementation.getEnclosingClass(); |
| 2428 // [cls] might be the implementation element and only declaration elements | 2428 // [cls] might be the implementation element and only declaration elements |
| 2429 // may be registered. | 2429 // may be registered. |
| 2430 world.registerInstantiatedClass(cls.declaration); | 2430 world.registerInstantiatedType(mapping.getType(node)); |
| 2431 if (cls.isAbstract(compiler)) { | 2431 if (cls.isAbstract(compiler)) { |
| 2432 compiler.backend.registerAbstractClassInstantiation(); | 2432 compiler.backend.registerAbstractClassInstantiation(); |
| 2433 } | 2433 } |
| 2434 // [cls] might be the declaration element and we want to include injected | 2434 // [cls] might be the declaration element and we want to include injected |
| 2435 // members. | 2435 // members. |
| 2436 cls.implementation.forEachInstanceField( | 2436 cls.implementation.forEachInstanceField( |
| 2437 (ClassElement enclosingClass, Element member) { | 2437 (ClassElement enclosingClass, Element member) { |
| 2438 world.addToWorkList(member); | 2438 world.addToWorkList(member); |
| 2439 }, | 2439 }, |
| 2440 includeBackendMembers: false, | 2440 includeBackendMembers: false, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2490 if (inCheckContext) { | 2490 if (inCheckContext) { |
| 2491 compiler.enqueuer.resolution.registerIsCheck(type); | 2491 compiler.enqueuer.resolution.registerIsCheck(type); |
| 2492 } | 2492 } |
| 2493 if (typeRequired || inCheckContext) { | 2493 if (typeRequired || inCheckContext) { |
| 2494 if (type is InterfaceType) { | 2494 if (type is InterfaceType) { |
| 2495 InterfaceType itf = type; | 2495 InterfaceType itf = type; |
| 2496 itf.typeArguments.forEach((DartType argument) { | 2496 itf.typeArguments.forEach((DartType argument) { |
| 2497 analyzeTypeArgument(type, argument); | 2497 analyzeTypeArgument(type, argument); |
| 2498 }); | 2498 }); |
| 2499 } | 2499 } |
| 2500 // TODO(ngeoffray): Also handle cases like: | 2500 // TODO(ngeoffray): Also handle T a (in checked mode). |
| 2501 // 1) a is T | |
| 2502 // 2) T a (in checked mode). | |
| 2503 } | 2501 } |
| 2504 return type; | 2502 return type; |
| 2505 } | 2503 } |
| 2506 | 2504 |
| 2507 visitModifiers(Modifiers node) { | 2505 visitModifiers(Modifiers node) { |
| 2508 // TODO(ngeoffray): Implement this. | 2506 // TODO(ngeoffray): Implement this. |
| 2509 unimplemented(node, 'modifiers'); | 2507 unimplemented(node, 'modifiers'); |
| 2510 } | 2508 } |
| 2511 | 2509 |
| 2512 visitLiteralList(LiteralList node) { | 2510 visitLiteralList(LiteralList node) { |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3718 return e; | 3716 return e; |
| 3719 } | 3717 } |
| 3720 | 3718 |
| 3721 /// Assumed to be called by [resolveRedirectingFactory]. | 3719 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3722 Element visitReturn(Return node) { | 3720 Element visitReturn(Return node) { |
| 3723 Node expression = node.expression; | 3721 Node expression = node.expression; |
| 3724 return finishConstructorReference(visit(expression), | 3722 return finishConstructorReference(visit(expression), |
| 3725 expression, expression); | 3723 expression, expression); |
| 3726 } | 3724 } |
| 3727 } | 3725 } |
| OLD | NEW |