From a0faef9e654ba838ad709fb4d219bbb02aae0b66 Mon Sep 17 00:00:00 2001 From: Keegan Brown Date: Mon, 5 Oct 2015 13:53:34 -0500 Subject: [PATCH] Here goes nothing... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So apparently Nan v2 has removed Handle and uses Local instead. Not sure wtf that’s all about. I have no idea if this works, but it builds in both node v4.1.1 and v0.12.7 and passes the included tests in both. --- src/CascadeClassifierWrap.cc | 2 +- src/FaceRecognizer.cc | 8 ++++---- src/FaceRecognizer.h | 2 +- src/Features2d.cc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CascadeClassifierWrap.cc b/src/CascadeClassifierWrap.cc index c3dce38..49d347f 100755 --- a/src/CascadeClassifierWrap.cc +++ b/src/CascadeClassifierWrap.cc @@ -82,7 +82,7 @@ public: Nan::HandleScope scope; // this->matrix->Unref(); - Handle < Value > argv[2]; + Local < Value > argv[2]; v8::Local < v8::Array > arr = Nan::New < v8::Array > (this->res.size()); for (unsigned int i = 0; i < this->res.size(); i++) { diff --git a/src/FaceRecognizer.cc b/src/FaceRecognizer.cc index 1b2eb82..8bb1bfa 100644 --- a/src/FaceRecognizer.cc +++ b/src/FaceRecognizer.cc @@ -29,7 +29,7 @@ void AfterAsyncPredict(uv_work_t *req); Nan::Persistent FaceRecognizerWrap::constructor; -void FaceRecognizerWrap::Init(Handle target) { +void FaceRecognizerWrap::Init(Local target) { Nan::HandleScope scope; // Constructor @@ -135,7 +135,7 @@ FaceRecognizerWrap::FaceRecognizerWrap(cv::Ptr f, typ = type; } -Handle UnwrapTrainingData(Nan::NAN_METHOD_ARGS_TYPE info, +Local UnwrapTrainingData(Nan::NAN_METHOD_ARGS_TYPE info, cv::vector* images, cv::vector* labels) { if (info.Length() < 1 || !info[0]->IsArray()) { @@ -176,7 +176,7 @@ NAN_METHOD(FaceRecognizerWrap::TrainSync) { cv::vector images; cv::vector labels; - Handle exception = UnwrapTrainingData(info, &images, &labels); + Local exception = UnwrapTrainingData(info, &images, &labels); if (!exception->IsUndefined()) { info.GetReturnValue().Set(exception); // FIXME: not too sure about returning exceptions like this } @@ -199,7 +199,7 @@ NAN_METHOD(FaceRecognizerWrap::UpdateSync) { cv::vector images; cv::vector labels; - Handle exception = UnwrapTrainingData(info, &images, &labels); + Local exception = UnwrapTrainingData(info, &images, &labels); if (!exception->IsUndefined()) { JSTHROW(exception); } diff --git a/src/FaceRecognizer.h b/src/FaceRecognizer.h index 6a19d10..e4db0df 100644 --- a/src/FaceRecognizer.h +++ b/src/FaceRecognizer.h @@ -10,7 +10,7 @@ public: int typ; static Nan::Persistent constructor; - static void Init(Handle target); + static void Init(Local target); static NAN_METHOD(New); FaceRecognizerWrap(cv::Ptr f, int type); diff --git a/src/Features2d.cc b/src/Features2d.cc index ce09abc..d6c7179 100644 --- a/src/Features2d.cc +++ b/src/Features2d.cc @@ -82,7 +82,7 @@ public: void HandleOKCallback() { Nan::HandleScope scope; - Handle argv[2]; + Local argv[2]; argv[0] = Nan::Null(); argv[1] = Nan::New(dissimilarity);