| 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 abstract class TreeElements { | 5 abstract class TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 Send send = node.typeName.asSend(); | 977 Send send = node.typeName.asSend(); |
| 978 return resolveTypeNameInternal(scope, typeName, send); | 978 return resolveTypeNameInternal(scope, typeName, send); |
| 979 } | 979 } |
| 980 | 980 |
| 981 Element resolveTypeNameInternal(Scope scope, Identifier typeName, Send send) { | 981 Element resolveTypeNameInternal(Scope scope, Identifier typeName, Send send) { |
| 982 if (send !== null) { | 982 if (send !== null) { |
| 983 typeName = send.selector; | 983 typeName = send.selector; |
| 984 } | 984 } |
| 985 if (typeName.source.stringValue === 'void') { | 985 if (typeName.source.stringValue === 'void') { |
| 986 return compiler.types.voidType.element; | 986 return compiler.types.voidType.element; |
| 987 } else if (typeName.source.stringValue === 'Dynamic') { | 987 } else if ( |
| 988 // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support. |
| 989 typeName.source.stringValue === 'Dynamic' |
| 990 || typeName.source.stringValue === 'dynamic') { |
| 988 return compiler.dynamicClass; | 991 return compiler.dynamicClass; |
| 989 } else if (send !== null) { | 992 } else if (send !== null) { |
| 990 Element e = scope.lookup(send.receiver.asIdentifier().source); | 993 Element e = scope.lookup(send.receiver.asIdentifier().source); |
| 991 if (e !== null && e.kind === ElementKind.PREFIX) { | 994 if (e !== null && e.kind === ElementKind.PREFIX) { |
| 992 // The receiver is a prefix. Lookup in the imported members. | 995 // The receiver is a prefix. Lookup in the imported members. |
| 993 PrefixElement prefix = e; | 996 PrefixElement prefix = e; |
| 994 return prefix.lookupLocalMember(typeName.source); | 997 return prefix.lookupLocalMember(typeName.source); |
| 995 } else if (e !== null && e.kind === ElementKind.CLASS) { | 998 } else if (e !== null && e.kind === ElementKind.CLASS) { |
| 996 // The receiver is the class part of a named constructor. | 999 // The receiver is the class part of a named constructor. |
| 997 return e; | 1000 return e; |
| (...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 return result; | 3142 return result; |
| 3140 } | 3143 } |
| 3141 Element lookup(SourceString name) => localLookup(name); | 3144 Element lookup(SourceString name) => localLookup(name); |
| 3142 Element lexicalLookup(SourceString name) => localLookup(name); | 3145 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3143 | 3146 |
| 3144 Element add(Element newElement) { | 3147 Element add(Element newElement) { |
| 3145 throw "Cannot add an element in a patch library scope"; | 3148 throw "Cannot add an element in a patch library scope"; |
| 3146 } | 3149 } |
| 3147 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3150 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3148 } | 3151 } |
| OLD | NEW |