http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies#discussed_during_tc39_july_2012_meeting_microsoft_redmond
*nativeCall trap* * Built-in methods applied to proxies: for Date, agreed that it would be sensible to “unwrap” the proxy (e.g. |Date.prototype.getTime.call(Proxy(aDate, handler)) ⇒ aDate.getTime()|). This seems fine as long as such built-ins don’t return an object but just a primitive value. * Instead of auto-unwrapping, could delegate to a generic trap that can decide to forward or do something else: |Date.prototype.getYear.call(Proxy(t, h)) ⇒ h.nativeCall(t, Date.prototype.getYear, [])| * potential capability leak: the trap gets access to the function, which could be a closely held capability that shouldn’t be leaked to the proxy. * Conclusion: let’s not introduce such a trap. Instead, wherever we think we need this trap, try to turn the non-generic method into a generic method so that the method becomes applicable to Objects/Proxies. * Example: for Date.prototype methods, we might represent [[PrimitiveValue]] as a unique name, so any object with the unique name could mimic Date instances and be a valid this-binding of the |Date.prototype| methods. ** More in Tom's wiki edits and on es-discuss. /be _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

