Add AfterInit method for Wrappable
This commit is contained in:
parent
8d537ee2b6
commit
d0db7bfb58
2 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,8 @@ void Wrappable::Wrap(v8::Isolate* isolate, v8::Handle<v8::Object> wrapper) {
|
|||
v8::Handle<v8::Function> init;
|
||||
if (Dictionary(isolate, wrapper).Get("_init", &init))
|
||||
init->Call(wrapper, 0, NULL);
|
||||
|
||||
AfterInit(isolate);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -68,6 +68,9 @@ class Wrappable {
|
|||
|
||||
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate);
|
||||
|
||||
// Called after the "_init" method gets called in JavaScript.
|
||||
virtual void AfterInit(v8::Isolate* isolate) {}
|
||||
|
||||
private:
|
||||
static MATE_WEAK_CALLBACK(WeakCallback, v8::Object, Wrappable);
|
||||
|
||||
|
|
Loading…
Reference in a new issue