| 13 | class MyObject : public ObjectWrap { |
| 14 | public: |
| 15 | static NAN_MODULE_INIT(Init) { |
| 16 | v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New); |
| 17 | tpl->SetClassName(Nan::New("MyObject").ToLocalChecked()); |
| 18 | tpl->InstanceTemplate()->SetInternalFieldCount(1); |
| 19 | |
| 20 | SetPrototypeMethod(tpl, "getHandle", GetHandle); |
| 21 | SetPrototypeMethod(tpl, "getHandleConst", GetHandleConst); |
| 22 | SetPrototypeMethod(tpl, "getValue", GetValue); |
| 23 | |
| 24 | constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); |
| 25 | Set(target, Nan::New("MyObject").ToLocalChecked(), |
| 26 | Nan::GetFunction(tpl).ToLocalChecked()); |
| 27 | } |
| 28 | |
| 29 | private: |
| 30 | explicit MyObject(double value = 0) : value_(value) {} |
nothing calls this directly
no test coverage detected