Using "super" in static methods?

Topics: Language Specification
Feb 28, 2013 at 2:00 PM
Hi,

why isn't it possible to use "super" in static methods?
class Foo
{
    static fooBar()
    {
        
    }
}

class Bar extends Foo
{
    static fooBar()
    {
        super.fooBar();
    }
}
That gives an error "Keyword 'super' can only be used inside a class instance method". But why is it so? The compiled code looks so:
var __extends = this.__extends || function (d, b) {
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
var Foo = (function () {
    function Foo() { }
    Foo.fooBar = function fooBar() {
    };
    return Foo;
})();
var Bar = (function (_super) {
    __extends(Bar, _super);
    function Bar() {
        _super.apply(this, arguments);

    }
    Bar.fooBar = function fooBar() {
        _super.prototype.fooBar.call(this);
    };
    return Bar;
})(Foo);
Is there a way to compile static "super" calls to:
        _super.fooBar.call(this);
instead of:
        _super.prototype.fooBar.call(this);
and add the lines:
    for(i in b)
    {
        d[i] = b[i];
    }
    d.parent = b;
to the "__extend"-function?

Thanks