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

Unified Diff: pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart

Issue 1021813002: Redo "Use an explicit 'this' parameter instead of 'This' nodes." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/dart_backend/dart_backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
index 7c8113a26352b6a03ffbd573b6188983b8909ad7..9bf9121c02e18cbb382d30a3687e696726236340 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
@@ -398,9 +398,9 @@ class TreePrinter {
}
} else if (exp is CallMethod) {
precedence = CALLEE;
- tree.Node receiver = exp.object is This
- ? null
- : makeExp(exp.object, PRIMARY, beginStmt: beginStmt);
+ // TODO(sra): Elide receiver when This, but only if not in a scope that
+ // shadows the method (e.g. constructor body).
+ tree.Node receiver = makeExp(exp.object, PRIMARY, beginStmt: beginStmt);
result = new tree.Send(
receiver,
makeIdentifier(exp.methodName),
@@ -445,9 +445,9 @@ class TreePrinter {
colon);
} else if (exp is FieldExpression) {
precedence = PRIMARY;
- tree.Node receiver = exp.object is This
- ? null
- : makeExp(exp.object, PRIMARY, beginStmt: beginStmt);
+ // TODO(sra): Elide receiver when This, but only if not in a scope that
+ // shadows the method (e.g. constructor body).
+ tree.Node receiver = makeExp(exp.object, PRIMARY, beginStmt: beginStmt);
result = new tree.Send(receiver, makeIdentifier(exp.fieldName));
} else if (exp is ConstructorDefinition) {
precedence = EXPRESSION;
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/dart_backend/dart_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698