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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 compiler.dumpInfoTask.registerElementAst(library, metadata); | 1099 compiler.dumpInfoTask.registerElementAst(library, metadata); |
1100 compiler.dumpInfoTask.registerElementAst(library, initializer); | 1100 compiler.dumpInfoTask.registerElementAst(library, initializer); |
1101 | 1101 |
1102 List<jsAst.Expression> parts = <jsAst.Expression>[]; | 1102 List<jsAst.Expression> parts = <jsAst.Expression>[]; |
1103 parts | 1103 parts |
1104 ..add(js.string(libraryName)) | 1104 ..add(js.string(libraryName)) |
1105 ..add(js.string(uri.toString())) | 1105 ..add(js.string(uri.toString())) |
1106 ..add(metadata == null ? new jsAst.ArrayHole() : metadata) | 1106 ..add(metadata == null ? new jsAst.ArrayHole() : metadata) |
1107 ..add(js('#', namer.globalObjectForLibrary(library))) | 1107 ..add(js('#', namer.globalObjectForLibrary(library))) |
1108 ..add(initializer); | 1108 ..add(initializer); |
1109 if (library == compiler.mainApp) { | 1109 if (library == _closedWorld.elementEnvironment.mainLibrary) { |
1110 parts.add(js.number(1)); | 1110 parts.add(js.number(1)); |
1111 } | 1111 } |
1112 | 1112 |
1113 return new jsAst.ArrayInitializer(parts); | 1113 return new jsAst.ArrayInitializer(parts); |
1114 } | 1114 } |
1115 | 1115 |
1116 void assemblePrecompiledConstructor( | 1116 void assemblePrecompiledConstructor( |
1117 OutputUnit outputUnit, | 1117 OutputUnit outputUnit, |
1118 jsAst.Name constructorName, | 1118 jsAst.Name constructorName, |
1119 jsAst.Expression constructorAst, | 1119 jsAst.Expression constructorAst, |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 // data. | 1972 // data. |
1973 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1973 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
1974 "needed for a given deferred library import."; | 1974 "needed for a given deferred library import."; |
1975 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1975 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
1976 compiler.outputProvider( | 1976 compiler.outputProvider( |
1977 compiler.options.deferredMapUri.path, '', OutputType.info) | 1977 compiler.options.deferredMapUri.path, '', OutputType.info) |
1978 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1978 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
1979 ..close(); | 1979 ..close(); |
1980 } | 1980 } |
1981 } | 1981 } |
OLD | NEW |