Browse Source

Fix deprecation warnings

master
Linus Unnebäck 8 years ago
parent
commit
62dc1b59c5
No known key found for this signature in database GPG Key ID: F23BD23774478D34
  1. 6
      src/Canvas.cc
  2. 4
      src/CanvasRenderingContext2d.cc

6
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<Function>::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()) {

4
src/CanvasRenderingContext2d.cc

@ -743,8 +743,8 @@ NAN_METHOD(Context2d::GetImageData) {
Local<Int32> shHandle = Nan::New(sh);
Local<Value> argv[argc] = { clampedArray, swHandle, shHandle };
Local<FunctionTemplate> cons = Nan::New(ImageData::constructor);
Local<Object> instance = cons->GetFunction()->NewInstance(argc, argv);
Local<Function> constructor = Nan::GetFunction(Nan::New(ImageData::constructor)).ToLocalChecked();
Local<Object> instance = Nan::NewInstance(constructor, argc, argv).ToLocalChecked();
info.GetReturnValue().Set(instance);
}

Loading…
Cancel
Save