On Thu, Feb 13, 2025 at 11:23 AM Charles Lew <[email protected]> wrote: > > I'm seeking for a way to share the same JSRealm with different v8 contexts, > so they share the same `Object` values in memory, but with different global > values. > > Currently when evaluating `a instanceof Object` with `a` value defined from > another context, this evaluates to false, which is not what i want. > > What i've tried: > I've tried overwriting one context's global `Object` with value from another > context, which seems ok at first, but it's flawed in corner cases, that > literal object values still uses the V8::Context's original Object prototype. > > Is there a way to accomplish what i want?
No. It's the most asked question about node's vm module (which is also based around contexts) by a mile but there's no good way to do it. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/v8-users/CAHQurc-%2B_UR7tQHi6HetJsVx-bkwmMa%3D7JX%2BTEp4RObx5yjUng%40mail.gmail.com.
