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

Unified Diff: pkg/dev_compiler/lib/js/legacy/dart_library.js

Issue 2703263002: Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge ou… (Closed)
Patch Set: Created 3 years, 10 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
Index: pkg/dev_compiler/lib/js/legacy/dart_library.js
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_library.js b/pkg/dev_compiler/lib/js/legacy/dart_library.js
index 585b7a446b0228a15cdd06dc390c847aa98c7624..25eba3e11d13d94a0290d38b4967006735d0b867 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_library.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_library.js
@@ -17,12 +17,12 @@ dart_library =
throw Error(message);
}
- const dartLibraryName = Symbol('dartLibraryName');
- dart_library.dartLibraryName = dartLibraryName;
-
const libraryImports = Symbol('libraryImports');
dart_library.libraryImports = libraryImports;
+ // We need to load this symbol from the dart-sdk once it is loaded.
+ let dartLibraryName = null;
+
// 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, ....
@@ -95,7 +95,10 @@ dart_library =
// Load the library
let loader = this;
let library = this._library;
- library[dartLibraryName] = this._name;
+ if (dartLibraryName !== null) {
+ this._library[dartLibraryName] = this._name;
vsm 2017/02/21 14:33:00 Can this be moved to code_generator.dart - _emitMo
+ }
+
library[libraryImports] = this._imports;
library[loadedModule] = library;
args.unshift(library);
@@ -189,6 +192,7 @@ dart_library =
// Force import of core.
var dart_sdk = import_('dart_sdk');
+ dartLibraryName = dart_sdk.dart.dartLibraryName;
// This import is only needed for chrome debugging. We should provide an
// option to compile without it.

Powered by Google App Engine
This is Rietveld 408576698