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

Unified Diff: pkg/compiler/lib/src/js_backend/minify_namer.dart

Issue 1220793006: dart2js: Fix regression in minified names for one shot interceptors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: comments Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/minify_namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/minify_namer.dart b/pkg/compiler/lib/src/js_backend/minify_namer.dart
index 9a2d1e3fc4a1290eb5a086a1cceeaae5933d20fe..0b97b868111b073974b6874feb3a0fd621f68bd2 100644
--- a/pkg/compiler/lib/src/js_backend/minify_namer.dart
+++ b/pkg/compiler/lib/src/js_backend/minify_namer.dart
@@ -7,7 +7,8 @@ part of js_backend;
/**
* Assigns JavaScript identifiers to Dart variables, class-names and members.
*/
-class MinifyNamer extends Namer with _MinifiedFieldNamer {
+class MinifyNamer extends Namer with _MinifiedFieldNamer,
+ _MinifiedOneShotInterceptorNamer {
MinifyNamer(Compiler compiler) : super(compiler) {
reserveBackendNames();
fieldRegistry = new _FieldNamingRegistry(this);
@@ -255,3 +256,22 @@ class MinifyNamer extends Namer with _MinifiedFieldNamer {
}
}
+
+abstract class _MinifiedOneShotInterceptorNamer implements Namer {
+ /// Property name used for the one-shot interceptor method for the given
+ /// [selector] and return-type specialization.
+ @override
+ jsAst.Name nameForGetOneShotInterceptor(Selector selector,
+ Iterable<ClassElement> classes) {
+ String root = selector.isOperator
+ ? operatorNameToIdentifier(selector.name)
+ : privateName(selector.memberName);
+ String prefix = selector.isGetter
+ ? r"$get"
+ : selector.isSetter ? r"$set" : "";
+ String arity = selector.isCall ? "${selector.argumentCount}" : "";
+ String suffix = suffixForGetInterceptor(classes);
+ String fullName = "\$intercepted$prefix\$$root$arity\$$suffix";
+ return _disambiguateInternalGlobal(fullName);
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698