OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
6 | 6 |
7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 class EmitterFactory implements js_emitter.EmitterFactory { | 70 class EmitterFactory implements js_emitter.EmitterFactory { |
71 final bool generateSourceMap; | 71 final bool generateSourceMap; |
72 | 72 |
73 EmitterFactory({this.generateSourceMap}); | 73 EmitterFactory({this.generateSourceMap}); |
74 | 74 |
75 @override | 75 @override |
76 bool get supportsReflection => true; | 76 bool get supportsReflection => true; |
77 | 77 |
78 @override | 78 @override |
79 Emitter createEmitter( | 79 Emitter createEmitter(CodeEmitterTask task, Namer namer, |
80 CodeEmitterTask task, Namer namer, ClosedWorld closedWorld) { | 80 ClosedWorld closedWorld, Sorter sorter) { |
81 return new Emitter(task.compiler, namer, closedWorld, generateSourceMap, | 81 return new Emitter( |
82 task, task.sorter); | 82 task.compiler, namer, closedWorld, generateSourceMap, task, sorter); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 class Emitter extends js_emitter.EmitterBase { | 86 class Emitter extends js_emitter.EmitterBase { |
87 final Compiler compiler; | 87 final Compiler compiler; |
88 final CodeEmitterTask task; | 88 final CodeEmitterTask task; |
89 final ClosedWorld _closedWorld; | 89 final ClosedWorld _closedWorld; |
90 | 90 |
91 // The following fields will be set to copies of the program-builder's | 91 // The following fields will be set to copies of the program-builder's |
92 // collector. | 92 // collector. |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 // data. | 1964 // data. |
1965 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1965 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
1966 "needed for a given deferred library import."; | 1966 "needed for a given deferred library import."; |
1967 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1967 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
1968 compiler.outputProvider( | 1968 compiler.outputProvider( |
1969 compiler.options.deferredMapUri.path, '', OutputType.info) | 1969 compiler.options.deferredMapUri.path, '', OutputType.info) |
1970 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1970 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
1971 ..close(); | 1971 ..close(); |
1972 } | 1972 } |
1973 } | 1973 } |
OLD | NEW |