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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart

Issue 250553004: Always treat [call] members as closures during tracing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/compiler/dart2js_extra/18383_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/inferrer/node_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
index b1ba510d50e0f7f1e3d443896b592548184b31fd..b343193ec587fcaa7874458f4af1e902ae9fc318 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
@@ -333,6 +333,15 @@ abstract class TracerVisitor implements TypeInformationVisitor {
bool isClosure(Element element) {
if (!element.isFunction()) return false;
+ /// Creating an instance of a class that implements [Function] also
+ /// closurizes the corresponding [call] member. We do not currently
+ /// track these, thus the check for [isClosurized] on such a method will
+ /// return false. Instead we catch that case here for now.
+ // TODO(herhut): Handle creation of closures from instances of Function.
+ if (element.isInstanceMember() &&
+ element.name == Compiler.CALL_OPERATOR_NAME) {
+ return true;
+ }
Element outermost = element.getOutermostEnclosingMemberOrTopLevel();
return outermost.declaration != element.declaration;
}
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/18383_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698