Hacker News new | past | comments | ask | show | jobs | submit login

Isn't it just (untested, probably full of errors):

    function super(obj, method) {
        for (var p = obj.prototype; p; p = p.prototype)
            if (p[method])
                return p[method];
        throw method+" not found";
    }
then use:

    subclass.prototype.overridden = function(x,y) {
        super(this, 'some_overriden_method').call(this, x, y);
        // ...
    }
If so, that means it's just sugar. If not, what does it do differently?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: