| 55 | } |
| 56 | |
| 57 | v8::Local<v8::Value> SetterGetter::NewInstance () { |
| 58 | EscapableHandleScope scope; |
| 59 | v8::Local<v8::FunctionTemplate> constructorHandle = |
| 60 | Nan::New(settergetter_constructor); |
| 61 | v8::Local<v8::Object> instance = |
| 62 | Nan::NewInstance(Nan::GetFunction(constructorHandle).ToLocalChecked()) |
| 63 | .ToLocalChecked(); |
| 64 | SetAccessor( |
| 65 | instance |
| 66 | , Nan::New("prop1").ToLocalChecked() |
| 67 | , SetterGetter::GetProp1); |
| 68 | SetAccessor( |
| 69 | instance |
| 70 | , Nan::New<v8::String>("prop2").ToLocalChecked() |
| 71 | , SetterGetter::GetProp2 |
| 72 | , SetterGetter::SetProp2 |
| 73 | ); |
| 74 | return scope.Escape(instance); |
| 75 | } |
| 76 | |
| 77 | NAN_METHOD(SetterGetter::New) { |
| 78 | SetterGetter* settergetter = new SetterGetter(); |
nothing calls this directly
no test coverage detected