| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.js_emitter.startup_emitter.model_emitter; | 5 library dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 import 'dart:convert' show JsonEncoder; | 7 import 'dart:convert' show JsonEncoder; |
| 8 | 8 |
| 9 import '../../common.dart'; | 9 import '../../common.dart'; |
| 10 | 10 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // tokens in the main-fragment. | 204 // tokens in the main-fragment. |
| 205 deferredHashTokens.forEach((DeferredFragment key, | 205 deferredHashTokens.forEach((DeferredFragment key, |
| 206 _DeferredFragmentHash token) { | 206 _DeferredFragmentHash token) { |
| 207 token.setHash(hunkHashes[key]); | 207 token.setHash(hunkHashes[key]); |
| 208 }); | 208 }); |
| 209 | 209 |
| 210 writeMainFragment(mainFragment, mainCode); | 210 writeMainFragment(mainFragment, mainCode); |
| 211 | 211 |
| 212 if (backend.requiresPreamble && | 212 if (backend.requiresPreamble && |
| 213 !backend.htmlLibraryIsLoaded) { | 213 !backend.htmlLibraryIsLoaded) { |
| 214 compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE); | 214 compiler.reportHintMessage( |
| 215 NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE); |
| 215 } | 216 } |
| 216 | 217 |
| 217 if (compiler.deferredMapUri != null) { | 218 if (compiler.deferredMapUri != null) { |
| 218 writeDeferredMap(); | 219 writeDeferredMap(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 // Return the total program size. | 222 // Return the total program size. |
| 222 return outputBuffers.values.fold(0, (a, b) => a + b.length); | 223 return outputBuffers.values.fold(0, (a, b) => a + b.length); |
| 223 } | 224 } |
| 224 | 225 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 // Json does not support comments, so we embed the explanation in the | 402 // Json does not support comments, so we embed the explanation in the |
| 402 // data. | 403 // data. |
| 403 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 404 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
| 404 "needed for a given deferred library import."; | 405 "needed for a given deferred library import."; |
| 405 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 406 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
| 406 compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map') | 407 compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map') |
| 407 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 408 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
| 408 ..close(); | 409 ..close(); |
| 409 } | 410 } |
| 410 } | 411 } |
| OLD | NEW |