eliminating: new Object(<host object>) loophole

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Apr 11 16:58:29 PDT 2012


If we want to get rid of the concept of "host objects" then something that needs to be cleaned up is the specification of implementation dependent behavior of newing the Object constructor with a host object as the argument:

15.2.2.1, step 1.a.ii says: "If the (argument) value is a host object, then actions are taken and a result is returned in an implementation-dependent manner that may depend on the host object."

and

Object.prototype.valueOf
15.2.4.4, steop 2says: "If O is the result of calling the Object constructor with a host object (15.2.2.1), then Return either O or another value such as the host object originally passed to the constructor. The specific result that is returned is implementation-defined."

Does any one know the purpose of this allowance?  Does any known implementation depend upon it?

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120411/f3cff888/attachment.html>


More information about the es-discuss mailing list