There's no problem in creating as much Context objects as needed per 
Isolate.
When trying to detach an object from a context to reference it from another 
one, make sure both context objects share the same security token 
(SetSecurityToken) otherwise the operation will fail.

I don't really see why you'd like to create another context to 
load/compile/run javascript and then get a Context object reference to set 
on another Context. If it is for code privacy, wrapping the file contents 
on a different scope, pretty much like nodejs does would suffice.
Take into account that creating a Context is an expensive operation in 
every sense.

Hope that helps.

El sábado, 8 de julio de 2017, 16:31:23 (UTC+2), Florent S. escribió:
>
> Hi everyone!
>
> I'm looking for a way to create a sub-context, that is a context that 
> inherit from another context.
>
> The goal is to simulate the import feature.
>
> 1/ Create a global context
> 2/ Load and excute main script
> 3/ import creates a sub-context
> 4/ Load and execute the imported script in the sub-context
> 5/ copy some stuff from the sub-context back into the global context
>
> I can't find a decent way to do so ...
>
> Any clue ?
>
> Regards, 
> Florent
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to