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

Unified Diff: pkg/dev_compiler/tool/patch_sdk.dart

Issue 2874713005: Disambiguate setters and getters when patching DDC SDK. (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/patch_sdk.dart
diff --git a/pkg/dev_compiler/tool/patch_sdk.dart b/pkg/dev_compiler/tool/patch_sdk.dart
index 2b716403460ead755dff742122650cf14edd8810..9796cfb7490ae779716fd5a089981ab5a612caf8 100755
--- a/pkg/dev_compiler/tool/patch_sdk.dart
+++ b/pkg/dev_compiler/tool/patch_sdk.dart
@@ -349,13 +349,23 @@ class PatchFinder extends GeneralizingAstVisitor {
}
String _qualifiedName(Declaration node) {
+ var result = "";
+
var parent = node.parent;
- var className = '';
if (parent is ClassDeclaration) {
- className = parent.name.name + '.';
+ result = "${parent.name.name}.";
}
+
var name = (node as dynamic).name;
- return className + (name != null ? name.name : '');
+ if (name != null) result += name.name;
+
+ // Make sure setters and getters don't collide.
+ if ((node is FunctionDeclaration || node is MethodDeclaration) &&
+ (node as dynamic).isSetter) {
+ result += "=";
+ }
+
+ return result;
}
bool _isPatch(AnnotatedNode node) => node.metadata.any(_isPatchAnnotation);
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698