From 62dc1b59c551d1606572b324e6bfc0e099a72d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sun, 30 Oct 2016 20:19:06 +0100 Subject: [PATCH] Fix deprecation warnings --- src/Canvas.cc | 6 +++--- src/CanvasRenderingContext2d.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Canvas.cc b/src/Canvas.cc index c7415e2..89c1e59 100644 --- a/src/Canvas.cc +++ b/src/Canvas.cc @@ -353,7 +353,7 @@ NAN_METHOD(Canvas::ToBuffer) { return Nan::ThrowError(Canvas::Error(status)); } - TryCatch try_catch; + Nan::TryCatch try_catch; status = canvas_write_to_png_stream(canvas->surface(), toBuffer, &closure); if (try_catch.HasCaught()) { @@ -445,7 +445,7 @@ NAN_METHOD(Canvas::StreamPNGSync) { closure.compression_level = compression_level; closure.filter = filter; - TryCatch try_catch; + Nan::TryCatch try_catch; cairo_status_t status = canvas_write_to_png_stream(canvas->surface(), streamPNG, &closure); @@ -564,7 +564,7 @@ NAN_METHOD(Canvas::StreamJPEGSync) { closure_t closure; closure.fn = Local::Cast(info[3]); - TryCatch try_catch; + Nan::TryCatch try_catch; write_to_jpeg_stream(canvas->surface(), info[0]->NumberValue(), info[1]->NumberValue(), info[2]->BooleanValue(), &closure); if (try_catch.HasCaught()) { diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 836afb1..f3f32d5 100755 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -743,8 +743,8 @@ NAN_METHOD(Context2d::GetImageData) { Local shHandle = Nan::New(sh); Local argv[argc] = { clampedArray, swHandle, shHandle }; - Local cons = Nan::New(ImageData::constructor); - Local instance = cons->GetFunction()->NewInstance(argc, argv); + Local constructor = Nan::GetFunction(Nan::New(ImageData::constructor)).ToLocalChecked(); + Local instance = Nan::NewInstance(constructor, argc, argv).ToLocalChecked(); info.GetReturnValue().Set(instance); }