Making "super" work outside a literal?

Allen Wirfs-Brock allen at
Sun Jun 26 15:05:21 PDT 2011

On Jun 26, 2011, at 8:48 PM, Brendan Eich wrote:

> But I still wonder if we wouldn't be better off restricting where super can occur. I can't prove it, but we are following in the universal-'this' footsteps (but with static or else Object.defineMethod binding). That sounds a warning bell in my head.

While I highly support improving ECMAScript's declarative mechanisms for defining object abstractions I'd be pretty concerned if we had object abstraction forms that can only be created declaratively.  The ability to use reflection to construct such abstractions has already proven its worth both in JS and in other languages.  Having forms of methods that can't be created via reflection seems a step backwards.   BTW there are other proposals floating around that also have this characteristic, for example perhaps some of the private property proposals. We need to be concerned about those too.

It is important to find a good balance between power and bullet-proof footwear.  But, intentionally restricting an imperatively constructed object from using |super| in order to prevent foot shooting seems   very un-JS like.

More tomorrow, goodnight.


More information about the es-discuss mailing list