Commit 645ee728 by Marcin Cieslak

Use Nan::NewInstance() for constructors

nan 2.0.1 required due to introduction
of Nan::NewInstance(v8::Local<v8::Function)>, int, v8::Local<v8::Value>)
constructor:

    https://github.com/nodejs/nan/commit/29450ed1670051613ffea9dd3f980f8685feceb4
parent 9cadef6f
......@@ -55,7 +55,7 @@
"glob": "^5.0.13",
"meow": "^3.3.0",
"mkdirp": "^0.5.1",
"nan": "^2.0.0",
"nan": "^2.0.1",
"npmconf": "^2.1.2",
"pangyp": "^2.2.1",
"request": "^2.58.0",
......
......@@ -23,14 +23,14 @@ namespace SassTypes
tpl->InstanceTemplate()->SetInternalFieldCount(1);
Nan::SetPrototypeTemplate(tpl, "getValue", Nan::GetFunction(Nan::New<v8::FunctionTemplate>(GetValue)).ToLocalChecked());
constructor.Reset(Nan::GetFunction(tpl).ToLocalChecked());
conslocal = Nan::New(constructor);
conslocal = Nan::GetFunction(tpl).ToLocalChecked();
constructor.Reset(conslocal);
get_singleton(false).js_object.Reset(conslocal->NewInstance());
get_singleton(false).js_object.Reset(Nan::NewInstance(conslocal).ToLocalChecked());
Nan::SetInternalFieldPointer(Nan::New(get_singleton(false).js_object), 0, &get_singleton(false));
Nan::Set(conslocal, Nan::New("FALSE").ToLocalChecked(), Nan::New(get_singleton(false).js_object));
get_singleton(true).js_object.Reset(conslocal->NewInstance());
get_singleton(true).js_object.Reset(Nan::NewInstance(conslocal).ToLocalChecked());
Nan::SetInternalFieldPointer(Nan::New(get_singleton(true).js_object), 0, &get_singleton(true));
Nan::Set(conslocal, Nan::New("TRUE").ToLocalChecked(), Nan::New(get_singleton(true).js_object));
......
......@@ -22,10 +22,10 @@ namespace SassTypes
tpl->SetClassName(Nan::New("SassNull").ToLocalChecked());
tpl->InstanceTemplate()->SetInternalFieldCount(1);
constructor.Reset(Nan::GetFunction(tpl).ToLocalChecked());
conslocal = Nan::New(constructor);
conslocal = Nan::GetFunction(tpl).ToLocalChecked();
constructor.Reset(conslocal);
get_singleton().js_object.Reset(conslocal->NewInstance());
get_singleton().js_object.Reset(Nan::NewInstance(conslocal).ToLocalChecked());
Nan::SetInternalFieldPointer(Nan::New(get_singleton().js_object), 0, &get_singleton());
Nan::Set(conslocal, Nan::New("NULL").ToLocalChecked(), Nan::New(get_singleton().js_object));
......
......@@ -106,7 +106,7 @@ namespace SassTypes
}
} else {
v8::Local<v8::Function> cons = T::get_constructor();
v8::Local<v8::Object> inst = cons->NewInstance(info.Length(), &localArgs[0]);
v8::Local<v8::Object> inst = Nan::NewInstance(cons, info.Length(), &localArgs[0]).ToLocalChecked();
info.GetReturnValue().Set(inst);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment