I'd certainly recommend using nan. However, in the new V8 API it'll look this way:
args.GetReturnValue().Set(...) On Tue, Sep 23, 2014 at 7:06 PM, blazs <blaz.sov...@gmail.com> wrote: > Thanks, this is helpful! Dramatic changes in the V8 API are giving me a > headache. > > Suppose I have the following scenario. I wrapped a C++ object v of type > NodeJsVec and I want an operation shuffle() so that var w = v.shuffle(); > gives me a new vector w, which is a randomly shuffled vector v. How do I > return a new instance from C++ callback? (Just to be clear: I want w and v > to be different vectors, and I want the C++ callback for v.shuffle() to > create the new vector.) > > On Tuesday, September 23, 2014 4:35:16 PM UTC+2, Fedor Indutny wrote: >> >> Hello! >> >> Have you seen: >> >> https://github.com/joyent/node/blob/master/doc/api/ >> addons.markdown#hello-world >> >> Cheers. >> >> On Tue, Sep 23, 2014 at 11:48 AM, blazs <blaz....@gmail.com> wrote: >> >>> Hi, >>> >>> I am looking for Node.js C++ Addon examples, written for v0.12 version >>> of the Node.js --- the one that uses V8 version 3.22. There are major >>> changes between V8 3.14 and V8 3.22, and I'd like to update my code for V8 >>> 3.22 as soon as possible. Examples on the official GitHub repository are >>> very simple and don't cover scenarios where, for instance, I would like to >>> wrap a C++ object, say a vector, then expose functions on it that would >>> allows one to create copies of that vector, etc. >>> >>> Are there any Node.js v0.12 C++ Addon examples available? >>> >>> Blaz. >>> >>> -- >>> Job board: http://jobs.nodejs.org/ >>> New group rules: https://gist.github.com/othiym23/9886289#file- >>> moderation-policy-md >>> Old group rules: https://github.com/joyent/node/wiki/Mailing-List- >>> Posting-Guidelines >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "nodejs" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to nodejs+un...@googlegroups.com. >>> To post to this group, send email to nod...@googlegroups.com. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/nodejs/ec4dc460-b824-491f-a179-5a508ff76684%40googlegroups.com >>> <https://groups.google.com/d/msgid/nodejs/ec4dc460-b824-491f-a179-5a508ff76684%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAEv2Vf%2BH0PZO%2B7SjCqsVu2-wAXGJ8BYzbzxK3-Trw8g4Nq7vug%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.