Skip to content

Commit

Permalink
Fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Mar 21, 2020
1 parent ff8b503 commit bfb4f1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
17 changes: 6 additions & 11 deletions lib/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ const util = require('util')
// Lazily loaded simple-get
let get;

const proto = Image.prototype
const _getSource = proto.getSource
const _setSource = proto.setSource

delete proto.getSource
delete proto.setSource
const {GetSource, SetSource} = bindings;

Object.defineProperty(Image.prototype, 'src', {
/**
Expand Down Expand Up @@ -88,11 +83,11 @@ Image.prototype[util.inspect.custom || 'inspect'] = function(){
+ ']';
};

function getSource (img) {
return img._originalSource || _getSource.call(img)
function getSource(img){
return img._originalSource || GetSource.call(img);
}

function setSource (img, src, origSrc) {
_setSource.call(img, src)
img._originalSource = origSrc
function setSource(img, src, origSrc){
SetSource.call(img, src);
img._originalSource = origSrc;
}
8 changes: 5 additions & 3 deletions src/backend/FBDevBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,23 @@ void FBDevBackend::setFormat(cairo_format_t format)

Nan::Persistent<FunctionTemplate> FBDevBackend::constructor;

void FBDevBackend::Initialize(Handle<Object> target)
void FBDevBackend::Initialize(Local<Object> target)
{
Nan::HandleScope scope;

Local<FunctionTemplate> ctor = Nan::New<FunctionTemplate>(FBDevBackend::New);
FBDevBackend::constructor.Reset(ctor);
ctor->InstanceTemplate()->SetInternalFieldCount(1);
ctor->SetClassName(Nan::New<String>("FBDevBackend").ToLocalChecked());
target->Set(Nan::New<String>("FBDevBackend").ToLocalChecked(), ctor->GetFunction());
Nan::Set(target,
Nan::New<String>("FBDevBackend").ToLocalChecked(),
Nan::GetFunction(ctor).ToLocalChecked()).Check();
}

NAN_METHOD(FBDevBackend::New)
{
string fbDevice = DEFAULT_DEVICE;
if(info[0]->IsString()) fbDevice = *String::Utf8Value(info[0].As<String>());
if(info[0]->IsString()) fbDevice = *Nan::Utf8String(info[0]);

FBDevBackend* backend = new FBDevBackend(fbDevice);

Expand Down
2 changes: 1 addition & 1 deletion src/backend/FBDevBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FBDevBackend : public Backend
FBDevBackend(string deviceName);

static Nan::Persistent<v8::FunctionTemplate> constructor;
static void Initialize(v8::Handle<v8::Object> target);
static void Initialize(v8::Local<v8::Object> target);
static NAN_METHOD(New);
};

Expand Down

0 comments on commit bfb4f1d

Please sign in to comment.