| 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 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
| 10 | 10 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 element.targetConstructor); | 452 element.targetConstructor); |
| 453 } | 453 } |
| 454 return new TreeElementMapping(element); | 454 return new TreeElementMapping(element); |
| 455 } | 455 } |
| 456 if (element.isPatched) { | 456 if (element.isPatched) { |
| 457 checkMatchingPatchSignatures(element, element.patch); | 457 checkMatchingPatchSignatures(element, element.patch); |
| 458 element = element.patch; | 458 element = element.patch; |
| 459 } | 459 } |
| 460 return compiler.withCurrentElement(element, () { | 460 return compiler.withCurrentElement(element, () { |
| 461 FunctionExpression tree = element.parseNode(compiler); | 461 FunctionExpression tree = element.parseNode(compiler); |
| 462 if (!tree.hasBody()) element.setAbstract(); |
| 462 if (tree.modifiers.isExternal()) { | 463 if (tree.modifiers.isExternal()) { |
| 463 error(tree, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); | 464 error(tree, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
| 464 return null; | 465 return null; |
| 465 } | 466 } |
| 466 if (isConstructor || element.isFactoryConstructor()) { | 467 if (isConstructor || element.isFactoryConstructor()) { |
| 467 if (tree.returnType != null) { | 468 if (tree.returnType != null) { |
| 468 error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); | 469 error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); |
| 469 } | 470 } |
| 470 if (element.modifiers.isConst() && | 471 if (element.modifiers.isConst() && |
| 471 tree.hasBody() && | 472 tree.hasBody() && |
| (...skipping 4256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4728 return finishConstructorReference(visit(expression), | 4729 return finishConstructorReference(visit(expression), |
| 4729 expression, expression); | 4730 expression, expression); |
| 4730 } | 4731 } |
| 4731 } | 4732 } |
| 4732 | 4733 |
| 4733 /// Looks up [name] in [scope] and unwraps the result. | 4734 /// Looks up [name] in [scope] and unwraps the result. |
| 4734 Element lookupInScope(Compiler compiler, Node node, | 4735 Element lookupInScope(Compiler compiler, Node node, |
| 4735 Scope scope, String name) { | 4736 Scope scope, String name) { |
| 4736 return Elements.unwrap(scope.lookup(name), compiler, node); | 4737 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4737 } | 4738 } |
| OLD | NEW |