Hi,
how to call the javascript methods from v8?
i wrote one function in javascript.I want call that function from
v8.could you please give the solution.
for example:I wrote the code in js file below:
function JS_fun(num) {
var JS_Dial = {};
JS_Dial.fun_name = "sum";
JS_Dial.phonenum = num;
var JSON_Str = JSON.stringify(JS_Dial);
print(JSON_Str);
}
here JS_fun() is implemented in javascript.i need how call this
JS_fun() from v8.
some one said
---------------------
Depends on how do you get a function, you can get it from an argument
then
it would be:
v8::Local<v8::Value> func = args[x];
I think there is a way to get it from Global context too.
and if you have a function object you call it like that:
v8::Persistent<v8::Function> func =
v8::Persistent<v8::Function>::Cast(obj);
v8::Handle<v8::Value> returnObj =
func->Call(v8::Context::GetCurrent()->Global(),
<argcount>, <args>);
but, i am not getting clearly. Could you please Explain clearly.
could you write any sample example for accessing java script function.
Regards,
swathi.
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users