News for hackers. Stuff that matters.
Re:Improving EcmaScript5 OO with sugar by Autre on Tuesday November 22, 2011 @07:37AM (#3265246)
Yeah, it gets really hairy, really quickly.

Beyond the need for calling the constructor (which I'm currently viewing it as an unnecessary hidrance [objects are already initialized]), Object.getPrototypeOf may provide a way out - but maybe not the way you intended. Have you considered it?

Re:Improving EcmaScript5 OO with sugar by Raynos on Tuesday November 22, 2011 @07:59AM (#3265329)

    Object.getPrototypeOf(Child).constructor.apply(this, arguments);
Works, but is even more verbose. However if you use Object.getPrototypeOf on this you fail the recursive problem in nest super calls. Read the stackoverflow euestion
Re:Improving EcmaScript5 OO with sugar by Autre on Tuesday November 22, 2011 @09:19AM (#3265564)
I was deliberately excluding the constructor situation. I should have made that clearer in my previous comment. I think the way out of the constructor mess is not to require them at all.

I do think the Object.getPrototypeOf approach is feasible for methods.

Re:Improving EcmaScript5 OO with sugar by Raynos on Tuesday November 22, 2011 @10:49AM (#3265941)
the method fails for the exact same reason.

If a single method calls a super method and that method calls another super method then it fails.

    Object.getPrototypeOf(this).method
Always have one value and only one value, calling it more then once leads to infinite recursion.