@@ -106,7 +106,7 @@ namespace protobuf_for_node {
106106 }
107107
108108 Local<Object> NewObject (Local<Value> properties) const {
109- return Constructor ()-> NewInstance ( 1 , &properties);
109+ return Nan::NewInstance ( Constructor (), 1 , &properties). ToLocalChecked ( );
110110 }
111111
112112 Type (Schema* schema, const Descriptor* descriptor, Local<Object> self)
@@ -139,7 +139,7 @@ namespace protobuf_for_node {
139139
140140 Local<Function> constructor =
141141 Script::Compile (Nan::New<String>(from.str ()).ToLocalChecked ())->Run ().As <Function>();
142- constructor-> SetHiddenValue ( Nan::New<String>(" type" ).ToLocalChecked (), self);
142+ Nan::SetPrivate (constructor, Nan::New<String>(" type" ).ToLocalChecked (), self);
143143
144144 Local<Function> bind =
145145 Script::Compile (Nan::New<String>(
@@ -427,7 +427,7 @@ namespace protobuf_for_node {
427427
428428 Local<FunctionTemplate> typeTemplate = Nan::New (TypeTemplate);
429429 result = types_[descriptor] =
430- new Type (this , descriptor, typeTemplate->GetFunction ()-> NewInstance ());
430+ new Type (this , descriptor, Nan::NewInstance ( typeTemplate->GetFunction ()). ToLocalChecked ());
431431
432432 // managed schema->[type] link
433433 //
0 commit comments