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

Unified Diff: lib/runtime/dart_library.js

Issue 2164763005: Library custom formatters (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Revert test files Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/runtime/dart_sdk.js » ('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 0b6dd36a1ffd65f9c11f63ec6f53ee7314d0b5d3..2158b22543cc1eeb72bf6a162e7367a7e1cda10a 100644
--- a/lib/runtime/dart_library.js
+++ b/lib/runtime/dart_library.js
@@ -16,11 +16,15 @@ var dart_library =
throw Error(message);
}
+ const dartLibraryName = Symbol('dartLibraryName');
+ dart_library.dartLibraryName = dartLibraryName;
+
// Module support. This is a simplified module system for Dart.
// Longer term, we can easily migrate to an existing JS module system:
// ES6, AMD, RequireJS, ....
class LibraryLoader {
+
constructor(name, defaultValue, imports, loader) {
this._name = name;
this._library = defaultValue ? defaultValue : {};
@@ -60,7 +64,7 @@ var dart_library =
args.unshift(this._library);
this._loader.apply(null, args);
this._state = LibraryLoader.READY;
- this._library._name = this._name;
+ this._library[dartLibraryName] = this._name;
return this._library;
}
@@ -75,6 +79,13 @@ var dart_library =
// Map from name to LibraryLoader
let libraries = new Map();
dart_library.libraries = function() { return libraries.keys(); };
+ dart_library.debuggerLibraries = function() {
+ var debuggerLibraries = [];
+ libraries.forEach(function (value, key, map) {
+ debuggerLibraries.push(value.load());
+ });
+ return debuggerLibraries;
+ };
function library(name, defaultValue, imports, loader) {
let result = new LibraryLoader(name, defaultValue, imports, loader);
« no previous file with comments | « no previous file | lib/runtime/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698