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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 assert(isConstructor); | 243 assert(isConstructor); |
244 return elements; | 244 return elements; |
245 } | 245 } |
246 if (element.isPatched) { | 246 if (element.isPatched) { |
247 checkMatchingPatchSignatures(element, element.patch); | 247 checkMatchingPatchSignatures(element, element.patch); |
248 element = element.patch; | 248 element = element.patch; |
249 } | 249 } |
250 return compiler.withCurrentElement(element, () { | 250 return compiler.withCurrentElement(element, () { |
251 FunctionExpression tree = element.parseNode(compiler); | 251 FunctionExpression tree = element.parseNode(compiler); |
252 if (tree.modifiers.isExternal()) { | 252 if (tree.modifiers.isExternal()) { |
253 error(tree, MessageKind.EXTERNAL_WITHOUT_IMPLEMENTATION); | 253 error(tree, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
254 return; | 254 return; |
255 } | 255 } |
256 if (isConstructor) { | 256 if (isConstructor) { |
257 if (tree.returnType != null) { | 257 if (tree.returnType != null) { |
258 error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); | 258 error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); |
259 } | 259 } |
260 resolveConstructorImplementation(element, tree); | 260 resolveConstructorImplementation(element, tree); |
261 } | 261 } |
262 ResolverVisitor visitor = visitorFor(element); | 262 ResolverVisitor visitor = visitorFor(element); |
263 visitor.useElement(tree, element); | 263 visitor.useElement(tree, element); |
(...skipping 3385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3649 return e; | 3649 return e; |
3650 } | 3650 } |
3651 | 3651 |
3652 /// Assumed to be called by [resolveRedirectingFactory]. | 3652 /// Assumed to be called by [resolveRedirectingFactory]. |
3653 Element visitReturn(Return node) { | 3653 Element visitReturn(Return node) { |
3654 Node expression = node.expression; | 3654 Node expression = node.expression; |
3655 return finishConstructorReference(visit(expression), | 3655 return finishConstructorReference(visit(expression), |
3656 expression, expression); | 3656 expression, expression); |
3657 } | 3657 } |
3658 } | 3658 } |
OLD | NEW |