Imagine

class Foo {
   function name() {
         return "foo"
   }
}

class Bar : Foo { // s/:/extends or whatever
   function name() {
         super.name();
   }
}

class Wibble : Bar {
   function name() {
         super.name();
   }
}

the call to super.name() essentially desugars to:

this.__proto__.name.call(this, ...)

But this.__proto__ will be the same everywhere, so someWibble.name() will 
infinitely recurse when it reaches Bar::name

Hope this helps.

--Oliver

On Sep 30, 2011, at 7:38 PM, John J Barton wrote:

> On Fri, Sep 30, 2011 at 5:47 PM, Axel Rauschmayer <[email protected]> wrote:
>> 
>> Isn't it just a matter of referring to the property with "super"?
>> class Pirate {
>>   get name() {
>>     return "Captn' " + super.name;
>>   }
>> }
> 
> just trying to understand: how is super different from __proto__?
> jjb
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss

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

Reply via email to