@@ -62,10 +62,8 @@ const Nan::Persistent<Function>& HdtDocument::GetConstructor() {
6262 Nan::SetPrototypeMethod (constructorTemplate, " _readHeader" , ReadHeader);
6363 Nan::SetPrototypeMethod (constructorTemplate, " _changeHeader" , ChangeHeader);
6464 Nan::SetPrototypeMethod (constructorTemplate, " _close" , Close);
65- Nan::SetAccessor (constructorTemplate->PrototypeTemplate (),
66- Nan::New (" _features" ).ToLocalChecked (), (Nan::GetterCallback) Features);
67- Nan::SetAccessor (constructorTemplate->PrototypeTemplate (),
68- Nan::New (" closed" ).ToLocalChecked (), (Nan::GetterCallback) Closed);
65+ constructorTemplate->PrototypeTemplate ()->SetAccessorProperty (Nan::New (" _features" ).ToLocalChecked (), Nan::New<v8::FunctionTemplate>(GetFeatures), v8::Local<v8::FunctionTemplate>());
66+ constructorTemplate->PrototypeTemplate ()->SetAccessorProperty (Nan::New (" closed" ).ToLocalChecked (), Nan::New<v8::FunctionTemplate>(GetClosed), v8::Local<v8::FunctionTemplate>());
6967 // Set constructor
7068 constructor.Reset (Nan::GetFunction (constructorTemplate).ToLocalChecked ());
7169 }
@@ -701,7 +699,7 @@ NAN_METHOD(HdtDocument::FetchDistinctTerms) {
701699
702700
703701// Gets a bitvector indicating the supported features.
704- NAN_PROPERTY_GETTER (HdtDocument::Features ) {
702+ NAN_METHOD (HdtDocument::GetFeatures ) {
705703 HdtDocument* hdtDocument = Unwrap<HdtDocument>(info.This ());
706704 info.GetReturnValue ().Set (Nan::New<Integer>(hdtDocument->features ));
707705}
@@ -732,7 +730,7 @@ NAN_METHOD(HdtDocument::Close) {
732730
733731
734732// Gets a boolean indicating whether the document is closed.
735- NAN_PROPERTY_GETTER (HdtDocument::Closed ) {
733+ NAN_METHOD (HdtDocument::GetClosed ) {
736734 HdtDocument* hdtDocument = Unwrap<HdtDocument>(info.This ());
737735 info.GetReturnValue ().Set (Nan::New<Boolean>(!hdtDocument->hdt ));
738736}
0 commit comments