On Fri, Sep 25, 2009 at 4:24 PM, Charles Jolley <[email protected]> wrote: > But just to be clear, after all of the discussion here, it appears that the > only way to implement a "call super" pattern in ES5 (without resorting to > closures as Breton suggested) would be to use the following magic phrase > everywhere I want to invoke super: > > var IS_ES5_STRICT = /** detect ES5 strict mode somehow */ > > ClassB = ClassA.extend({ > foo: function method() { > (IS_ES5_STRICT ? method : arguments.callee).base.apply(this, arguments); > } > });
If I were a poor woodcutter who couldn't afford his own preprocessing tools, I would probably just write: ClassB.foo.base.apply(this, arguments) I think web developers will be OK. Real Tools are getting more and more common. -j _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

