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

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

Issue 11034021: [dart2dart] Don't go inside TypeAnnotation.typeName, otherwise in "new lib.A()" expression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 18d0b3963f8c344516f09962384608812021099f..cc8ac5be1b6b1028e0f55cd1bfe7144c23103ed9 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -90,13 +90,6 @@ class SendVisitor extends ResolvedVisitor {
return;
}
if (element.isConstructor() || element.isFactoryConstructor()) {
- // Rename named constructor in redirection position:
- // class C { C.named(); C.redirecting() : this.named(); }
- if (node.receiver is Identifier
- && node.receiver.asIdentifier().isThis()) {
- assert(node.selector is Identifier);
- collector.tryMakeMemberPlaceholder(node.selector);
- }
// Field names can be exposed as names of optional arguments, e.g.
// class C {
// final field;
@@ -473,7 +466,10 @@ class PlaceholderCollector extends Visitor {
}
}
}
- node.visitChildren(this);
+ // Visit only type arguments, otherwise in case of lib.Class type annotation
+ // typeName is Send and we go to visitGetterSend, as a result "Class" is
+ // added to member placeholders.
+ visit(node.typeArguments);
}
visitVariableDefinitions(VariableDefinitions node) {
@@ -530,7 +526,16 @@ class PlaceholderCollector extends Visitor {
}
}
}
- node.visitChildren(this);
+ visit(node.modifiers);
Roman 2012/10/02 14:57:10 I know you don't like calling explicitly visit() f
+ // We don't want to visit Send for function name, it appears as
+ // getter send and we end up renaming constructor as member identifier.
+ if (node.name is Identifier) {
+ visitIdentifier(node.name);
+ }
+ visit(node.returnType);
+ visit(node.parameters);
+ visit(node.initializers);
+ visit(node.body);
// Make sure we don't omit return type of methods which names are
// identifiers, because the following works fine:
// int interface() => 1;
« 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