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 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3340 link = link.tail; | 3340 link = link.tail; |
3341 } | 3341 } |
3342 doApplyMixinTo(element, supertype, resolveType(link.head)); | 3342 doApplyMixinTo(element, supertype, resolveType(link.head)); |
3343 return element.computeType(compiler); | 3343 return element.computeType(compiler); |
3344 } | 3344 } |
3345 | 3345 |
3346 DartType applyMixin(DartType supertype, DartType mixinType, Node node) { | 3346 DartType applyMixin(DartType supertype, DartType mixinType, Node node) { |
3347 String superName = supertype.name.slowToString(); | 3347 String superName = supertype.name.slowToString(); |
3348 String mixinName = mixinType.name.slowToString(); | 3348 String mixinName = mixinType.name.slowToString(); |
3349 ClassElement mixinApplication = new MixinApplicationElementX( | 3349 ClassElement mixinApplication = new MixinApplicationElementX( |
3350 new SourceString("${superName}_${mixinName}"), | 3350 new SourceString("${superName}+${mixinName}"), |
3351 element.getCompilationUnit(), | 3351 element.getCompilationUnit(), |
3352 compiler.getNextFreeClassId(), | 3352 compiler.getNextFreeClassId(), |
3353 node, | 3353 node, |
3354 Modifiers.EMPTY); // TODO(kasperl): Should this be abstract? | 3354 Modifiers.EMPTY); // TODO(kasperl): Should this be abstract? |
3355 doApplyMixinTo(mixinApplication, supertype, mixinType); | 3355 doApplyMixinTo(mixinApplication, supertype, mixinType); |
3356 mixinApplication.resolutionState = STATE_DONE; | 3356 mixinApplication.resolutionState = STATE_DONE; |
3357 mixinApplication.supertypeLoadState = STATE_DONE; | 3357 mixinApplication.supertypeLoadState = STATE_DONE; |
3358 return mixinApplication.computeType(compiler); | 3358 return mixinApplication.computeType(compiler); |
3359 } | 3359 } |
3360 | 3360 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4086 return e; | 4086 return e; |
4087 } | 4087 } |
4088 | 4088 |
4089 /// Assumed to be called by [resolveRedirectingFactory]. | 4089 /// Assumed to be called by [resolveRedirectingFactory]. |
4090 Element visitReturn(Return node) { | 4090 Element visitReturn(Return node) { |
4091 Node expression = node.expression; | 4091 Node expression = node.expression; |
4092 return finishConstructorReference(visit(expression), | 4092 return finishConstructorReference(visit(expression), |
4093 expression, expression); | 4093 expression, expression); |
4094 } | 4094 } |
4095 } | 4095 } |
OLD | NEW |