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 libraries; | 5 library libraries; |
6 | 6 |
7 /** | 7 /** |
8 * A bit flag used by [LibraryInfo] indicating that a library is used by dart2js | 8 * A bit flag used by [LibraryInfo] indicating that a library is used by dart2js |
9 */ | 9 */ |
10 const int DART2JS_PLATFORM = 1; | 10 const int DART2JS_PLATFORM = 1; |
11 | 11 |
12 /** | 12 /** |
13 * A bit flag used by [LibraryInfo] indicating that a library is used by the VM | 13 * A bit flag used by [LibraryInfo] indicating that a library is used by the VM |
14 */ | 14 */ |
15 const int VM_PLATFORM = 2; | 15 const int VM_PLATFORM = 2; |
16 | 16 |
17 /// The contexts that a library can be used from. | 17 /// The contexts that a library can be used from. |
18 enum Category { | 18 enum Category { |
19 /// Indicates that a library can be used in a browser context. | 19 /// Indicates that a library can be used in a browser context. |
20 client, | 20 client, |
| 21 |
21 /// Indicates that a library can be used in a command line context. | 22 /// Indicates that a library can be used in a command line context. |
22 server, | 23 server, |
| 24 |
23 /// Indicates that a library can be used from embedded devices. | 25 /// Indicates that a library can be used from embedded devices. |
24 embedded | 26 embedded |
25 } | 27 } |
26 | 28 |
27 Category parseCategory(String name) { | 29 Category parseCategory(String name) { |
28 switch (name) { | 30 switch (name) { |
29 case "Client": return Category.client; | 31 case "Client": |
30 case "Server": return Category.server; | 32 return Category.client; |
31 case "Embedded": return Category.embedded; | 33 case "Server": |
| 34 return Category.server; |
| 35 case "Embedded": |
| 36 return Category.embedded; |
32 } | 37 } |
33 return null; | 38 return null; |
34 } | 39 } |
35 | 40 |
36 /// Mapping of "dart:" library name (e.g. "core") to information about that | 41 /// Mapping of "dart:" library name (e.g. "core") to information about that |
37 /// library. | 42 /// library. |
38 const Map<String, LibraryInfo> libraries = const { | 43 const Map<String, LibraryInfo> libraries = const { |
39 "async": const LibraryInfo( | 44 "async": const LibraryInfo("async/async.dart", |
40 "async/async.dart", | |
41 categories: "Client,Server", | 45 categories: "Client,Server", |
42 maturity: Maturity.STABLE, | 46 maturity: Maturity.STABLE, |
43 dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"), | 47 dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"), |
44 | 48 "collection": const LibraryInfo("collection/collection.dart", |
45 "collection": const LibraryInfo( | |
46 "collection/collection.dart", | |
47 categories: "Client,Server,Embedded", | 49 categories: "Client,Server,Embedded", |
48 maturity: Maturity.STABLE, | 50 maturity: Maturity.STABLE, |
49 dart2jsPatchPath: "_internal/js_runtime/lib/collection_patch.dart"), | 51 dart2jsPatchPath: "_internal/js_runtime/lib/collection_patch.dart"), |
50 | 52 "convert": const LibraryInfo("convert/convert.dart", |
51 "convert": const LibraryInfo( | |
52 "convert/convert.dart", | |
53 categories: "Client,Server", | 53 categories: "Client,Server", |
54 maturity: Maturity.STABLE, | 54 maturity: Maturity.STABLE, |
55 dart2jsPatchPath: "_internal/js_runtime/lib/convert_patch.dart"), | 55 dart2jsPatchPath: "_internal/js_runtime/lib/convert_patch.dart"), |
56 | 56 "core": const LibraryInfo("core/core.dart", |
57 "core": const LibraryInfo( | |
58 "core/core.dart", | |
59 categories: "Client,Server,Embedded", | 57 categories: "Client,Server,Embedded", |
60 maturity: Maturity.STABLE, | 58 maturity: Maturity.STABLE, |
61 dart2jsPatchPath: "_internal/js_runtime/lib/core_patch.dart"), | 59 dart2jsPatchPath: "_internal/js_runtime/lib/core_patch.dart"), |
62 | 60 "developer": const LibraryInfo("developer/developer.dart", |
63 "developer": const LibraryInfo( | |
64 "developer/developer.dart", | |
65 categories: "Client,Server,Embedded", | 61 categories: "Client,Server,Embedded", |
66 maturity: Maturity.UNSTABLE, | 62 maturity: Maturity.UNSTABLE, |
67 dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"), | 63 dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"), |
68 | 64 "html": const LibraryInfo("html/dartium/html_dartium.dart", |
69 "html": const LibraryInfo( | |
70 "html/dartium/html_dartium.dart", | |
71 categories: "Client", | 65 categories: "Client", |
72 maturity: Maturity.WEB_STABLE, | 66 maturity: Maturity.WEB_STABLE, |
73 dart2jsPath: "html/dart2js/html_dart2js.dart"), | 67 dart2jsPath: "html/dart2js/html_dart2js.dart"), |
74 | 68 "html_common": const LibraryInfo("html/html_common/html_common.dart", |
75 "html_common": const LibraryInfo( | |
76 "html/html_common/html_common.dart", | |
77 categories: "Client", | 69 categories: "Client", |
78 maturity: Maturity.WEB_STABLE, | 70 maturity: Maturity.WEB_STABLE, |
79 dart2jsPath: "html/html_common/html_common_dart2js.dart", | 71 dart2jsPath: "html/html_common/html_common_dart2js.dart", |
80 documented: false, | 72 documented: false, |
81 implementation: true), | 73 implementation: true), |
82 | 74 "indexed_db": const LibraryInfo("indexed_db/dartium/indexed_db_dartium.dart", |
83 "indexed_db": const LibraryInfo( | |
84 "indexed_db/dartium/indexed_db_dartium.dart", | |
85 categories: "Client", | 75 categories: "Client", |
86 maturity: Maturity.WEB_STABLE, | 76 maturity: Maturity.WEB_STABLE, |
87 dart2jsPath: "indexed_db/dart2js/indexed_db_dart2js.dart"), | 77 dart2jsPath: "indexed_db/dart2js/indexed_db_dart2js.dart"), |
88 | 78 "io": const LibraryInfo("io/io.dart", |
89 "io": const LibraryInfo( | |
90 "io/io.dart", | |
91 categories: "Server", | 79 categories: "Server", |
92 dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"), | 80 dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"), |
93 | 81 "isolate": const LibraryInfo("isolate/isolate.dart", |
94 "isolate": const LibraryInfo( | |
95 "isolate/isolate.dart", | |
96 categories: "Client,Server", | 82 categories: "Client,Server", |
97 maturity: Maturity.STABLE, | 83 maturity: Maturity.STABLE, |
98 dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"), | 84 dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"), |
99 | 85 "js": const LibraryInfo("js/dartium/js_dartium.dart", |
100 "js": const LibraryInfo( | |
101 "js/dartium/js_dartium.dart", | |
102 categories: "Client", | 86 categories: "Client", |
103 maturity: Maturity.STABLE, | 87 maturity: Maturity.STABLE, |
104 dart2jsPath: "js/dart2js/js_dart2js.dart"), | 88 dart2jsPath: "js/dart2js/js_dart2js.dart"), |
105 | 89 "js_util": const LibraryInfo("js_util/dartium/js_util_dartium.dart", |
106 "js_util": const LibraryInfo( | |
107 "js_util/dartium/js_util_dartium.dart", | |
108 categories: "Client", | 90 categories: "Client", |
109 maturity: Maturity.STABLE, | 91 maturity: Maturity.STABLE, |
110 dart2jsPath: "js_util/dart2js/js_util_dart2js.dart"), | 92 dart2jsPath: "js_util/dart2js/js_util_dart2js.dart"), |
111 | 93 "math": const LibraryInfo("math/math.dart", |
112 "math": const LibraryInfo( | |
113 "math/math.dart", | |
114 categories: "Client,Server,Embedded", | 94 categories: "Client,Server,Embedded", |
115 maturity: Maturity.STABLE, | 95 maturity: Maturity.STABLE, |
116 dart2jsPatchPath: "_internal/js_runtime/lib/math_patch.dart"), | 96 dart2jsPatchPath: "_internal/js_runtime/lib/math_patch.dart"), |
117 | 97 "mirrors": const LibraryInfo("mirrors/mirrors.dart", |
118 "mirrors": const LibraryInfo( | |
119 "mirrors/mirrors.dart", | |
120 categories: "Client,Server", | 98 categories: "Client,Server", |
121 maturity: Maturity.UNSTABLE, | 99 maturity: Maturity.UNSTABLE, |
122 dart2jsPatchPath: "_internal/js_runtime/lib/mirrors_patch.dart"), | 100 dart2jsPatchPath: "_internal/js_runtime/lib/mirrors_patch.dart"), |
123 | 101 "nativewrappers": const LibraryInfo("html/dartium/nativewrappers.dart", |
124 "nativewrappers": const LibraryInfo( | |
125 "html/dartium/nativewrappers.dart", | |
126 categories: "Client", | 102 categories: "Client", |
127 implementation: true, | 103 implementation: true, |
128 documented: false, | 104 documented: false, |
129 dart2jsPath: "html/dart2js/nativewrappers.dart"), | 105 dart2jsPath: "html/dart2js/nativewrappers.dart"), |
130 | 106 "typed_data": const LibraryInfo("typed_data/typed_data.dart", |
131 "typed_data": const LibraryInfo( | |
132 "typed_data/typed_data.dart", | |
133 categories: "Client,Server,Embedded", | 107 categories: "Client,Server,Embedded", |
134 maturity: Maturity.STABLE, | 108 maturity: Maturity.STABLE, |
135 dart2jsPatchPath: "_internal/js_runtime/lib/typed_data_patch.dart"), | 109 dart2jsPatchPath: "_internal/js_runtime/lib/typed_data_patch.dart"), |
136 | |
137 "_native_typed_data": const LibraryInfo( | 110 "_native_typed_data": const LibraryInfo( |
138 "_internal/js_runtime/lib/native_typed_data.dart", | 111 "_internal/js_runtime/lib/native_typed_data.dart", |
139 categories: "", | 112 categories: "", |
140 implementation: true, | 113 implementation: true, |
141 documented: false, | 114 documented: false, |
142 platforms: DART2JS_PLATFORM), | 115 platforms: DART2JS_PLATFORM), |
143 | 116 "svg": const LibraryInfo("svg/dartium/svg_dartium.dart", |
144 "svg": const LibraryInfo( | |
145 "svg/dartium/svg_dartium.dart", | |
146 categories: "Client", | 117 categories: "Client", |
147 maturity: Maturity.WEB_STABLE, | 118 maturity: Maturity.WEB_STABLE, |
148 dart2jsPath: "svg/dart2js/svg_dart2js.dart"), | 119 dart2jsPath: "svg/dart2js/svg_dart2js.dart"), |
149 | 120 "web_audio": const LibraryInfo("web_audio/dartium/web_audio_dartium.dart", |
150 "web_audio": const LibraryInfo( | |
151 "web_audio/dartium/web_audio_dartium.dart", | |
152 categories: "Client", | 121 categories: "Client", |
153 maturity: Maturity.WEB_STABLE, | 122 maturity: Maturity.WEB_STABLE, |
154 dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"), | 123 dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"), |
155 | 124 "web_gl": const LibraryInfo("web_gl/dartium/web_gl_dartium.dart", |
156 "web_gl": const LibraryInfo( | |
157 "web_gl/dartium/web_gl_dartium.dart", | |
158 categories: "Client", | 125 categories: "Client", |
159 maturity: Maturity.WEB_STABLE, | 126 maturity: Maturity.WEB_STABLE, |
160 dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"), | 127 dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"), |
161 | 128 "web_sql": const LibraryInfo("web_sql/dartium/web_sql_dartium.dart", |
162 "web_sql": const LibraryInfo( | |
163 "web_sql/dartium/web_sql_dartium.dart", | |
164 categories: "Client", | 129 categories: "Client", |
165 maturity: Maturity.WEB_STABLE, | 130 maturity: Maturity.WEB_STABLE, |
166 dart2jsPath: "web_sql/dart2js/web_sql_dart2js.dart"), | 131 dart2jsPath: "web_sql/dart2js/web_sql_dart2js.dart"), |
167 | 132 "_internal": const LibraryInfo("internal/internal.dart", |
168 "_internal": const LibraryInfo( | |
169 "internal/internal.dart", | |
170 categories: "", | 133 categories: "", |
171 documented: false, | 134 documented: false, |
172 dart2jsPatchPath: "_internal/js_runtime/lib/internal_patch.dart"), | 135 dart2jsPatchPath: "_internal/js_runtime/lib/internal_patch.dart"), |
173 | 136 "_js_helper": const LibraryInfo("_internal/js_runtime/lib/js_helper.dart", |
174 "_js_helper": const LibraryInfo( | 137 categories: "", documented: false, platforms: DART2JS_PLATFORM), |
175 "_internal/js_runtime/lib/js_helper.dart", | |
176 categories: "", | |
177 documented: false, | |
178 platforms: DART2JS_PLATFORM), | |
179 | |
180 "_interceptors": const LibraryInfo( | 138 "_interceptors": const LibraryInfo( |
181 "_internal/js_runtime/lib/interceptors.dart", | 139 "_internal/js_runtime/lib/interceptors.dart", |
182 categories: "", | 140 categories: "", |
183 documented: false, | 141 documented: false, |
184 platforms: DART2JS_PLATFORM), | 142 platforms: DART2JS_PLATFORM), |
185 | |
186 "_foreign_helper": const LibraryInfo( | 143 "_foreign_helper": const LibraryInfo( |
187 "_internal/js_runtime/lib/foreign_helper.dart", | 144 "_internal/js_runtime/lib/foreign_helper.dart", |
188 categories: "", | 145 categories: "", |
189 documented: false, | 146 documented: false, |
190 platforms: DART2JS_PLATFORM), | 147 platforms: DART2JS_PLATFORM), |
191 | |
192 "_isolate_helper": const LibraryInfo( | 148 "_isolate_helper": const LibraryInfo( |
193 "_internal/js_runtime/lib/isolate_helper.dart", | 149 "_internal/js_runtime/lib/isolate_helper.dart", |
194 categories: "", | 150 categories: "", |
195 documented: false, | 151 documented: false, |
196 platforms: DART2JS_PLATFORM), | 152 platforms: DART2JS_PLATFORM), |
197 | 153 "_js_mirrors": const LibraryInfo("_internal/js_runtime/lib/js_mirrors.dart", |
198 "_js_mirrors": const LibraryInfo( | 154 categories: "", documented: false, platforms: DART2JS_PLATFORM), |
199 "_internal/js_runtime/lib/js_mirrors.dart", | |
200 categories: "", | |
201 documented: false, | |
202 platforms: DART2JS_PLATFORM), | |
203 | |
204 "_js_primitives": const LibraryInfo( | 155 "_js_primitives": const LibraryInfo( |
205 "_internal/js_runtime/lib/js_primitives.dart", | 156 "_internal/js_runtime/lib/js_primitives.dart", |
206 categories: "", | 157 categories: "", |
207 documented: false, | 158 documented: false, |
208 platforms: DART2JS_PLATFORM), | 159 platforms: DART2JS_PLATFORM), |
209 | |
210 "_js_embedded_names": const LibraryInfo( | 160 "_js_embedded_names": const LibraryInfo( |
211 "_internal/js_runtime/lib/shared/embedded_names.dart", | 161 "_internal/js_runtime/lib/shared/embedded_names.dart", |
212 categories: "", | 162 categories: "", |
213 documented: false, | 163 documented: false, |
214 platforms: DART2JS_PLATFORM), | 164 platforms: DART2JS_PLATFORM), |
215 | 165 "_metadata": const LibraryInfo("html/html_common/metadata.dart", |
216 "_metadata": const LibraryInfo( | 166 categories: "", documented: false, platforms: DART2JS_PLATFORM), |
217 "html/html_common/metadata.dart", | 167 "_debugger": const LibraryInfo("_internal/js_runtime/lib/debugger.dart", |
218 categories: "", | 168 category: "", documented: false, platforms: DART2JS_PLATFORM), |
219 documented: false, | |
220 platforms: DART2JS_PLATFORM), | |
221 | |
222 "_debugger": const LibraryInfo( | |
223 "_internal/js_runtime/lib/debugger.dart", | |
224 category: "", | |
225 documented: false, | |
226 platforms: DART2JS_PLATFORM), | |
227 | |
228 "_runtime": const LibraryInfo( | 169 "_runtime": const LibraryInfo( |
229 "_internal/js_runtime/lib/ddc_runtime/runtime.dart", | 170 "_internal/js_runtime/lib/ddc_runtime/runtime.dart", |
230 category: "", | 171 category: "", |
231 documented: false, | 172 documented: false, |
232 platforms: DART2JS_PLATFORM), | 173 platforms: DART2JS_PLATFORM), |
233 }; | 174 }; |
234 | 175 |
235 /** | 176 /** |
236 * Information about a "dart:" library. | 177 * Information about a "dart:" library. |
237 */ | 178 */ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 * in a list of all libraries unless the user specifically asks the tool to | 220 * in a list of all libraries unless the user specifically asks the tool to |
280 * do so. | 221 * do so. |
281 */ | 222 */ |
282 final bool implementation; | 223 final bool implementation; |
283 | 224 |
284 /** | 225 /** |
285 * States the current maturity of this library. | 226 * States the current maturity of this library. |
286 */ | 227 */ |
287 final Maturity maturity; | 228 final Maturity maturity; |
288 | 229 |
289 const LibraryInfo(this.path, { | 230 const LibraryInfo(this.path, |
290 String categories: "", | 231 {String categories: "", |
291 this.dart2jsPath, | 232 this.dart2jsPath, |
292 this.dart2jsPatchPath, | 233 this.dart2jsPatchPath, |
293 this.implementation: false, | 234 this.implementation: false, |
294 this.documented: true, | 235 this.documented: true, |
295 this.maturity: Maturity.UNSPECIFIED, | 236 this.maturity: Maturity.UNSPECIFIED, |
296 this.platforms: DART2JS_PLATFORM | VM_PLATFORM}) | 237 this.platforms: DART2JS_PLATFORM | VM_PLATFORM}) |
297 : _categories = categories; | 238 : _categories = categories; |
298 | 239 |
299 bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0; | 240 bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0; |
300 bool get isVmLibrary => (platforms & VM_PLATFORM) != 0; | 241 bool get isVmLibrary => (platforms & VM_PLATFORM) != 0; |
301 | 242 |
302 /** | 243 /** |
303 * The categories in which the library can be used. | 244 * The categories in which the library can be used. |
304 * | 245 * |
305 * If no categories are specified, the library is internal and can not be | 246 * If no categories are specified, the library is internal and can not be |
306 * loaded by user code. | 247 * loaded by user code. |
(...skipping 22 matching lines...) Expand all Loading... |
329 final String name; | 270 final String name; |
330 final String description; | 271 final String description; |
331 | 272 |
332 const Maturity(this.level, this.name, this.description); | 273 const Maturity(this.level, this.name, this.description); |
333 | 274 |
334 String toString() => "$name: $level\n$description\n"; | 275 String toString() => "$name: $level\n$description\n"; |
335 | 276 |
336 static const Maturity DEPRECATED = const Maturity(0, "Deprecated", | 277 static const Maturity DEPRECATED = const Maturity(0, "Deprecated", |
337 "This library will be remove before next major release."); | 278 "This library will be remove before next major release."); |
338 | 279 |
339 static const Maturity EXPERIMENTAL = const Maturity(1, "Experimental", | 280 static const Maturity EXPERIMENTAL = const Maturity( |
| 281 1, |
| 282 "Experimental", |
340 "This library is experimental and will likely change or be removed\n" | 283 "This library is experimental and will likely change or be removed\n" |
341 "in future versions."); | 284 "in future versions."); |
342 | 285 |
343 static const Maturity UNSTABLE = const Maturity(2, "Unstable", | 286 static const Maturity UNSTABLE = const Maturity( |
| 287 2, |
| 288 "Unstable", |
344 "This library is in still changing and have not yet endured\n" | 289 "This library is in still changing and have not yet endured\n" |
345 "sufficient real-world testing.\n" | 290 "sufficient real-world testing.\n" |
346 "Backwards-compatibility is NOT guaranteed."); | 291 "Backwards-compatibility is NOT guaranteed."); |
347 | 292 |
348 static const Maturity WEB_STABLE = const Maturity(3, "Web Stable", | 293 static const Maturity WEB_STABLE = const Maturity( |
| 294 3, |
| 295 "Web Stable", |
349 "This library is tracking the DOM evolution as defined by WC3.\n" | 296 "This library is tracking the DOM evolution as defined by WC3.\n" |
350 "Backwards-compatibility is NOT guaranteed."); | 297 "Backwards-compatibility is NOT guaranteed."); |
351 | 298 |
352 static const Maturity STABLE = const Maturity(4, "Stable", | 299 static const Maturity STABLE = const Maturity( |
| 300 4, |
| 301 "Stable", |
353 "The library is stable. API backwards-compatibility is guaranteed.\n" | 302 "The library is stable. API backwards-compatibility is guaranteed.\n" |
354 "However implementation details might change."); | 303 "However implementation details might change."); |
355 | 304 |
356 static const Maturity LOCKED = const Maturity(5, "Locked", | 305 static const Maturity LOCKED = const Maturity(5, "Locked", |
357 "This library will not change except when serious bugs are encountered."); | 306 "This library will not change except when serious bugs are encountered."); |
358 | 307 |
359 static const Maturity UNSPECIFIED = const Maturity(-1, "Unspecified", | 308 static const Maturity UNSPECIFIED = const Maturity(-1, "Unspecified", |
360 "The maturity for this library has not been specified."); | 309 "The maturity for this library has not been specified."); |
361 } | 310 } |
OLD | NEW |