That's a super helpful explanation, Arian. Thanks!

~Philip

On Fri, Jul 8, 2011 at 3:53 AM, Arian Stolwijk <[email protected]> wrote:

> in both cases it's somewhere on the prototype (or prototype chain with
> extending).
>
> I hope this helps a bit: http://jsfiddle.net/SqsZB/
>
> Properties that are in your 'class definition object' (what you pass into
> Class()) will be put onto prototype, so are not own properties.
>
>
> On Fri, Jul 8, 2011 at 5:10 AM, 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
>>
>
>


-- 
http://lonestarlightandsound.com/

Reply via email to