On Thu, Apr 3, 2014 at 3:09 PM, Andreas Rossberg <rossb...@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
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss