| 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 if (descriptor == null) { | 1067 if (descriptor == null) { |
| 1068 // Nothing of the library was emitted. | 1068 // Nothing of the library was emitted. |
| 1069 // TODO(floitsch): this should not happen. We currently have an example | 1069 // TODO(floitsch): this should not happen. We currently have an example |
| 1070 // with language/prefix6_negative_test.dart where we have an instance | 1070 // with language/prefix6_negative_test.dart where we have an instance |
| 1071 // method without its corresponding class. | 1071 // method without its corresponding class. |
| 1072 initializer = new jsAst.ObjectInitializer([]); | 1072 initializer = new jsAst.ObjectInitializer([]); |
| 1073 } else { | 1073 } else { |
| 1074 initializer = descriptor.toObjectInitializer(); | 1074 initializer = descriptor.toObjectInitializer(); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 compiler.dumpInfoTask.registerElementAst(library, metadata); | 1077 compiler.dumpInfoTask.registerEntityAst(library, metadata); |
| 1078 compiler.dumpInfoTask.registerElementAst(library, initializer); | 1078 compiler.dumpInfoTask.registerEntityAst(library, initializer); |
| 1079 | 1079 |
| 1080 List<jsAst.Expression> parts = <jsAst.Expression>[]; | 1080 List<jsAst.Expression> parts = <jsAst.Expression>[]; |
| 1081 parts | 1081 parts |
| 1082 ..add(js.string(libraryName)) | 1082 ..add(js.string(libraryName)) |
| 1083 ..add(js.string(uri.toString())) | 1083 ..add(js.string(uri.toString())) |
| 1084 ..add(metadata == null ? new jsAst.ArrayHole() : metadata) | 1084 ..add(metadata == null ? new jsAst.ArrayHole() : metadata) |
| 1085 ..add(js('#', namer.globalObjectForLibrary(library))) | 1085 ..add(js('#', namer.globalObjectForLibrary(library))) |
| 1086 ..add(initializer); | 1086 ..add(initializer); |
| 1087 if (library == _closedWorld.elementEnvironment.mainLibrary) { | 1087 if (library == _closedWorld.elementEnvironment.mainLibrary) { |
| 1088 parts.add(js.number(1)); | 1088 parts.add(js.number(1)); |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 // data. | 1944 // data. |
| 1945 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1945 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
| 1946 "needed for a given deferred library import."; | 1946 "needed for a given deferred library import."; |
| 1947 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1947 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
| 1948 compiler.outputProvider.createOutputSink( | 1948 compiler.outputProvider.createOutputSink( |
| 1949 compiler.options.deferredMapUri.path, '', OutputType.info) | 1949 compiler.options.deferredMapUri.path, '', OutputType.info) |
| 1950 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1950 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
| 1951 ..close(); | 1951 ..close(); |
| 1952 } | 1952 } |
| 1953 } | 1953 } |
| OLD | NEW |