I’ve started with the most basic example from the Getting Started page
(which compiles and works fine), and added a very small amount of
extra code to explore the possibility of using objects from one
context as the prototype for the globals of another context.
Unfortunately, the code segfaults unless the `context-
>ReattachGlobal(global);` statement is commented out (and, if it is
commented out, the code obviously doesn’t work, as the modified global
is discarded).
Additionally, with a few minor modifications, it would loop endlessly,
using 100% of one core on my machine until SIGKILL’d.
context->DetachGlobal();
Handle<Object> global = context->Global();
global->SetPrototype(sandbox);
context->ReattachGlobal(global);
This *seems* to be completely basic/obvious/idiomatic application of
`DetachGlobal` and `ReattachGlobal`, but it Doesn’t Work™. What am I
doing wrong, or is this a bug?
Full code and segfault: https://gist.github.com/9bb782d191532261e26e
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users