| 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 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3145 Node expression = node.expression; | 3145 Node expression = node.expression; |
| 3146 if (expression != null) { | 3146 if (expression != null) { |
| 3147 if (enclosingElement.isGenerativeConstructor) { | 3147 if (enclosingElement.isGenerativeConstructor) { |
| 3148 // It is a compile-time error if a return statement of the form | 3148 // It is a compile-time error if a return statement of the form |
| 3149 // `return e;` appears in a generative constructor. (Dart Language | 3149 // `return e;` appears in a generative constructor. (Dart Language |
| 3150 // Specification 13.12.) | 3150 // Specification 13.12.) |
| 3151 compiler.reportError(expression, | 3151 compiler.reportError(expression, |
| 3152 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR); | 3152 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR); |
| 3153 } else if (!node.isArrowBody && currentAsyncMarker.isYielding) { | 3153 } else if (!node.isArrowBody && currentAsyncMarker.isYielding) { |
| 3154 compiler.reportError( | 3154 compiler.reportError( |
| 3155 node, | 3155 node, |
| 3156 MessageKind.RETURN_IN_GENERATOR, | 3156 MessageKind.RETURN_IN_GENERATOR, |
| 3157 {'modifier': currentAsyncMarker}); | 3157 {'modifier': currentAsyncMarker}); |
| 3158 } | 3158 } |
| 3159 } | 3159 } |
| 3160 visit(node.expression); | 3160 visit(node.expression); |
| 3161 } | 3161 } |
| 3162 | 3162 |
| 3163 visitYield(Yield node) { | 3163 visitYield(Yield node) { |
| 3164 compiler.streamClass.ensureResolved(compiler); | 3164 compiler.streamClass.ensureResolved(compiler); |
| 3165 compiler.iterableClass.ensureResolved(compiler); | 3165 compiler.iterableClass.ensureResolved(compiler); |
| 3166 visit(node.expression); | 3166 visit(node.expression); |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4420 mixinThisType.typeArguments); | 4420 mixinThisType.typeArguments); |
| 4421 } | 4421 } |
| 4422 | 4422 |
| 4423 bool isDefaultConstructor(FunctionElement constructor) { | 4423 bool isDefaultConstructor(FunctionElement constructor) { |
| 4424 return constructor.name == '' && | 4424 return constructor.name == '' && |
| 4425 constructor.computeSignature(compiler).parameterCount == 0; | 4425 constructor.computeSignature(compiler).parameterCount == 0; |
| 4426 } | 4426 } |
| 4427 | 4427 |
| 4428 FunctionElement createForwardingConstructor(ConstructorElement target, | 4428 FunctionElement createForwardingConstructor(ConstructorElement target, |
| 4429 ClassElement enclosing) { | 4429 ClassElement enclosing) { |
| 4430 return new SynthesizedConstructorElementX( | 4430 return new SynthesizedConstructorElementX.notForDefault( |
| 4431 target.name, target, enclosing, false); | 4431 target.name, target, enclosing); |
| 4432 } | 4432 } |
| 4433 | 4433 |
| 4434 void doApplyMixinTo(MixinApplicationElementX mixinApplication, | 4434 void doApplyMixinTo(MixinApplicationElementX mixinApplication, |
| 4435 DartType supertype, | 4435 DartType supertype, |
| 4436 DartType mixinType) { | 4436 DartType mixinType) { |
| 4437 Node node = mixinApplication.parseNode(compiler); | 4437 Node node = mixinApplication.parseNode(compiler); |
| 4438 | 4438 |
| 4439 if (mixinApplication.supertype != null) { | 4439 if (mixinApplication.supertype != null) { |
| 4440 // [supertype] is not null if there was a cycle. | 4440 // [supertype] is not null if there was a cycle. |
| 4441 assert(invariant(node, compiler.compilationFailed)); | 4441 assert(invariant(node, compiler.compilationFailed)); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5066 } | 5066 } |
| 5067 | 5067 |
| 5068 /// The result for the resolution of the `assert` method. | 5068 /// The result for the resolution of the `assert` method. |
| 5069 class AssertResult implements ResolutionResult { | 5069 class AssertResult implements ResolutionResult { |
| 5070 const AssertResult(); | 5070 const AssertResult(); |
| 5071 | 5071 |
| 5072 Element get element => null; | 5072 Element get element => null; |
| 5073 | 5073 |
| 5074 String toString() => 'AssertResult()'; | 5074 String toString() => 'AssertResult()'; |
| 5075 } | 5075 } |
| OLD | NEW |