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.

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to