Quick questions: Contexts and objects

31 views
Skip to first unread message

Kevin Ingwersen

unread,
Apr 8, 2014, 8:02:59 PM4/8/14
to v8-u...@googlegroups.com
Hey!

In my nodejs extensions, I never had to really worry for things like this. But now, for my own program, I am given a v8::Context. If I now call Object::New(), will this apply to the context that was given to me? The function receives the context as a parameter:


virtual void DidCreateScriptContext(WebKit::WebFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
int world_id) {}


Kind regards,
Ingwie

Ben Noordhuis

unread,
Apr 9, 2014, 1:02:49 PM4/9/14
to v8-u...@googlegroups.com
On Wed, Apr 9, 2014 at 2:02 AM, Kevin Ingwersen
<ingwi...@googlemail.com> wrote:
> In my nodejs extensions, I never had to really worry for things like this. But now, for my own program, I am given a v8::Context. If I now call Object::New(), will this apply to the context that was given to me? The function receives the context as a parameter:

The object is created in the most recently entered context. That
could be - but is not necessarily - the Context that is handed to your
function. If you don't want to take chances, create a Context::Scope.
Reply all
Reply to author
Forward
0 new messages