OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 deferred_load; | 5 library deferred_load; |
6 | 6 |
7 import 'constants/expressions.dart'; | 7 import 'constants/expressions.dart'; |
8 | 8 |
9 import 'dart2jslib.dart' show | 9 import 'dart2jslib.dart' show |
10 Backend, | 10 Backend, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 LibraryDependency, | 51 LibraryDependency, |
52 LiteralString, | 52 LiteralString, |
53 LiteralDartString; | 53 LiteralDartString; |
54 | 54 |
55 import 'tree/tree.dart' as ast; | 55 import 'tree/tree.dart' as ast; |
56 | 56 |
57 import 'resolution/resolution.dart' show | 57 import 'resolution/resolution.dart' show |
58 TreeElements, | 58 TreeElements, |
59 AnalyzableElementX; | 59 AnalyzableElementX; |
60 | 60 |
61 import "dart:math" show min; | |
62 | |
63 /// A "hunk" of the program that will be loaded whenever one of its [imports] | 61 /// A "hunk" of the program that will be loaded whenever one of its [imports] |
64 /// are loaded. | 62 /// are loaded. |
65 /// | 63 /// |
66 /// Elements that are only used in one deferred import, is in an OutputUnit with | 64 /// Elements that are only used in one deferred import, is in an OutputUnit with |
67 /// the deferred import as single element in the [imports] set. | 65 /// the deferred import as single element in the [imports] set. |
68 /// | 66 /// |
69 /// Whenever a deferred Element is shared between several deferred imports it is | 67 /// Whenever a deferred Element is shared between several deferred imports it is |
70 /// in an output unit with those imports in the [imports] Set. | 68 /// in an output unit with those imports in the [imports] Set. |
71 /// | 69 /// |
72 /// OutputUnits are equal if their [imports] are equal. | 70 /// OutputUnits are equal if their [imports] are equal. |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 Element maybePrefix = elements[identifier]; | 754 Element maybePrefix = elements[identifier]; |
757 if (maybePrefix != null && maybePrefix.isPrefix) { | 755 if (maybePrefix != null && maybePrefix.isPrefix) { |
758 PrefixElement prefixElement = maybePrefix; | 756 PrefixElement prefixElement = maybePrefix; |
759 if (prefixElement.isDeferred) { | 757 if (prefixElement.isDeferred) { |
760 return prefixElement; | 758 return prefixElement; |
761 } | 759 } |
762 } | 760 } |
763 return null; | 761 return null; |
764 } | 762 } |
765 } | 763 } |
OLD | NEW |