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

Unified Diff: runtime/lib/mirrors.cc

Issue 973913002: Treat functions generated for closurization as equivalent to their source functions. (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 | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 4a82e90c5107084394a5d7173f94e0d3948a4b6b..7fb8fd01a7a5afcdf9bf57686e15dd3e3d66185c 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1366,6 +1366,13 @@ DEFINE_NATIVE_ENTRY(ClosureMirror_function, 1) {
Function& function = Function::Handle();
bool callable = closure.IsCallable(&function);
if (callable) {
+ if (function.IsImplicitClosureFunction()) {
+ // The VM uses separate Functions for tear-offs, but the mirrors consider
+ // the tear-offs to be the same as the torn-off methods. Avoid handing out
+ // a reference to the tear-off here to avoid a special case in the
+ // the equality test.
+ function = function.parent_function();
+ }
return CreateMethodMirror(function, Instance::null_instance());
}
return Instance::null();
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698