IsConstructor
Allen Wirfs-Brock
allen at wirfs-brock.com
Wed Jun 11 09:02:32 PDT 2014
On Jun 11, 2014, at 8:16 AM, Tom Van Cutsem wrote:
>
> 2014-06-11 16:48 GMT+02:00 Erik Arvidsson <erik.arvidsson at gmail.com>:
>
> [*] Proxies are oddballs here. All Proxies have a [[Construct]] method so the IsConstructor will always return true which is really not what you want. If IsConstructor was changed to check for a .prototype instead proxies would behave more inline with ordinary objects.
>
> No, only proxies whose target has a [[Construct]] method will themselves have a [[Construct]] method. IOW, proxies should be completely transparent w.r.t. the IsConstructor test.
> See 9.5.15 ProxyCreate step 5.b.
>
> I believe there may be a spec bug, as step 4 should explicitly exclude [[Construct]] and [[Call]], yet seems to include all methods defined in sec 9.5. Allen?
>
Kind of boarder line. 6.1.7.2 says that the "essential internal methods" are those listed in Table 5 (does not include [[Call]] and [[Constructor]]). Also the definitions of [[Call]] and [[Construct]] in 9.5 each include a note that says these internal methods are only provided when a corresponding internal method exists on the target.
Reading the section as a while, I think it is pretty clear that that a Proxy only has a [[Construct]] internal method if its target also has one.
Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140611/6987cbe2/attachment.html>
More information about the es-discuss
mailing list