add node v0.12 and io.js compatibility
This commit is contained in:
@@ -239,7 +239,7 @@ void NodeMap::renderFinished() {
|
||||
assert(!image);
|
||||
|
||||
if (img) {
|
||||
v8::Local<v8::Object> result = v8::Object::New();
|
||||
auto result = NanNew<v8::Object>();
|
||||
result->Set(NanNew("width"), NanNew(img->width));
|
||||
result->Set(NanNew("height"), NanNew(img->height));
|
||||
|
||||
@@ -283,7 +283,11 @@ NodeMap::NodeMap(v8::Handle<v8::Object> source_) :
|
||||
NanAssignPersistent(source, source_);
|
||||
|
||||
async->data = this;
|
||||
#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
|
||||
uv_async_init(uv_default_loop(), async, [](uv_async_t *as, int) {
|
||||
#else
|
||||
uv_async_init(uv_default_loop(), async, [](uv_async_t *as) {
|
||||
#endif
|
||||
reinterpret_cast<NodeMap *>(as->data)->renderFinished();
|
||||
});
|
||||
|
||||
@@ -292,7 +296,7 @@ NodeMap::NodeMap(v8::Handle<v8::Object> source_) :
|
||||
}
|
||||
|
||||
NodeMap::~NodeMap() {
|
||||
source.Dispose();
|
||||
NanDisposePersistent(source);
|
||||
|
||||
uv_close(reinterpret_cast<uv_handle_t *>(async), [] (uv_handle_t *handle) {
|
||||
delete reinterpret_cast<uv_async_t *>(handle);
|
||||
|
||||
Reference in New Issue
Block a user