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

Side by Side Diff: frog/reader.dart

Issue 8591026: Roll DOM APIs forward on IDL & update Frog DOM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change window and document to getters Created 9 years, 1 month 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 | « frog/lib/dom/frog_dom.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * An code reader that abstracts away the distinction between internal and user 6 * An code reader that abstracts away the distinction between internal and user
7 * libraries. 7 * libraries.
8 */ 8 */
9 class LibraryReader { 9 class LibraryReader {
10 Map _specialLibs; 10 Map _specialLibs;
11 LibraryReader() { 11 LibraryReader() {
12 _specialLibs = { 12 _specialLibs = {
13 'dart:core': joinPaths(options.libDir, 'corelib.dart'), 13 'dart:core': joinPaths(options.libDir, 'corelib.dart'),
14 'dart:coreimpl': joinPaths(options.libDir, 'corelib_impl.dart'), 14 'dart:coreimpl': joinPaths(options.libDir, 'corelib_impl.dart'),
15 'dart:html': joinPaths(options.libDir, 15 'dart:html': joinPaths(options.libDir,
16 '../../client/html/release/html.dart'), 16 '../../client/html/release/html.dart'),
17 'dart:dom': joinPaths(options.libDir, 'dom/dom.dart'), 17 'dart:dom': joinPaths(options.libDir,
18 '../../client/dom/frog/frog_dom.dart'),
18 'dart:json': joinPaths(options.libDir, 'json.dart'), 19 'dart:json': joinPaths(options.libDir, 'json.dart'),
19 }; 20 };
20 } 21 }
21 22
22 SourceFile readFile(String fullname) { 23 SourceFile readFile(String fullname) {
23 var filename = _specialLibs[fullname]; 24 var filename = _specialLibs[fullname];
24 if (filename == null) { 25 if (filename == null) {
25 filename = fullname; 26 filename = fullname;
26 } 27 }
27 28
28 if (world.files.fileExists(filename)) { 29 if (world.files.fileExists(filename)) {
29 // TODO(jimhug): Should we cache these based on time stamps here? 30 // TODO(jimhug): Should we cache these based on time stamps here?
30 return new SourceFile(filename, world.files.readAll(filename)); 31 return new SourceFile(filename, world.files.readAll(filename));
31 } else { 32 } else {
32 world.error('File not found: $filename', null); 33 world.error('File not found: $filename', null);
33 return new SourceFile(filename, ''); 34 return new SourceFile(filename, '');
34 } 35 }
35 } 36 }
36 } 37 }
OLDNEW
« no previous file with comments | « frog/lib/dom/frog_dom.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698