Browse Source

Merge pull request #834 from LinusU/fix-deprecations

Fix deprecation warnings
master
Linus Unnebäck 8 years ago
committed by GitHub
parent
commit
fe78b7c382
  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