The latest code changes the callback function signature that you pass to the MakeWeak function. The function signature should take a Value type instead of an Object type like this: void objectDestroy(v8::Persistent<v8::Value> self, void* parameter);
Then when you call: foo.MakeWeak(0, objectDestroy); the compiler will see a callback function with the correct sig. Corey On Oct 28, 4:52 pm, august <[EMAIL PROTECTED]> wrote: > this code has been really really helpful. > > what compiler are you guys using? > > I keep getting these errors with g++ version 4.2.4: > > v8test.cpp: In function 'v8::Handle<v8::Value> Point_Create(const > v8::Arguments&)': > v8test.cpp:123: error: invalid conversion from 'void (*) > (v8::Persistent<v8::Object>, void*)' to 'void (*) > (v8::Persistent<v8::Value>, void*)' > v8test.cpp:123: error: initializing argument 2 of 'void > v8::Persistent<T>::MakeWeak(void*, void (*)(v8::Persistent<v8::Value>, > void*)) [with T = v8::Object]' > scons: *** [v8test.o] Error 1 > scons: building terminated because of errors. > > thanks -august. > > On Oct 8, 2:27 am, gritzko <[EMAIL PROTECTED]> wrote: > > > At v8test.cpp:59 I have a bug. It does not surface in this sample, but > > causes weird behavior in my big program, so: > > > < pointtemplate = *pointFunctionTemplate; > > --- > > > > pointtemplate = > > > Persistent<FunctionTemplate>::New(pointFunctionTemplate); > > > What is the semantics of Persistent<T>(Handle<S>) and > > Persistent<T>(S*) constructors? > > The behavior is totally different from Persistent<T>::New(Handle<S>). > > I've got into this trap twice. > > > On Oct 8, 10:44 am, Victor Grishchenko <[EMAIL PROTECTED]> > > wrote: > > > > On Oct 7, 2008, at 10:42 PM, Ben Nolan wrote: > > > > > hi victor, study Jacobs example it works correctly with javascript > > > > extensions. > > > > Cool. It works. I added an example of object wrapping. --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
