Allen Wirfs-Brock wrote:
Any observable features I missed?
The relationship between the constructor and the prototype. EG:
Builtin.prototype.constructor === Builtin
Right! I forgot this a minute ago after showing how CoffeeScript does
it. D'oh.
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.
With a rule to set @@toStringTag by default (or not), and some attempt
to match legacy built-ins (I'm thinking about trying this on in
SpiderMonkey), we might have a regular set of rules for this stuff.
The safest course might still be to set @@toStringTag to "C" in
C.prototype, along with 'constructor'. That would fake things up to
match legacy built-ins except where they provide a communication channel.
I'd still want to close that channel, by making Date.prototype a
dressed-up Object instance. But this would be less risky than making its
tag-testable "class name" be "Object".
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss