On Tue, Oct 15, 2013 at 10:05 AM, ashish negi <[email protected]> wrote: > I am actually making an addon for nodejs, that simulates the JS - Proxy - > Bridge. > > This addon gets a callback. Can i get the 'this' pointer i.e. v8::Object > from that callback. > The signature of callback is standard: > v8::Handle<v8::Value> > SPANodeCommunicator::SendCallBackArguments(const v8::Arguments& args)
How are you calling that function from JS land? Keep in mind that JS functions don't have a fixed `this` object; the value of `this` depends on the calling context. If you want to invoke a function f sometime in the future in the context of object o, you have to retain a reference to o. > Actually, the code of the callback has to be deferred to the future for > execution. > > I am getting exception, function is toString() on Buffer object that we get > after readFile > > Error: Uncaught TypeError: Cannot call method 'utf8Slice' of > undefined > > The code of toString is > > --> this.parent.utf8Slice(... -- -- v8-users mailing list [email protected] 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 from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
