On 2/3/14 10:37 PM, Chris Peterson wrote:
Jeff, regarding proxies and JSClass, can you elaborate on "the idea of
classes is in the middle of deprecation in ECMAScript"?

In ES5 there's this thing called [[Class]] which in name is just a string ("Array" for arrays, "Object" for plain old objects, etc.), but also is taken to imply more than that, for the standard names like "Array", "Object", "String", etc. It's not all that clear whether classes that aren't the original Array class can have "Array" as [[Class]], or similar for the others, or whether it was desired that the methods that check an object's [[Class]] should act accordingly on them.

In ES6 [[Class]] doesn't exist. There's @@toStringTag that's the string that [[Class]] was, but it exists, mostly/solely on prototypes, only to allow Object.prototype.toString to work. The behaviors implied by [[Class]] before are now just [[GetOwnProperty]] hooks and similar, completely distinct from @@toStringTag.

So mostly ES6 gets rid of [[Class]] and splits it up into a mostly harmless @@toStringTag property, and individual customized hooks.

Jeff
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to