Making "super" work outside a literal?

Axel Rauschmayer axel at rauschma.de
Thu Jun 23 22:39:52 PDT 2011


>> Related topic: How would |super| be handled if |this| is lexical?
> 
> There's no connection, AFAIK. But we also don't have a lexical-this proposal in Harmony yet.

I would expect problems that are similar to that = this:

var obj = {
    mymethod: function(arr) {
        arr.forEach(function(x) {
            super.mymethod(x); // would this work?
        });
    }
}

Thankfully, I don’t think that super-calls will be very common in typical JavaScript code, in contrast to "this".

-- 
Dr. Axel Rauschmayer

axel at rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com





More information about the es-discuss mailing list