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

On Thu, Dec 10, 2009 at 9:58 PM, Maciej Stachowiak <[email protected]> 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

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to