Closed
Description
Currently every implicitly bound closure (by getting a method) has its own class. This is not necessary if the methods have the same name.
We could furthermore store the method name as string in a generic BoundClosureClass.
Example:
class BoundClosure0 {
var self, methodName; // methodName would not be accessible outside the class.
BoundClosure0(this.self, this.methodName);
call$0 = function() { return this.selfthis.methodName; }
}
Each arity (more precisely selector) would need its own BoundClosure class.
Activity
rakudrama commentedon May 14, 2012
It would be great for debugging if the name of the closure was such that the name of the method appeared in the JasvaScript stack trace, e.g. Widget.item$bound_closure
I'm skeptical about the call this.selfthis.methodName being fast, but the entire closure class could be generated from relatively little metadata.
floitschG commentedon Aug 16, 2012
This has been implemented a long time ago.
Added Fixed label.
Roll Dart Documentation Generator from 8549817bb1b5 to f5bcc4bd46f4 (…