When I wrote in previously saying that your instance.o.key1 should be true
for hasOwnProperty, I wasn't thinking about the fact that MooTools unlinks
nested objects on the prototype to prevent pollution:

http://jsfiddle.net/SqsZB/1/

On Thu, Jul 7, 2011 at 9:10 PM, Jonathan Bomgardner <[email protected]>wrote:

> In my case (the example fiddle from the original post) it's returning
> false. How about this (it's closer to the original):
>
>
> var Ex1 = new Class({
>    o: { key1: 'val1'}
> });
>
> var Ex2 = new Class({
>    Extends: Ex1,
>    o: { key1: 'changed val',  //override original
>          key2: 'some val'}, //add our own
>    test: function(){
>       this.o.hasOwnProperty('key1'); //what should this return?
>       this.o.hasOwnProperty('key2'); //what should this return?
>   }
> });
>
> Could the inheritance be causing it to return false?
>
> Jon
>

Reply via email to