@@toStringTag spoofing for null and undefined

Mark S. Miller erights at google.com
Tue Jan 20 14:25:25 PST 2015

On Tue, Jan 20, 2015 at 2:19 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Mark S. Miller wrote:
>>     Yes, we want to complete the MOP so nominal types are equivalent
>>     to branded structural types, a la Modula 3, and per David Ungar's
>>     position articulated many times over the years (I heard David say
>>     it to Tom Van Cutsem in person at SPLASH 2011, re: Proxies not
>>     interceding fully for all types). But we aren't there yet.
>> I don't understand this paragraph. Are you saying that you want a proxy
>> to be able to intercept and emulate the brand check, while somehow
>> preserving the integrity implied by the brand check?
> I'm saying we (TC39, or many on it who've spoken up over the years) aspire
> to make the JS MOP expressive enough to allow, e.g., implementing bad old
> ES1-3 "host objects" via proxies, and even emulating primitive or value
> types (value proxies, Cormac Flanagan et al.).
> For some things such as the old WebIDL "caller" extended attribute, which
> enabled document.all(id) in lieu of document.all[id], we've instead trimmed
> licit (but not de-facto) host-object expressiveness to remove the bad old
> thing.
> IIRC David Ungar's question to Tom was "why not enable proxies to
> mega-program every base-level operation in the language?" I took this to
> mean nothing like a nominal type check could evade proxying, in David's
> vision. Is this plausible in your view?

No it is not. It destroys the whole point of branding if passing a brand
check guarantees nothing.

> Anyway, HTH.
> /be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150120/50e677ca/attachment.html>

More information about the es-discuss mailing list