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

Unified Diff: lib/runtime/dart_library.js

Issue 1521283003: Run browser tests on Atom/Electron (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« karma.conf.js ('K') | « karma.conf.js ('k') | package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_library.js
diff --git a/lib/runtime/dart_library.js b/lib/runtime/dart_library.js
index 12852bbf4dd5b8992eb274c679246f4eae7916ac..223744939e9190cb5cc453bca953af992d60793c 100644
--- a/lib/runtime/dart_library.js
+++ b/lib/runtime/dart_library.js
@@ -51,7 +51,7 @@ var dart_library =
handleImports(list, handler) {
let results = [];
for (let name of list) {
- let lib = libraries[name];
+ let lib = libraries.get(name);
ochafik 2015/12/14 02:46:16 Electron doesn't like [] on Map yet?
if (!lib) {
throwLibraryError('Library not available: ' + name);
}
@@ -100,16 +100,18 @@ var dart_library =
// Map from name to LibraryLoader
let libraries = new Map();
+ dart_library.libraries = function() { return libraries.keys(); }
function library(name, defaultValue, imports, lazyImports, loader) {
- return libraries[name] =
- new LibraryLoader(name, defaultValue, imports, lazyImports, loader);
+ let result = new LibraryLoader(name, defaultValue, imports, lazyImports, loader);
+ libraries.set(name, result);
+ return result;
}
dart_library.library = library;
function import_(libraryName) {
bootstrap();
- let loader = libraries[libraryName];
+ let loader = libraries.get(libraryName);
// TODO(vsm): A user might call this directly from JS (as we do in tests).
// We may want a different error type.
if (!loader) throwLibraryError('Library not found: ' + libraryName);
« karma.conf.js ('K') | « karma.conf.js ('k') | package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698