Catch-all proposal based on proxies

Maciej Stachowiak mjs at apple.com
Fri Dec 11 08:36:53 PST 2009


On Dec 10, 2009, at 10:06 PM, Mark S. Miller wrote:

> On Thu, Dec 10, 2009 at 9:58 PM, Maciej Stachowiak <mjs at apple.com>  
> wrote:
>
>   Object.prototype.hasOwnProperty.call(d, name)
>
> I'm a little less confident of the latter than the former. However,  
> Google Code Search finds a number of hits for  
> Object.prototype.hasOwnProperty.call that appear to be operating on  
> potentially arbitrary objects and property names. At least some of  
> the JavaScript code in question looked like it might be actually  
> deployed on the Web.
>
>
> Google Code Search sees this pattern appearing in a number of  
> places, some of which are JavaScript libraries (though others seem  
> like code bases that could feasibly be updated):
>
> http://www.google.com/codesearch?q=Object.prototype.propertyIsEnumerable.call&hl=en&btnG=Search+Code
>
>
> Thanks for reminding me to use that tool!
>
> Constraining the searches to javascript,
>
> http://www.google.com/codesearch?hl=en&lr=&q=Object.prototype.propertyIsEnumerable.call+lang:javascript&sbtn=Search
>
> shows 85 results whereas
>
> http://www.google.com/codesearch?hl=en&lr=&q=Object.prototype.hasOwnProperty.call+lang:javascript&sbtn=Search
>
> has 263. I will proceed to worry only about hasOwnProperty until  
> someone objects.

Note that these are hits found in source repositories, not on the Web.  
So I would not put too much stock in the number of hits except as an  
existence proof. Both of these include hits from JavaScript libraries,  
likely meaning there are many deployed copies of the code in question  
(though unclear if that code path gets hit as the JS libraries are  
used in practice).

Regards,
Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20091211/46f9d4c7/attachment-0001.html>


More information about the es-discuss mailing list