Making "super" work outside a literal?

Axel Rauschmayer axel at rauschma.de
Sat Jun 25 14:37:51 PDT 2011


>   D = (function() {
>     __extends(D, B);
>     function D(x, y) {
>       D.__super__.constructor.call(this, x);
>       this.y = y;
>     }
>     D.prototype.m = function(z) {
>       return 1 + D.__super__.m.call(this, z);
>     };
>     return D;
>   })();


I wonder if using an IIFE isn’t counter-productive here:
- D.__super__ refers to the binding of D inside the IIFE which means that the IIFE environment is will be kept alive.

-- 
Dr. Axel Rauschmayer

axel at rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110625/6e281ea6/attachment.html>


More information about the es-discuss mailing list