@@toStringTag spoofing for null and undefined
brendan at mozilla.org
Tue Jan 20 14:36:49 PST 2015
Mark S. Miller wrote:
> 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.
The counter-argument I inferred from the Q&A (this was in 2011, IIRC you
were there too ;-) would answer in two parts:
1. Needless-nominal type tests should be replaced by structural-type tests.
2. Any remaining brand or trademark test can use object identity or
equivalent unforgeable capability.
(2) can't be meta-programmed to spoof identity. But it doesn't leave
anything like nominal types as found in many languages lying around as
an attractive nuisance (and how, in Java!).
More information about the es-discuss