Skip to content

Commit

Permalink
Revert "closure: remove Nan::Call"
Browse files Browse the repository at this point in the history
This reverts commit c14ea02.
  • Loading branch information
romgrk committed Jul 16, 2018
1 parent 18c936b commit 468c7b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/closure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ void Closure::Marshal(GClosure *base,
}

Local<Object> self = func;
Local<Value> result = func->CallAsFunction(self, n_js_args, js_args);
Local<Value> return_value;

if (!result.IsEmpty()) {
auto result = Nan::Call(func, self, n_js_args, js_args);

if (result.ToLocal(&return_value)) {
if (g_return_value) {
if (G_VALUE_TYPE(g_return_value) == G_TYPE_INVALID)
g_warning ("Marshal: return value has invalid g_type");
else if (!V8ToGValue (g_return_value, result))
else if (!V8ToGValue (g_return_value, return_value))
g_warning ("Marshal: could not convert return value");
}
}
Expand Down

0 comments on commit 468c7b8

Please sign in to comment.