[webkit-reviews] Bug 3293: Object.prototype.hasOwnProperty() missing

Maciej Stachowiak mjs at apple.com
Sun Jun 12 16:49:14 PDT 2005


On Jun 10, 2005, at 7:39 AM, Mark Rowe wrote:

> Hi,
>
> I've attached a patch and layout test to bug 3293* that adds  
> support for the Object.prototype.hasOwnProperty as defined in  
> ECMA-262, section 15.2.4.5.

Just to keep the list informed:

I gave Mark my feedback to this patch on IRC, then Mark and Darin and  
I discussed it a bit. The short version:

* This patch doesn't quite work, as the hasOwnProperty it adds will  
not pick up special properties (like the "length" property on  
strings) that aren't in the PropertyMap. getDirect only looks in the  
property map.

* My suggested fix for this is to rename all existing hasProperty  
implementations on ObjectImp subclasses to hasOwnProperty, and change  
ObjectImp::hasOwnProperty to stop calling the prototype. Then add an  
ObjectImp::hasProperty non-virtual method that calls hasOwnProperty  
on itself, and then hasProperty on the prototype.

Regards,
Maciej




More information about the webkit-reviews mailing list