You can - simply set a property called "toString" and assign it to an InvocationCallback function of your choice. For an example:
http://code.google.com/p/v8-juice/source/browse/extra-plugins/src/ncurses-oo/v8-nc.cc search that file for "nc_window_tostring" On 3/31/09, [email protected] <[email protected]> wrote: > > hi! > >> test.toString = function() { return "[object MyType name="+this.name+"]";} >> >> for purposes of print(), you never need to explicitly call toString() >> - that will happen automatically. > > Very nice solution, however I was hoping to be able to do that within > my C++ Code somehow without requiring to run some js code.. > > Anyone? > > Thanks! Alex > > > -- ----- stephan beal http://wanderinghorse.net/home/stephan/ --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
