In an application with multiple V8 engines where I preload Javascript in
various different contexts I print out the status of the Global object for
debugging purposes.
Most of the time things are fine but once in a while I get weird behavior.
While printing the global object with code which essentially is the
following:
this->iso->Enter();
HandleScope handle_scope;
this->context->Enter();
Local<Object> obj = this->context->Global();
const Local<Array> props = obj->GetPropertyNames();
const uint32_t length = props->Length();
for (uint32_t i=0 ; i<length ; ++i) {
const Local<Value> key = props->Get(i);
const Local<Value> value = obj->Get(key);
string keys = V8ValueToString(key);
if (value->IsFunction()) {cout << "VALUE IS Function " << keys
<< endl;}
String::Utf8Value utf (value->ToString());
if ( *utf == 0 ) {cerr << "Conversion failed " << keys <<
endl;}
else {cout << "conversion gave " << format ("%s", *utf) <<
endl;}
The conversion of the value fails and I get a 0-pointer. This is usually
the case where the value IsFunction().
Also, the String::Utf8Value function prints some weird error message to
stdout:
<unknown>:-1: <error>
Any ideas where I could get started debugging this? Or why this error
message is generated?
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.