typed objects and value types

Marius Gundersen gundersen at gmail.com
Thu Apr 3 06:30:15 PDT 2014


On Thu, Apr 3, 2014 at 3:09 PM, Andreas Rossberg <rossberg at google.com>wrote:

>
> 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.
>

Wouldn't it be a security risk to send the constructor and prototype
between realms? Since the uvalue only consists of primitives and other
uvalues, it can be serialized to an object consisting of objects and
primitives. This object could then be passed into the constructor of an
equivalent uvalue, just like the original uvalue was created. This would
unfortunately add an extra step in passing uvalues between realms, but it
might just be a minor inconvenience.

Marius Gundersen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140403/7635fd6d/attachment.html>


More information about the es-discuss mailing list