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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart

Issue 1278503004: Revert "Move dart2jslib parts into separate libraries." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 21
22 import '../../io/source_map_builder.dart' show 22 import '../../io/source_map_builder.dart' show
23 SourceMapBuilder; 23 SourceMapBuilder;
24 24
25 import '../../js/js.dart' as js; 25 import '../../js/js.dart' as js;
26 import '../../js_backend/js_backend.dart' show 26 import '../../js_backend/js_backend.dart' show
27 JavaScriptBackend, 27 JavaScriptBackend,
28 Namer, 28 Namer,
29 ConstantEmitter; 29 ConstantEmitter;
30 30
31 import '../../messages.dart' show MessageKind;
32
33 import '../../util/util.dart' show 31 import '../../util/util.dart' show
34 NO_LOCATION_SPANNABLE; 32 NO_LOCATION_SPANNABLE;
35 33
36 import '../../util/uri_extras.dart' show 34 import '../../util/uri_extras.dart' show
37 relativize; 35 relativize;
38 36
39 import '../headers.dart'; 37 import '../headers.dart';
40 import '../js_emitter.dart' show AstContainer, NativeEmitter; 38 import '../js_emitter.dart' show AstContainer, NativeEmitter;
41 39
42 import 'package:js_runtime/shared/embedded_names.dart' show 40 import 'package:js_runtime/shared/embedded_names.dart' show
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 writeMainFragment(mainFragment, mainCode); 206 writeMainFragment(mainFragment, mainCode);
209 207
210 if (backend.requiresPreamble && 208 if (backend.requiresPreamble &&
211 !backend.htmlLibraryIsLoaded) { 209 !backend.htmlLibraryIsLoaded) {
212 compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE); 210 compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
213 } 211 }
214 212
215 if (compiler.deferredMapUri != null) { 213 if (compiler.deferredMapUri != null) {
216 writeDeferredMap(); 214 writeDeferredMap();
217 } 215 }
218 216
219 // Return the total program size. 217 // Return the total program size.
220 return outputBuffers.values.fold(0, (a, b) => a + b.length); 218 return outputBuffers.values.fold(0, (a, b) => a + b.length);
221 } 219 }
222 220
223 /// Generates a simple header that provides the compiler's build id. 221 /// Generates a simple header that provides the compiler's build id.
224 js.Comment buildGeneratedBy() { 222 js.Comment buildGeneratedBy() {
225 String flavor = compiler.useContentSecurityPolicy 223 String flavor = compiler.useContentSecurityPolicy
226 ? 'fast startup, CSP' 224 ? 'fast startup, CSP'
227 : 'fast startup'; 225 : 'fast startup';
228 return new js.Comment(generatedBy(compiler, flavor: flavor)); 226 return new js.Comment(generatedBy(compiler, flavor: flavor));
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // Json does not support comments, so we embed the explanation in the 397 // Json does not support comments, so we embed the explanation in the
400 // data. 398 // data.
401 mapping["_comment"] = "This mapping shows which compiled `.js` files are " 399 mapping["_comment"] = "This mapping shows which compiled `.js` files are "
402 "needed for a given deferred library import."; 400 "needed for a given deferred library import.";
403 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); 401 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap());
404 compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map') 402 compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map')
405 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) 403 ..add(const JsonEncoder.withIndent(" ").convert(mapping))
406 ..close(); 404 ..close();
407 } 405 }
408 } 406 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart ('k') | pkg/compiler/lib/src/library_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698