diff --git a/README.md b/README.md index defedc5..aa7f05a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Node v4.x.x/5.x.x Now Supported +Node v6.x.x/7.x.x Now Supported --------------------------- Many thanks to [Mário Freitas/imkira](https://github.com/imkira) for his work. @@ -15,7 +15,9 @@ Works/worked with NodeJS versions: * 0.8.x, * 0.10.x, * 4.x.x, -* 5.x.x +* 5.x.x, +* 6.x.x, +* 7.x.x To install, just type: diff --git a/package.json b/package.json index de501e8..8dd2187 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ "test": "node test/unittest.js" }, "dependencies": { - "nan": "~2.1.0" + "nan": "~2.5.1" } } diff --git a/protobuf_for_node.cc b/protobuf_for_node.cc index dccab0d..bf6be28 100644 --- a/protobuf_for_node.cc +++ b/protobuf_for_node.cc @@ -106,7 +106,7 @@ namespace protobuf_for_node { } Local NewObject(Local properties) const { - return Constructor()->NewInstance(1, &properties); + return Nan::NewInstance(Constructor(), 1, &properties).ToLocalChecked(); } Type(Schema* schema, const Descriptor* descriptor, Local self) @@ -139,7 +139,7 @@ namespace protobuf_for_node { Local constructor = Script::Compile(Nan::New(from.str()).ToLocalChecked())->Run().As(); - constructor->SetHiddenValue(Nan::New("type").ToLocalChecked(), self); + Nan::SetPrivate(constructor, Nan::New("type").ToLocalChecked(), self); Local bind = Script::Compile(Nan::New( @@ -427,7 +427,7 @@ namespace protobuf_for_node { Local typeTemplate = Nan::New(TypeTemplate); result = types_[descriptor] = - new Type(this, descriptor, typeTemplate->GetFunction()->NewInstance()); + new Type(this, descriptor, Nan::NewInstance(typeTemplate->GetFunction()).ToLocalChecked()); // managed schema->[type] link //