@@toStringTag spoofing for null and undefined

Brendan Eich brendan at mozilla.org
Tue Jan 20 14:19:59 PST 2015


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? Anyway, HTH.

/be


More information about the es-discuss mailing list