| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 } | 7 } |
| 8 | 8 |
| 9 class TreeElementMapping implements TreeElements { | 9 class TreeElementMapping implements TreeElements { |
| 10 Map<Node, Element> map; | 10 Map<Node, Element> map; |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 visit(node.send.argumentsNode); | 646 visit(node.send.argumentsNode); |
| 647 | 647 |
| 648 SourceString constructorName; | 648 SourceString constructorName; |
| 649 Node typeName = node.send.selector.asTypeAnnotation().typeName; | 649 Node typeName = node.send.selector.asTypeAnnotation().typeName; |
| 650 if (typeName.asSend() !== null) { | 650 if (typeName.asSend() !== null) { |
| 651 Identifier receiver = typeName.asSend().receiver.asIdentifier(); | 651 Identifier receiver = typeName.asSend().receiver.asIdentifier(); |
| 652 Identifier selector = typeName.asSend().selector.asIdentifier(); | 652 Identifier selector = typeName.asSend().selector.asIdentifier(); |
| 653 SourceString className = receiver.source; | 653 SourceString className = receiver.source; |
| 654 SourceString name = selector.source; | 654 SourceString name = selector.source; |
| 655 constructorName = new SourceString('$className.$name'); | 655 constructorName = Elements.constructConstructorName(className, name); |
| 656 } else { | 656 } else { |
| 657 constructorName = typeName.asIdentifier().source; | 657 constructorName = typeName.asIdentifier().source; |
| 658 } | 658 } |
| 659 ClassElement cls = resolveTypeRequired(node.send.selector); | 659 ClassElement cls = resolveTypeRequired(node.send.selector); |
| 660 Element constructor = null; | 660 Element constructor = null; |
| 661 if (cls !== null) { | 661 if (cls !== null) { |
| 662 constructor = cls.resolve(compiler).lookupConstructor(constructorName); | 662 constructor = cls.resolve(compiler).lookupConstructor(constructorName); |
| 663 if (constructorName == cls.name | 663 if (constructorName == cls.name |
| 664 && constructor === null | 664 && constructor === null |
| 665 && node.send.argumentsNode.isEmpty()) { | 665 && node.send.argumentsNode.isEmpty()) { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 class TopScope extends Scope { | 1004 class TopScope extends Scope { |
| 1005 Universe universe; | 1005 Universe universe; |
| 1006 | 1006 |
| 1007 TopScope(Universe this.universe) : super(null, null); | 1007 TopScope(Universe this.universe) : super(null, null); |
| 1008 Element lookup(SourceString name) => universe.find(name); | 1008 Element lookup(SourceString name) => universe.find(name); |
| 1009 | 1009 |
| 1010 Element add(Element element) { | 1010 Element add(Element element) { |
| 1011 throw "Cannot add an element in the top scope"; | 1011 throw "Cannot add an element in the top scope"; |
| 1012 } | 1012 } |
| 1013 } | 1013 } |
| OLD | NEW |