Skip to content
Prev Previous commit
Next Next commit
fixup! FunctionReference::New return type
  • Loading branch information
legendecas committed Jun 9, 2021
commit 676798c3facf4417263fbfde134269bae83f0c60
5 changes: 3 additions & 2 deletions test/functionreference.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "napi.h"
#include "test_helper.h"

using namespace Napi;

Expand All @@ -8,15 +9,15 @@ Value Call(const CallbackInfo& info) {
FunctionReference ref;
ref.Reset(info[0].As<Function>());

return ref.Call({});
return MaybeUnwrapOr(ref.Call({}));
Comment thread
legendecas marked this conversation as resolved.
Outdated
}

Value Construct(const CallbackInfo& info) {
HandleScope scope(info.Env());
FunctionReference ref;
ref.Reset(info[0].As<Function>());

return ref.New({});
return MaybeUnwrapOr(ref.New({}));
}
} // namespace

Expand Down