[v8-users] Re: running a script...

2014-01-28 Thread Pierre Saunier
Thanks a lot, I figure it also... But, I have still 3 (related) questions: Why Persistent are not a subclass of handle? so that it is possible to use Handle (Local) and persistent in the same way, without the need to do a cast? And what is the difference between a weak and non weak persistent?

Re: [v8-users] Re: running a script...

2014-01-28 Thread Jochen Eisinger
On Tue, Jan 28, 2014 at 9:20 AM, Pierre Saunier pierre.saun...@ppmodeler.com wrote: Thanks a lot, I figure it also... But, I have still 3 (related) questions: Why Persistent are not a subclass of handle? so that it is possible to use Handle (Local) and persistent in the same way, without the

[v8-users] Re: running a script...

2014-01-28 Thread Pierre Saunier
thanks, that is clear. but that means i have to store a persistent object for every c++ object I create so that i can go from javascript objet to c++ object and vice versa.. . so, either i add the field persistent::object to my class, which links strongly my code to v8 or i need to have an

Re: [v8-users] Re: running a script...

2014-01-28 Thread Kevin Ingwersen
What exactly do you want to store; just one class instance - or do you have an existing C++ class that you are extending to be v8 compatible? There is a giant difference between these cases. The first case is what I am doing for nodejs currently; I am taking an existing c++ class (Fl_Window)

[v8-users] Re: running a script...

2014-01-28 Thread Pierre Saunier
It is very simple: I want to set javascript callback functions where the first parameter is a javascript object. so I have a C++ object, let say a button. When the button is pressed, a callback function is called with the button in parameter. In my v8 code, I create an persistent object template