Domenic Denicola wrote:
On Oct 1, 2012, at 18:58, "Brendan Eich"<bren...@mozilla.org> wrote:
I am warming up to the way CoffeeScript does things -- not the translation
scheme, __extends, __super__ -- rather, the plain Object instance created as
C.prototype that has B.prototype as its [[Prototype]] but has shadowing
'constructor' set to C.
If I'm understanding correctly, this would be the same as
C.prototype = Object.create(B.prototype);
C.prototype.constructor = C;
Yes, CoffeeScript simply uses the older pattern (beget, goes back a long
way to comp.lang.javascript, IIRC) to work on pre-ES5 engines.
which I thought was the "recommended" approach (although by who or where, I
admit I can't quite pinpoint). Am I on the right track? And can anyone else comment on
the commonality or recommendedness of this pattern, to see if we're paving the right cow
paths?
Would be good to confirm, but I think this is the one all the finest
cows favor ;-).
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss