| 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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 // [target] may be null which means invoking noSuchMethod on | 1378 // [target] may be null which means invoking noSuchMethod on |
| 1379 // super. | 1379 // super. |
| 1380 } else if (Elements.isUnresolved(resolvedReceiver)) { | 1380 } else if (Elements.isUnresolved(resolvedReceiver)) { |
| 1381 return null; | 1381 return null; |
| 1382 } else if (resolvedReceiver.kind === ElementKind.CLASS) { | 1382 } else if (resolvedReceiver.kind === ElementKind.CLASS) { |
| 1383 ClassElement receiverClass = resolvedReceiver; | 1383 ClassElement receiverClass = resolvedReceiver; |
| 1384 receiverClass.ensureResolved(compiler); | 1384 receiverClass.ensureResolved(compiler); |
| 1385 target = receiverClass.buildLocalScope().lookup(name); | 1385 target = receiverClass.buildLocalScope().lookup(name); |
| 1386 if (target === null) { | 1386 if (target === null) { |
| 1387 // TODO(johnniwinther): With the simplified [TreeElements] invariant, | 1387 // TODO(johnniwinther): With the simplified [TreeElements] invariant, |
| 1388 // try to resolve ghost elements if [currentClass] is in the patch | 1388 // try to resolve injected elements if [currentClass] is in the patch |
| 1389 // library of [receiverClass]. | 1389 // library of [receiverClass]. |
| 1390 | 1390 |
| 1391 // TODO(karlklose): this should be reported by the caller of | 1391 // TODO(karlklose): this should be reported by the caller of |
| 1392 // [resolveSend] to select better warning messages for getters and | 1392 // [resolveSend] to select better warning messages for getters and |
| 1393 // setters. | 1393 // setters. |
| 1394 return warnAndCreateErroneousElement(node, name, | 1394 return warnAndCreateErroneousElement(node, name, |
| 1395 MessageKind.METHOD_NOT_FOUND, | 1395 MessageKind.METHOD_NOT_FOUND, |
| 1396 [receiverClass.name, name]); | 1396 [receiverClass.name, name]); |
| 1397 } else if (target.isInstanceMember()) { | 1397 } else if (target.isInstanceMember()) { |
| 1398 error(node, MessageKind.MEMBER_NOT_STATIC, [receiverClass.name, name]); | 1398 error(node, MessageKind.MEMBER_NOT_STATIC, [receiverClass.name, name]); |
| (...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 return result; | 3055 return result; |
| 3056 } | 3056 } |
| 3057 Element lookup(SourceString name) => localLookup(name); | 3057 Element lookup(SourceString name) => localLookup(name); |
| 3058 Element lexicalLookup(SourceString name) => localLookup(name); | 3058 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3059 | 3059 |
| 3060 Element add(Element newElement) { | 3060 Element add(Element newElement) { |
| 3061 throw "Cannot add an element in a patch library scope"; | 3061 throw "Cannot add an element in a patch library scope"; |
| 3062 } | 3062 } |
| 3063 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3063 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3064 } | 3064 } |
| OLD | NEW |