On Thu, Feb 13, 2025 at 2: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.
>
>
this can work as a workaround ... if( obj.constructor.name === "Object" )

but probably the better answer is 'don't do that'.


> 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?
>
> --
> --
> 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/1fb15c01-198a-4ef2-8705-a78265eb0691n%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-users/1fb15c01-198a-4ef2-8705-a78265eb0691n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
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/CAA2GJqW0vdfmW0Vi3wOzwR2g6iBJ8q488u9PaK17E%2BJZukKU4Q%40mail.gmail.com.

Reply via email to