Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1783)

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart

Issue 12224130: Stable naming of interceptors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
index fa6f91e0a59498dc43e58a6202955993b3772208..5b93c92c50abf1f37f5d4e813a0d43a8cbdd7ccb 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
@@ -539,11 +539,13 @@ class Namer implements ClosureNamer {
}
// Use the unminified names here to construct the interceptor names. This
// helps ensure that they don't all suddenly change names due to a name
- // clash in the minifier, which would affect the diff size.
+ // clash in the minifier, which would affect the diff size. Sort the names
+ // of the classes to ensure name is stable and predicatble for the suggested
+ // names.
StringBuffer buffer = new StringBuffer('${element.name.slowToString()}\$');
- for (ClassElement cls in classes) {
- buffer.add(cls.name.slowToString());
- }
+ List<String> names = classes.map((cls) => cls.name.slowToString()).toList();
+ names.sort();
+ names.forEach(buffer.add);
return getMappedGlobalName(buffer.toString());
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698