Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
index 5bf5d697a34a4e36dea5227f55bbe321e2f75aaa..1eaaa8029015aed45aa77496d9c40fc9f6618d56 100644 |
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
@@ -1120,10 +1120,17 @@ class FragmentEmitter { |
globals.add(emitMangledGlobalNames()); |
- // The [MANGLED_NAMES] table is only relevant for reflection. |
- // TODO(floitsch): verify that this is correct. |
- globals.add(new js.Property(js.string(MANGLED_NAMES), |
- new js.ObjectInitializer([]))); |
+ // The [MANGLED_NAMES] table must contain the mapping for const symbols. |
+ // Without const symbols, the table is only relevant for reflection and |
+ // therefore unused in this emitter. |
+ List<js.Property> mangledNamesProperties = <js.Property>[]; |
+ program.symbolsMap.forEach((js.Name mangledName, String unmangledName) { |
+ mangledNamesProperties.add( |
+ new js.Property(mangledName, js.string(unmangledName))); |
+ }); |
+ globals.add(new js.Property( |
+ js.string(MANGLED_NAMES), |
+ new js.ObjectInitializer(mangledNamesProperties))); |
globals.add(emitGetTypeFromName()); |