Read access to [[Class]]?

John-David Dalton john.david.dalton at
Sat Jan 28 16:07:53 PST 2012


> We want to be able to define things that were historically implemented as "host objects" using pure ECMAScript code. One things such objects have done is to extend the range of values produced by Object.prototype.toString.  So, we need a pure ECMAScript way to accomplish that.

You could simplify it by making `NativeArray = "Array"` and
`NativeRegExp = "RegExp"` and so on. Then you could drop the "Tags"
table and extending the range of Object#toString is as easy as adding
a custom [[NativeBrand]] property value.


More information about the es-discuss mailing list