Skip to content

Commit

Permalink
porting to node 6
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahparker committed Mar 1, 2017
1 parent fd211b8 commit ea51cbd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/jpeg-lum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Handle<Value> Read(const FunctionCallbackInfo<Value>& info) {
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Specify an image filename to read", v8::String::kInternalizedString));
Local<Value> argv[] = { err };

callback->Call(info.GetCurrent()->Global(), 1, argv);
callback->Call(isolate, 1, argv);

return info.GetReturnValue().Set(Undefined(isolate));
}
Expand All @@ -177,22 +177,22 @@ Handle<Value> Read(const FunctionCallbackInfo<Value>& info) {
if (read_jpeg_file(filename)) {
Handle<Value> value = CreateObject(info);
Local<Value> argv[] = {
Local<Value>::New(isolate, Null()),
Local<Value>::New(Null(isolate)),
Local<Value>::New(isolate, value),
};
callback->Call(info.GetCurrent()->Global(), 2, argv);
return info.GetReturnValue().Set(value);
return info.GetReturnValue().Set(static_cast<object>(value));
}
else {
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Error reading image file", v8::String::kInternalizedString));
Local<Value> argv[] = { err };

callback->Call(info.GetCurrent()->Global(), 1, argv);
callback->Call(isolate, 1, argv);

return info.GetReturnValue().Set((Undefined(isolate));
}

return info.GetReturnValue().Set(CreateObject(info));
return info.GetReturnValue().Set(static_cast<object>(CreateObject(info)));
}

void init(Handle<Object> exports) {
Expand Down

0 comments on commit ea51cbd

Please sign in to comment.