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