[Harmony Proxies] Proposal: Property fixing

Cameron McCormack cam at mcc.id.au
Thu May 12 19:09:38 PDT 2011

Allen Wirfs-Brock:
> I'm still hopeful that I can eliminate [[Class]] entirely from the
> ES.next specification.
> What is WebIDL really trying to accomplish when it specifies class
> values. Parameterizing toString. Trademarking objects? Something else.
> All the use cases I have seen for [[class]] an be accomplished some
> other way rather than by over-loading this specification device with
> additional meanings.

All it is trying to accomplish is making
Object.prototype.toString.call(object) return the kinds of values that
websites expect.  Websites are doing that to check the type of the
object they’ve got, yes.

> See
> http://wiki.ecmascript.org/doku.php?id=strawman:es5_internal_nominal_typing
> for a sketch of what I have in mind

Being able to parameterise Object.prototype.toString is all that’d be
needed.  I suppose that can’t be done just with a self-contained Proxies
spec, but requires changes to the Object.prototype.toString definition.

Cameron McCormack ≝ http://mcc.id.au/

More information about the es-discuss mailing list