inheriting statics

Brendan Eich brendan at
Sun Jan 7 11:32:13 PST 2007

On Jan 7, 2007, at 9:50 AM, Peter Hall wrote:

> "Since inheritance does not apply to static members"
> Your assumption is what I was questioning. Why doesn't inheritance
> apply to static members?

Right, the assumption should be justified.  One rationale is by  
extension of ES1-3 (plain ol' JS):

function SpecialString(s) { this.value = s; }
SpecialString.prototype = new String;
SpecialString.prototype.toString = function () { return this.value; }
s = new SpecialString("hello");
t = s.charCodeAt(3);

The last line throws TypeError: SpecialString.fromCharCode is not a  

Inclusion of statics in the scope chain within instance methods is a  
convenience afforded by the new special form of methods defined via  
function definitions nested in a class definition. But it's not  


More information about the Es4-discuss mailing list