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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 13912003: Realize that this() is a closure send. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/call_this_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/elements/elements.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/elements/elements.dart (revision 21192)
+++ sdk/lib/_internal/compiler/implementation/elements/elements.dart (working copy)
@@ -321,8 +321,11 @@
static bool isClosureSend(Send send, Element element) {
if (send.isPropertyAccess) return false;
if (send.receiver != null) return false;
+ Node selector = send.selector;
+ // this().
+ if (selector.isThis()) return true;
// (o)() or foo()().
- if (element == null && send.selector.asIdentifier() == null) return true;
+ if (element == null && selector.asIdentifier() == null) return true;
if (element == null) return false;
// foo() with foo a local or a parameter.
return isLocal(element);
« no previous file with comments | « no previous file | tests/language/call_this_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698