Instead of using ToObject a case is probably more appropriate
v8::Handle<v8::Value> ret = script->Run();
if (ret.IsEmpty()) {
// Handle exception.
} else {
Handle<Object> result = Handle<Object>::Cast(ret);
...
}
v8::Handle<v8::Object> obj(ret);
ToObject performs the convertion in section 9.9 of the ECMAScript
Language Specification, which for something that is already an object does
nothing, so it also does the cast.
Regards,
Søren
On Wed, Jan 5, 2011 at 21:30, bradley.meck <[email protected]> wrote:
> Check Value.IsObject() and then use Value.ToObject().
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users