From 5e58cf6deacb503ee82556088472e73c947e88f8 Mon Sep 17 00:00:00 2001 From: deepakrkris Date: Fri, 28 Jul 2017 13:24:48 -0700 Subject: [PATCH] Fix build warnings in node 8 * Update Nan version in package.json to 2.6.2 * Use Nan::CallAsConstructor instead of v8::Object::CallAsConstructor --- package.json | 2 +- src/x509.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ed22dc3..f1c54c5 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,6 @@ }, "license": "MIT", "dependencies": { - "nan": "2.2.0" + "nan": "2.6.2" } } diff --git a/src/x509.cc b/src/x509.cc index f2c8167..e45a9bc 100644 --- a/src/x509.cc +++ b/src/x509.cc @@ -445,7 +445,8 @@ Local parse_date(ASN1_TIME *date) { Local global = Nan::GetCurrentContext()->Global(); Local DateObject = Nan::Get(global, Nan::New("Date").ToLocalChecked()).ToLocalChecked()->ToObject(); - return scope.Escape(DateObject->CallAsConstructor(1, args)); + Nan::MaybeLocal parsedDate = Nan::CallAsConstructor(DateObject, 1, args); + return scope.Escape(parsedDate.ToLocalChecked()); } Local parse_name(X509_NAME *subject) {