Skip to content

Commit

Permalink
Add Function::Call wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Oct 15, 2015
1 parent 9f42b4c commit 2059873
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nan_maybe_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,12 @@ NAN_INLINE MaybeLocal<v8::Object> CloneElementAt(
return array->CloneElementAt(GetCurrentContext(), index);
}

NAN_INLINE MaybeLocal<v8::Value> Call(
v8::Local<v8::Function> fun
, v8::Local<v8::Value> recv
, int argc
, v8::Local<v8::Value> argv[]) {
return fun->Call(GetCurrentContext(), recv, argc, argv);
}

#endif // NAN_MAYBE_43_INL_H_
8 changes: 8 additions & 0 deletions nan_maybe_pre_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,12 @@ NAN_INLINE MaybeLocal<v8::Object> CloneElementAt(
return MaybeLocal<v8::Object>(array->CloneElementAt(index));
}

NAN_INLINE MaybeLocal<v8::Value> Call(
v8::Local<v8::Function> fun
, v8::Local<v8::Value> recv
, int argc
, v8::Local<v8::Value> argv[]) {
return MaybeLocal<v8::Value>(fun->Call(recv, argc, argv));
}

#endif // NAN_MAYBE_PRE_43_INL_H_

0 comments on commit 2059873

Please sign in to comment.