| 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 library dart2js.world; | 5 part of dart2js; |
| 6 | |
| 7 import 'closure.dart' show | |
| 8 SynthesizedCallMethodElementX; | |
| 9 import 'dart2jslib.dart' show | |
| 10 invariant, | |
| 11 Backend, | |
| 12 Compiler, | |
| 13 Registry; | |
| 14 import 'dart_types.dart'; | |
| 15 import 'elements/elements.dart' show | |
| 16 ClassElement, | |
| 17 Element, | |
| 18 FunctionElement, | |
| 19 MixinApplicationElement, | |
| 20 TypedefElement, | |
| 21 VariableElement; | |
| 22 import 'ordered_typeset.dart'; | |
| 23 import 'types/types.dart' as ti; | |
| 24 import 'universe/universe.dart' show | |
| 25 FunctionSet, | |
| 26 Selector, | |
| 27 SideEffects; | |
| 28 import 'universe/class_set.dart'; | |
| 29 import 'util/util.dart' show | |
| 30 Link; | |
| 31 | 6 |
| 32 abstract class ClassWorld { | 7 abstract class ClassWorld { |
| 33 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. | 8 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. |
| 34 Backend get backend; | 9 Backend get backend; |
| 35 | 10 |
| 36 // TODO(johnniwinther): Remove the need for this getter. | 11 // TODO(johnniwinther): Remove the need for this getter. |
| 37 @deprecated | 12 @deprecated |
| 38 Compiler get compiler; | 13 Compiler get compiler; |
| 39 | 14 |
| 40 /// The [ClassElement] for the [Object] class defined in 'dart:core'. | 15 /// The [ClassElement] for the [Object] class defined in 'dart:core'. |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 functionsThatMightBePassedToApply.add(element); | 544 functionsThatMightBePassedToApply.add(element); |
| 570 } | 545 } |
| 571 | 546 |
| 572 bool getMightBePassedToApply(Element element) { | 547 bool getMightBePassedToApply(Element element) { |
| 573 // We have to check whether the element we look at was created after | 548 // We have to check whether the element we look at was created after |
| 574 // type inference ran. This is currently only the case for the call | 549 // type inference ran. This is currently only the case for the call |
| 575 // method of function classes that were generated for function | 550 // method of function classes that were generated for function |
| 576 // expressions. In such a case, we have to look at the original | 551 // expressions. In such a case, we have to look at the original |
| 577 // function expressions's element. | 552 // function expressions's element. |
| 578 // TODO(herhut): Generate classes for function expressions earlier. | 553 // TODO(herhut): Generate classes for function expressions earlier. |
| 579 if (element is SynthesizedCallMethodElementX) { | 554 if (element is closureMapping.SynthesizedCallMethodElementX) { |
| 580 return getMightBePassedToApply(element.expression); | 555 return getMightBePassedToApply(element.expression); |
| 581 } | 556 } |
| 582 return functionsThatMightBePassedToApply.contains(element); | 557 return functionsThatMightBePassedToApply.contains(element); |
| 583 } | 558 } |
| 584 | 559 |
| 585 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 560 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
| 586 } | 561 } |
| OLD | NEW |