| 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 class Universe { | 5 class Universe { |
| 6 Map<Element, String> generatedCode; | 6 Map<Element, String> generatedCode; |
| 7 Map<Element, String> generatedBailoutCode; | 7 Map<Element, String> generatedBailoutCode; |
| 8 final Set<ClassElement> instantiatedClasses; | 8 final Set<ClassElement> instantiatedClasses; |
| 9 final Set<SourceString> instantiatedClassInstanceFields; | 9 final Set<SourceString> instantiatedClassInstanceFields; |
| 10 final Set<FunctionElement> staticFunctionsNeedingGetter; | 10 final Set<FunctionElement> staticFunctionsNeedingGetter; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // class A { | 318 // class A { |
| 319 // get foo() => () => 42; | 319 // get foo() => () => 42; |
| 320 // bar() => foo(); // The call to 'foo' is a typed selector. | 320 // bar() => foo(); // The call to 'foo' is a typed selector. |
| 321 // } | 321 // } |
| 322 ClassElement other = element.enclosingElement; | 322 ClassElement other = element.enclosingElement; |
| 323 if (other.superclass === compiler.closureClass) { | 323 if (other.superclass === compiler.closureClass) { |
| 324 return super.applies(element, compiler); | 324 return super.applies(element, compiler); |
| 325 } | 325 } |
| 326 | 326 |
| 327 ClassElement self = receiverType.element; | 327 ClassElement self = receiverType.element; |
| 328 if (other.implementsInterface(self)) { | 328 // TODO(ngeoffray): tree-shake on interfaces. |
| 329 if (self.isInterface() || other.isSubclassOf(self)) { |
| 329 return super.applies(element, compiler); | 330 return super.applies(element, compiler); |
| 330 } | 331 } |
| 331 | 332 |
| 332 if (!self.isInterface() && self.isSubclassOf(other)) { | 333 if (!self.isInterface() && self.isSubclassOf(other)) { |
| 333 // Resolve an invocation of [element.name] on [self]. If it | 334 // Resolve an invocation of [element.name] on [self]. If it |
| 334 // is found, this selector is a candidate. | 335 // is found, this selector is a candidate. |
| 335 return hasElementIn(self, element) && super.applies(element, compiler); | 336 return hasElementIn(self, element) && super.applies(element, compiler); |
| 336 } | 337 } |
| 337 | 338 |
| 338 return false; | 339 return false; |
| 339 } | 340 } |
| 340 | 341 |
| 341 bool operator ==(other) { | 342 bool operator ==(other) { |
| 342 if (other is !TypedSelector) return false; | 343 if (other is !TypedSelector) return false; |
| 343 if (other.receiverType !== receiverType) return false; | 344 if (other.receiverType !== receiverType) return false; |
| 344 return super == other; | 345 return super == other; |
| 345 } | 346 } |
| 346 } | 347 } |
| OLD | NEW |