| 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 final 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 final int VM_PLATFORM = 2; | 15 const int VM_PLATFORM = 2; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Mapping of "dart:" library name (e.g. "core") to information about that libra
ry. | 18 * Mapping of "dart:" library name (e.g. "core") to information about that libra
ry. |
| 19 * This information is structured such that Dart Editor can parse this file | 19 * This information is structured such that Dart Editor can parse this file |
| 20 * and extract the necessary information without executing it | 20 * and extract the necessary information without executing it |
| 21 * while other tools can access via execution. | 21 * while other tools can access via execution. |
| 22 */ | 22 */ |
| 23 final Map<String, LibraryInfo> LIBRARIES = const <LibraryInfo> { | 23 const Map<String, LibraryInfo> LIBRARIES = const <LibraryInfo> { |
| 24 | 24 |
| 25 // Used by VM applications | 25 // Used by VM applications |
| 26 "builtin": const LibraryInfo( | 26 "builtin": const LibraryInfo( |
| 27 "builtin/builtin_runtime.dart", | 27 "builtin/builtin_runtime.dart", |
| 28 category: "Server", | 28 category: "Server", |
| 29 platforms: VM_PLATFORM), | 29 platforms: VM_PLATFORM), |
| 30 | 30 |
| 31 // Is moving to pkg directory | 31 // Is moving to pkg directory |
| 32 "compiler": const LibraryInfo( | 32 "compiler": const LibraryInfo( |
| 33 "compiler/compiler.dart", | 33 "compiler/compiler.dart", |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 this.implementation = false, | 166 this.implementation = false, |
| 167 this.documented = true, | 167 this.documented = true, |
| 168 this.platforms = DART2JS_PLATFORM | VM_PLATFORM]); | 168 this.platforms = DART2JS_PLATFORM | VM_PLATFORM]); |
| 169 | 169 |
| 170 bool isDart2JsLibrary() => (platforms & DART2JS_PLATFORM) != 0; | 170 bool isDart2JsLibrary() => (platforms & DART2JS_PLATFORM) != 0; |
| 171 bool isVmLibrary() => (platforms & VM_PLATFORM) != 0; | 171 bool isVmLibrary() => (platforms & VM_PLATFORM) != 0; |
| 172 | 172 |
| 173 String getDart2JsPath() => dart2jsPath != null ? "lib/$dart2jsPath" : "lib/$pa
th"; | 173 String getDart2JsPath() => dart2jsPath != null ? "lib/$dart2jsPath" : "lib/$pa
th"; |
| 174 String getDart2jsPatchPath() => dart2jsPatchPath != null ? "lib/$dart2jsPatchP
ath" : null; | 174 String getDart2jsPatchPath() => dart2jsPatchPath != null ? "lib/$dart2jsPatchP
ath" : null; |
| 175 } | 175 } |
| OLD | NEW |