On Mon, Jul 17, 2017 at 3:27 PM, <[email protected]> wrote: > Hello, > > I am trying to pass a function pointer through a string pipe and recover it > on the other end. It seems that if serialization to a string is possible and > I can deserizalize the string in C++ to a v8::Object or a v8::Function, it > would be invoked or assigned to a JS property value. > > Example: > > Given that we have executed the following script and captured the value of > variable W in C++: > > var W = function(){ console.log('blah'); /* this may be a native function > too */ }; > var C = {}; > > I would like to serialize the value of W variable and later on, when I am > still sure that referred functions/context exist, I would like to > deserialize the data into C.W2 and invoke C.W2 from javascript. > > W2 should point to the same function as W after deserialization. > > > Regards, > > Kerem.
Functions don't have fixed addresses (they are dynamically generated code blobs and can be moved around) so I don't think what you want is going to work. -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
