2013/9/20 Allen Wirfs-Brock <[email protected]> > BTW, I would want to use [[InvokeFunction]] for both directly > obj.method() and in the internals of F.p.call/apply >
As I mentioned to your reply at the time, I believe the latter would break the expectations of existing code. Code that uses F.p.call/apply to apply a function it acquired through manual lookup typically expects it's going to execute the original behavior, and nothing else: var original_push = Array.prototype.push; ... original_push.call(unknownObject, ...args); // programmer expects this to either do the specced push() behavior or throw a TypeError (assuming original definition of 'call') JS fundamentally decouples property lookup from method call and thus has the ability to express non-polymorphic function calls. We shouldn't virtualize [[Call]]. If a proxy wants to intercept method calls, it can return a wrapper function from its "get" trap and override "invoke". I'm pretty sure virtualizing [[Call]] will be a bridge too far.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

