Hi Anders,
First of all thank you for link.
Now, I have a question about creating object using v8 api. My question
is that I want to create a object by using V8 APIs and access it
through javascript code. e.g suppose I have pushed a scope named
"session" through v8 api means session should be an javascript object.
Now we compile and execute a js script like:
const char *jsCode = "var a = 5; var b = session.a;"
Pesistent<Context> context = Context::New();
Context::Scope context_scope(context);
Handle<String> source = String::New(jsCode);
Handle<Script> script = Script::Compile(source);
Handle<Value> result = script->Run();
Next I want to get the value of "b" using my code:
Context::Scope context_scope(context);
Handle<String> source = String::New("b");
Handle<Value> result;
Handle<Script> script = Script::Compile(source);
Handle<Value> result = script->Run();
if(result->IsInt32())
fprintf(stderr, "Value of b = %d\n", result->Int32Value
());
Please help me for doing above thing. If possible, please provide me
sample code.
Thanks,
Manoj
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---