Hi,

I am new to V8 engine and starting to experiment things. I am wondering if 
it is possible to execute different functions from a Javascript file at 
different times.

Consider the following scenario:

I have a Javascript file with a global variable *foo *and two functions 
*func1() *and *func2().* Something like this:

*Test.js:*

var foo = 0;

function func1() {
      foo = 100;
}

function func2() {
      return foo + 10;
}

In my *cpp* file, I want to first execute *func1() *from Test.js*, *print 
some random statements (need not be related to using *foo*) and then call 
*func2()*. Finally, I want to print the value of *foo *in my C++ program. 
Here is what I want to do - 

*Test.cpp*

Print some statements...

Call func1()

Print some more statements...

Call func2()

Print the value of foo


Almost all of the examples that I could find takes the Javascript program 
as a string and executes it completely. However, I want to execute them in 
parts at different times. Can someone please help me to find a way to do 
this?

Thanks,
Kavin

-- 
-- 
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/d/optout.

Reply via email to