Index: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart |
index 70e6a95c97f148c9c829c674794f72ae26826bea..dbeaada7db647fbf44dfa47a6ce1f7de70bec6b7 100644 |
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart |
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart |
@@ -38,7 +38,7 @@ class ModelEmitter { |
constantEmitter = |
new ConstantEmitter(compiler, namer, makeConstantListTemplate); |
- void emitProgram(Program program) { |
+ int emitProgram(Program program) { |
List<Output> outputs = program.outputs; |
MainOutput mainUnit = outputs.first; |
js.Statement mainAst = emitMainUnit(program); |
@@ -47,15 +47,17 @@ class ModelEmitter { |
..add(buildGeneratedBy(compiler)) |
..add(mainCode) |
..close(); |
- compiler.assembledCode = mainCode; |
+ int totalSize = mainCode.length; |
outputs.skip(1).forEach((DeferredOutput deferredUnit) { |
js.Expression ast = emitDeferredUnit(deferredUnit, mainUnit.holders); |
String code = js.prettyPrint(ast, compiler).getText(); |
+ totalSize += code.length; |
compiler.outputProvider(deferredUnit.outputFileName, deferredExtension) |
..add(code) |
..close(); |
}); |
+ return totalSize; |
} |
js.LiteralString unparse(Compiler compiler, js.Expression value) { |