swathi jakkam
unread,Apr 17, 2012, 7:30:26 AM4/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to v8-users
Hi,
I am getting error in below line
v8::Local<v8::Function> func2 = v8::Local<v8::Function>::Cast(context-
>Global()->Get(v8::String::New("JS_dump")));
I am getting following error
I got Fatal error in v8::Function::Cast() Could not convert to
function
How to resolve the this type of error.Could you please any one tell
the solution.???????
Actually my code is
char *script_name = "tt.js";
char *script = ReadFile(script_name);
if(!script){
printf("Unable to execute script.js");
return false;
}
//convert the string with the script to a v8 string
v8::Handle<v8::String> source = v8::String::New(script,
strlen(script));
v8::Handle<v8::Script> script2 = v8::Script::Compile(source);
script2->Run();
v8::Local<v8::Function> func2 = v8::Local<v8::Function>::Cast(context-
>Global()->Get(v8::String::New("JS_dump")));
v8::Handle<v8::Value> result2 = func2->Call(func2, 0, NULL);
printf("Function result: %d\n", result2->Int32Value());
//end of the code
How to solve this issue.
thanks,
swathi.