I generated Doxygen documentation for V8's v8.h, and it says that
Script::New isn't context specific. If that's the case, why does it need
Context::Scope?
This seems to be what I have to do:
void* script_new(void *iso, void *ctx, char *src) {
Isolate *isolate = Isolate::New();
isolate->Enter();
HandleScope handle_scope(isolate);
Handle<Context> context = Context::New(isolate);
Context::Scope context_scope(context);
Persistent<Script> *script = new Persistent<Script>(isolate,
Script::New(String::New(src)));
isolate->Exit();
return script;
}
These lines being the ones specifically needed for Script::New:
Handle<Context> context = Context::New(isolate);
Context::Scope context_scope(context);
With String::New it seems to work without these two lines.
Anyone know why this is the case?
Luke
--
--
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].
For more options, visit https://groups.google.com/groups/opt_out.