I'm just trying to understand nan/node native extensions.

First question, class hierachy when wrapping C++ stuff.

Is unwrapping a static cast? (So far I guess so ) or can it in fact be a
dynamic cast?

Say I got in C++ Wrapper AClass and Wrapper BClass that both inherit
from Wrapper MasterClass.

Can I put in

NAN_METHOD( myFunc )
{
   MasterClass *mc = Nan::ObjectWrap::Unwrap<MasterClass>( info[ 0
]->ToObject( ) );
}

and have it work when javascript hands a Wrapper for AClass or BClass?

If not, how can I determine which type of wrapped object javascript handed
to myFunc?

Second question:

How can I throw an javascript Exception from native if its simple sync code
without I/O. Usually should do when the arguments are not what they need to
be.

Kind regards, Axel

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CABg07fvu-V0shhDGB5wS3SeegG-z_ut6D%2BaoYrNQGVUtx3KK%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to