super question

Kris Zyp kriszyp at xucia.com
Fri Jun 8 10:49:05 PDT 2007


I was wondering if the *super* keyword causes base limiting only in classes,
or in delegate chains as well. For example:
function MyObj() { }
MyObj.prototype.formatValue = function() { return "value: " + this.value };
var myObj = new MyObj;
myObj.value = 10;
myObj.formatValue = function() { return "The value is: " + super.formatValue();
}

If I called myObj.formatValue() would it go up the delegate chain to call a
super formatValue? Would calling myObj.formatValue() return "The value is:
value: 10" (as it would seem logical to me that it would)? Or does super
only apply to super/sub classes?
Thanks,
Kris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20070608/4cae1a42/attachment-0002.html 


More information about the Es4-discuss mailing list