mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Here goes nothing...
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.
This commit is contained in:
parent
0216128fb0
commit
a0faef9e65
@ -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++) {
|
||||
|
||||
@ -29,7 +29,7 @@ void AfterAsyncPredict(uv_work_t *req);
|
||||
|
||||
Nan::Persistent<FunctionTemplate> FaceRecognizerWrap::constructor;
|
||||
|
||||
void FaceRecognizerWrap::Init(Handle<Object> target) {
|
||||
void FaceRecognizerWrap::Init(Local<Object> target) {
|
||||
Nan::HandleScope scope;
|
||||
|
||||
// Constructor
|
||||
@ -135,7 +135,7 @@ FaceRecognizerWrap::FaceRecognizerWrap(cv::Ptr<cv::FaceRecognizer> f,
|
||||
typ = type;
|
||||
}
|
||||
|
||||
Handle<Value> UnwrapTrainingData(Nan::NAN_METHOD_ARGS_TYPE info,
|
||||
Local<Value> UnwrapTrainingData(Nan::NAN_METHOD_ARGS_TYPE info,
|
||||
cv::vector<cv::Mat>* images, cv::vector<int>* labels) {
|
||||
|
||||
if (info.Length() < 1 || !info[0]->IsArray()) {
|
||||
@ -176,7 +176,7 @@ NAN_METHOD(FaceRecognizerWrap::TrainSync) {
|
||||
cv::vector<cv::Mat> images;
|
||||
cv::vector<int> labels;
|
||||
|
||||
Handle<Value> exception = UnwrapTrainingData(info, &images, &labels);
|
||||
Local<Value> 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<cv::Mat> images;
|
||||
cv::vector<int> labels;
|
||||
|
||||
Handle<Value> exception = UnwrapTrainingData(info, &images, &labels);
|
||||
Local<Value> exception = UnwrapTrainingData(info, &images, &labels);
|
||||
if (!exception->IsUndefined()) {
|
||||
JSTHROW(exception);
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ public:
|
||||
int typ;
|
||||
|
||||
static Nan::Persistent<FunctionTemplate> constructor;
|
||||
static void Init(Handle<Object> target);
|
||||
static void Init(Local<Object> target);
|
||||
static NAN_METHOD(New);
|
||||
|
||||
FaceRecognizerWrap(cv::Ptr<cv::FaceRecognizer> f, int type);
|
||||
|
||||
@ -82,7 +82,7 @@ public:
|
||||
void HandleOKCallback() {
|
||||
Nan::HandleScope scope;
|
||||
|
||||
Handle<Value> argv[2];
|
||||
Local<Value> argv[2];
|
||||
|
||||
argv[0] = Nan::Null();
|
||||
argv[1] = Nan::New<Number>(dissimilarity);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user