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

Mark Rowe opendarwin.org at bdash.net.nz
Sun Jun 12 21:49:05 PDT 2005

On 13/06/2005, at 11:49 , Maciej Stachowiak wrote:

> 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
> 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.

Thanks for the feedback Maciej.  I've updated the patch and layout  
tests on bug 3293 to implement the behaviour as you described.

Kind Regards,

Mark Rowe

More information about the webkit-reviews mailing list