Chromium Code Reviews| Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| index 40a747308c37b9f4be70cc4cc5ec6662b73d3d74..ab497435968dc8bb098e2c36998ba02226ff9154 100644 |
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| @@ -1733,6 +1733,10 @@ class OldEmitter implements Emitter { |
| emitDeferredBoilerPlate(mainBuffer, deferredLoadHashes); |
| + if (compiler.deferredMapUri != null) { |
| + outputDeferredMap(); |
| + } |
| + |
| // Static field initializations require the classes and compile-time |
| // constants to be set up. |
| emitStaticNonFinalFieldInitializations(mainBuffer, mainOutputUnit); |
| @@ -2270,6 +2274,18 @@ function(originalDescriptor, name, holder, isStatic, globalFunctionsAccess) { |
| ..close(); |
| } |
| + void outputDeferredMap() { |
| + Map mapping = new Map(); |
|
floitsch
2015/01/05 14:10:38
types.
sigurdm
2015/01/05 15:23:08
I changed it to Map<String, dynamic> If we want th
|
| + // Json does not support comments, so we embed the explanation in the |
| + // data. |
| + mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
| + "needed for a given deferred library import."; |
| + mapping.addAll(compiler.deferredLoadTask.deferredMap()); |
| + compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map') |
| + ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
| + ..close(); |
| + } |
| + |
| void invalidateCaches() { |
| if (!compiler.hasIncrementalSupport) return; |
| if (cachedElements.isEmpty) return; |