Le 27/11/2013 19:14, Rick Waldron a écrit :
# Nov 19 Meeting Notes
## 4.4 Finalizing the Proxy API for ES6
(Presented by Tom Van Cutsem)
(...)
DS: What is typeof and instanceof
AWB/BE: object
BE: Capital P
AWB: Ca???
DS: Whatever Proxy creates?
BE: That depends on what is created.
DS: By default?
BE: typeof depends if there is a call trap. instanceof depends on the
prototype chain. All in the spec, so can create any object (apart from
private state issues)
Shouldn't it depend on the target's typeof value? depending on apply
(not call) trap makes typeof unstable ("delete handler.apply").
In any case, extra caution is required to keep typeof stability for
revokable proxies (on revocation, maybe the value need to be saved
somewhere)
nit:
"instanceof depends on the prototype chain"
=> Note that it calls the getPrototypeOf trap which doesn't enforce
anything for extensible objects [1], so "*the* prototype chain" has a
more volatile meaning for proxies than it has for regular objects.
David
[1] https://mail.mozilla.org/pipermail/es-discuss/2013-September/033370.html
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss