hi all, i've been building under the work of others in the group who
have (like me) to link in to a compiled v8.dll from visual studio
2003. i have absolutely everything i need working very smoothly now
EXCEPT one maddening bit of behaviour -- i will frequently get access
violations when initialising the default globals at the start.

Under VS2003 you have to make a modified v8.h header (see
http://groups.google.com/group/v8-users/browse_thread/thread/138b52d4ca450c9b/f2fe0115e646e50d
for details) and supply your own default arguments, otherwise the
compiler chokes.

The problem I have is that despite using what look like the same
defaults as the regular v8.h, I end up with a potential null
dereference. Can anyone suggest better defaults than the below? I
would be eternally grateful, this is now the only thing holding me
back from production deployment!


    // create new handle scope and default context
    v8::HandleScope handle_scope;
    v8::Persistent<v8::Context> execution_context;
    v8::Persistent<v8::Value> global_object =
v8::Persistent<v8::Value>::New(v8::Handle<v8::Value>());
    v8::Persistent<v8::ObjectTemplate> global_template =
v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New());

    // now go and do stuff
    ...

It's the 3rd line, setting global_object, which usually ends up
choking. My feeling is the problem might go away if I can instantiate
using something other than "v8::Handle<v8::Value>()" (which seems to
be null), but I haven't a clue what might be suitable...  :-\

Appreciate any insights!

-A
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to