node-api: implement JS inheritance from C++
This serves to outline the basic idea before implementing the rest (unit testing):
- cut
napi_define_class
in two -napi_declare_class
andnapi_instantiate_class
- the new
napi_define_class
is simply a helper that calls both -
napi_declare_class
returns a new type ofnapi_value
that can be callednapi_class
that is essentially av8::FunctionTemplate
- this new type of value supports inheritance
- on engines other than V8, where
Function
andFunctionTemplate
are implemented as one object, this new napi value will simply be theFunction