On Mon, Sep 15, 2014 at 3:10 AM, Peter Stoyanov <[email protected]> wrote: > Hello, > > I am embedding node.js(v0.11.13) into my C++ application. I use node::Init() > and node::CreateEnvironment(). I pass a .js file to CreateEnvironment and it > is executed. > > How can I get the context of the executed script, because I want to get the > function name from JavaScript and cast it to a Function. Then I want it to > store the function in persistent Function to be able to call it later from > C++. > Or if this is not possible or too complicated is there any other way to do > it? > > Thanks, > Peter
It's not clear to me at what point in your application's life cycle you want to get hold of a reference to the context. If it's from a v8::FunctionTemplate callback, you can retrieve the context with v8::Isolate::GetCallingContext(). -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAHQurc8XeaK%2B5Kx%2BgkKUg%2BdFfLTdsauom3-XRWSLu99MFrjgaQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
