Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sat, Oct 5, 2013 at 10:07 PM, James Lomax james@gmail.com wrote: Hi, this is somethings that's had me stumped for the past 6 hours now.. I have an object template which has a setter and getter for the object update which simply set/get an object handle accessible to both the setter and

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread James Lomax
Thanks, is there a special way to turn a LocalValue into a PersistentFunction? I tried changing FuncWrapper to wrap a PersistentFunction and then solved the problem of turning a Local into a persistent with this (in setWorldUpdate): fw-func =

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sun, Oct 6, 2013 at 1:40 PM, James Lomax james@gmail.com wrote: Thanks, is there a special way to turn a LocalValue into a PersistentFunction? I tried changing FuncWrapper to wrap a PersistentFunction and then solved the problem of turning a Local into a persistent with this (in

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread James Lomax
Thanks Ben, this solved the problem. I'm currently updating the code to the latest API so thank you also Greg. Let me know if I need to mark this thread as solved. On Sunday, 6 October 2013 15:53:03 UTC+1, Ben Noordhuis wrote: On Sun, Oct 6, 2013 at 1:40 PM, James Lomax

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sun, Oct 6, 2013 at 6:16 PM, James Lomax james@gmail.com wrote: So having just ported to more recent v8 I now can't figure out how to call the PersistentFunction This issue can be quickly fixed by un-privatising PersistentFunction::operator* and implementing an inline operator- within

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread James Lomax
Oh yeah, I should go read the docs, thanks : ) -- -- v8-users mailing list v8-users@googlegroups.com 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

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread ioannis
As far as i understand *correct me if i'am wrong* you cannot have an object member to act as both a property (using getter/setter) and a calling function. It should be one of the two. So i guess you will need an object member, a property to get/set the update value string and another object

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread James Lomax
You can, the problem was just that I was using a handle which went out of scope to manage the function. It works because functions are just objects in JavaScript and you can call them as such. I'm AFK ATM but I just pulled the below stuff from my dropbox mess-about project if you want to see

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread ioannis
Ah yes you are right, i didn't read the post to its entirety, i just assumed that you were setting the value to a string for some unknown reason :) ... Sorry, apologies for the confusion. On Sunday, October 6, 2013 11:43:21 PM UTC+3, James Lomax wrote: You can, the problem was just that I was

[v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-05 Thread James Lomax
Hi, this is somethings that's had me stumped for the past 6 hours now.. I have an object template which has a setter and getter for the object update which simply set/get an object handle accessible to both the setter and getter (see Things I've tried.) An object is instantiated within the