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

Unified Diff: lib/compiler/implementation/dart_backend/renamer.dart

Issue 10826083: Properly rename new <class>.<factory> expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/renamer.dart
diff --git a/lib/compiler/implementation/dart_backend/renamer.dart b/lib/compiler/implementation/dart_backend/renamer.dart
index 46dacd10b1b9e59a3621b9b2dd59036b8d9836c8..b9fd75846f74a99ca7688b8d20508d13173f8820 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -30,16 +30,13 @@ class ConflictingRenamer extends Renamer {
String getFactoryName(FunctionExpression node) =>
node.name.asSend().selector.asIdentifier().source.slowToString();
- bool isNamedConstructor(Element element) =>
- element.isGenerativeConstructor()
- && element.asFunctionElement().cachedNode.name is Send;
-
String renameSendMethod(Send send) {
if (contextElements[send] === null) return null;
Element element = contextElements[send];
if (element.isTopLevel()) {
return renameElement(element);
- } else if (isNamedConstructor(element)
+ } else if ((element.isGenerativeConstructor() || element.isFactoryConstructor())
Roman 2012/07/31 14:28:39 >80 chars
Anton Muhin 2012/07/31 15:05:04 Done.
+ && element.asFunctionElement().cachedNode.name is Send
// Don't want to rename redirects to :this(args).
&& !Initializers.isConstructorRedirect(send)
// Don't want to rename super calls.
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698