typed objects and value types

Andreas Rossberg rossberg at google.com
Thu Apr 3 06:09:55 PDT 2014

On 3 April 2014 14:57, C. Scott Ananian <ecmascript at cscott.net> wrote:
> You can never compare uvalues from different realms: both uvalues need
> to be in the same realm before you can do the comparison.  All you
> need is that equal uvalues in realm A become equal uvalues in realm B
> when passed over.  This is exactly how existing primitives work,
> right?

Unfortunately, that only works for primitives because the respective
constructor/wrapper class is known to exist in all realms, it is known
to be "the same" everywhere, and because the language can hence apply
some magic to "rebind" it when primitives cross realm boundaries. For
user-defined values, no such guarantees exist. Hence, no similar
rebinding magic can be applied, and values have to hold on to their
original constructor.


More information about the es-discuss mailing list