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 2, 2017
1 parent 5638f35 commit dc4a72a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jpeg-lum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Handle<Value> Read(const FunctionCallbackInfo<Value>& info) {
Local<Function> callback = Local<Function>::Cast(info[1]);

if (info.Length() < 2) {
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Specify an image filename to read", v8::String::kInternalizedString));
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Specify an image filename to read"));
Local<Value> argv[] = { err };

callback->Call(isolate->GetCurrentContext()->Global(), 1, argv);
Expand All @@ -182,10 +182,10 @@ Handle<Value> Read(const FunctionCallbackInfo<Value>& info) {
Local<Value>::New(isolate, value),
};
callback->Call(isolate->GetCurrentContext()->Global(), 2, argv);
return info.GetReturnValue().Set(static_cast<object>(value));
return info.GetReturnValue().Set(value);
}
else {
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Error reading image file", v8::String::kInternalizedString));
Local<Value> err = Exception::Error(String::NewFromUtf8(isolate, "Error reading image file"));
Local<Value> argv[] = { err };

callback->Call(isolate->GetCurrentContext()->Global(), 1, argv);
Expand Down

0 comments on commit dc4a72a

Please sign in to comment.