Implementing inheritance in node.js bindings
问题 I am writing Node.js bindings around a C++ library. I can identify key objects in the C++ library that I can expose as classes to the Node.js (i.e. derivatives of ObjectWrap). I can also see an inheritance relationship between these objects. How can I expose ClassA , ClassB , ClassC as node.js classes (derivatives of ObjectWrap ) and manipulate their prototypes (in v8 C++ code) so that ClassB and ClassC are derivates of ClassA ? 回答1: This can be done using v8::FunctionTemplate 's Inherit