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

Side by Side Diff: lib/compiler/implementation/library_map.dart

Issue 10894005: Remove library_map.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to tip of tree. 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
« no previous file with comments | « lib/compiler/implementation/apiimpl.dart ('k') | pkg/dartdoc/dartdoc.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // TODO(ahe): Long term, it would probably be better if we do not use
6 // executable code to define the locations of libraries.
7
8 #library('library_map');
9 #import('../../../lib/_internal/libraries.dart', prefix: "libs");
10
11 /**
12 * Simple structure providing the path to a library and an optional path
13 * to a patch file for the library.
14 */
15 class LibraryInfo {
16 final libs.LibraryInfo info;
17 const LibraryInfo(this.info);
18
19 String get libraryPath() {
20 String libPath = info.dart2jsPath;
21 if (libPath === null) libPath = info.path;
22 return "lib/$libPath";
23 }
24
25 String get patchPath() {
26 if (info.dart2jsPatchPath === null) return null;
27 return "lib/${info.dart2jsPatchPath}";
28 }
29
30 bool get isInternal => info.category === "Internal";
31 }
32
33 class Dart2JSLibraryMap {
34 const Dart2JSLibraryMap();
35
36 LibraryInfo operator[](String dartName) {
37 libs.LibraryInfo info = libs.LIBRARIES[dartName];
38 if (info === null) return null;
39 if (!info.isDart2JsLibrary()) {
40 // Dart2js can't handle internal libraries for other backends.
41 return null;
42 }
43 return new LibraryInfo(info);
44 }
45 }
46
47 final Dart2JSLibraryMap DART2JS_LIBRARY_MAP = const Dart2JSLibraryMap();
OLDNEW
« no previous file with comments | « lib/compiler/implementation/apiimpl.dart ('k') | pkg/dartdoc/dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698