Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: lib/_internal/libraries.dart

Issue 10894005: Remove library_map.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 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 const Map<String, LibraryInfo> LIBRARIES = const <LibraryInfo> { 23 const Map<String, LibraryInfo> LIBRARIES = const <LibraryInfo> {
24 24
25 "builtin": const LibraryInfo( 25 "builtin": const LibraryInfo(
26 "builtin/builtin_runtime.dart", 26 "builtin/builtin_runtime.dart",
27 category: "Server", 27 category: "Server",
28 documented: false,
28 platforms: VM_PLATFORM), 29 platforms: VM_PLATFORM),
29 30
30 // Is moving to pkg directory 31 // Is moving to pkg directory
31 "compiler": const LibraryInfo( 32 "compiler": const LibraryInfo(
ahe 2012/08/28 13:18:51 Will dart2js now support a library named dart:comp
dgrove 2012/08/28 15:19:12 I sure hope not. I would suggest that we not inclu
32 "compiler/compiler.dart", 33 "compiler/compiler.dart",
33 category: "Tools", 34 category: "Tools",
35 documented: false,
34 platforms: 0), 36 platforms: 0),
35 37
36 "core": const LibraryInfo( 38 "core": const LibraryInfo(
37 "core/core_runtime.dart", 39 "core/core_runtime.dart",
38 dart2jsPath: "compiler/implementation/lib/core.dart"), 40 dart2jsPath: "compiler/implementation/lib/core.dart"),
39 41
40 "coreimpl": const LibraryInfo( 42 "coreimpl": const LibraryInfo(
41 "coreimpl/coreimpl_runtime.dart", 43 "coreimpl/coreimpl_runtime.dart",
42 implementation: true, 44 implementation: true,
43 dart2jsPath: "compiler/implementation/lib/coreimpl.dart", 45 dart2jsPath: "compiler/implementation/lib/coreimpl.dart",
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 final bool implementation; 159 final bool implementation;
158 160
159 const LibraryInfo(this.path, [ 161 const LibraryInfo(this.path, [
160 this.category = "Shared", 162 this.category = "Shared",
161 this.dart2jsPath, 163 this.dart2jsPath,
162 this.dart2jsPatchPath, 164 this.dart2jsPatchPath,
163 this.implementation = false, 165 this.implementation = false,
164 this.documented = true, 166 this.documented = true,
165 this.platforms = DART2JS_PLATFORM | VM_PLATFORM]); 167 this.platforms = DART2JS_PLATFORM | VM_PLATFORM]);
166 168
167 bool isDart2JsLibrary() => (platforms & DART2JS_PLATFORM) != 0; 169 bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0;
168 bool isVmLibrary() => (platforms & VM_PLATFORM) != 0; 170 bool get isVmLibrary => (platforms & VM_PLATFORM) != 0;
169
170 String getDart2JsPath() =>
171 dart2jsPath != null ? "lib/$dart2jsPath" : "lib/$path";
172
173 String getDart2jsPatchPath() =>
174 dart2jsPatchPath != null ? "lib/$dart2jsPatchPath" : null;
175 } 171 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/apiimpl.dart » ('j') | lib/compiler/implementation/apiimpl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698