| 42 | } |
| 43 | |
| 44 | NAN_MODULE_INIT(SetterGetter::Init) { |
| 45 | v8::Local<v8::FunctionTemplate> tpl = |
| 46 | Nan::New<v8::FunctionTemplate>(SetterGetter::New); |
| 47 | settergetter_constructor.Reset(tpl); |
| 48 | tpl->SetClassName(Nan::New<v8::String>("SetterGetter").ToLocalChecked()); |
| 49 | tpl->InstanceTemplate()->SetInternalFieldCount(1); |
| 50 | SetPrototypeMethod(tpl, "log", SetterGetter::Log); |
| 51 | v8::Local<v8::Function> createnew = |
| 52 | Nan::GetFunction(Nan::New<v8::FunctionTemplate>(CreateNew)) |
| 53 | .ToLocalChecked(); |
| 54 | Set(target, Nan::New<v8::String>("create").ToLocalChecked(), createnew); |
| 55 | } |
| 56 | |
| 57 | v8::Local<v8::Value> SetterGetter::NewInstance () { |
| 58 | EscapableHandleScope scope; |
nothing calls this directly
no test coverage detected