Index: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart |
index 7abae77453072725cfc516457b948ff3321a62a8..b16379f5465ca7a8aa2e072146d7a0ab08a2734e 100644 |
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart |
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart |
@@ -17,6 +17,7 @@ import '../js_emitter.dart' hide Emitter; |
import '../js_emitter.dart' as js_emitter show Emitter; |
import '../model.dart'; |
import '../program_builder/program_builder.dart'; |
+import '../constant_ordering.dart' show deepCompareConstants; |
import '../../common.dart'; |
import '../../common/names.dart' show |
@@ -252,11 +253,9 @@ class Emitter implements js_emitter.Emitter { |
// which compresses a tiny bit better. |
int r = namer.constantLongName(a).compareTo(namer.constantLongName(b)); |
if (r != 0) return r; |
- // Resolve collisions in the long name by using the constant name (i.e. JS |
- // name) which is unique. |
- // TODO(herhut): Find a better way to resolve collisions. |
- return namer.constantName(a).hashCode.compareTo( |
- namer.constantName(b).hashCode); |
+ |
+ // Resolve collisions in the long name by using a structural order. |
+ return deepCompareConstants(a, b); |
} |
@override |