I've bound a class and a simple C++ print function to v8.
The print function looks like this:
Handle<Value> v8Print( const Arguments& args )
{
bool first = true;
for( int i = 0; i < args.Length(); ++i )
{
HandleScope handleScope;
if( first )
first = false;
else
std::cout << ' ';
String::AsciiValue ascii(args[i]);
std::cout << *ascii; // Access violation because of
NULL pointer in
ascii
}
std::cout << std::endl;
return Undefined();
}
The print function works swell with strings and such, but in a test I
put an instance of my class as an argument for the print function. The
AsciiValue conversion seem to fail silently and its member str_ equals
NULL, which leads to an access violation in the std::cout line.
Is there something I should define for my class in order for this
conversion to work or is this a bug? I figured it'd convert to the
string "[object Object]"
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users