Allowing super to use EvaluateConstruct, or "How do I inherit from Date?"
brandon at brandonbenvie.com
Mon Jan 7 12:39:46 PST 2013
I agree with your conclusion and believe we could call the differentiation
that has existed in the spec of "called as a constructor" an anti-pattern,
in as far as it's one of those "magical" pieces of state that isn't exposed
to user-level code and thus requires even more magic (say in the form of an
$$CalledAsConstructor primitive) in order to detect it and self-host the
The solution I proposed would serve the goal of making all the builtin
classes subclassable, but would also perpetuate the "CalledAsConstructor"
anti-pattern down to the subclass level. Your solution is better, and I'm
guessing this is what you plan to do with the ES6 spec in the near future,
which makes me happy!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss