Skip to content

Commit 73ff802

Browse files
addaleaxGabriel Schulhof
authored andcommitted
Fix ObjectWrap constructor
Fixes: #101 PR-URL: #105 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent dfb59ac commit 73ff802

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

napi-inl.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,12 +2480,10 @@ inline napi_value ObjectWrap<T>::ConstructorCallbackWrapper(
24802480
}
24812481

24822482
T* instance;
2483-
napi_value wrapper;
2484-
details::WrapCallback([&] {
2483+
napi_value wrapper = details::WrapCallback([&] {
24852484
CallbackInfo callbackInfo(env, info);
24862485
instance = new T(callbackInfo);
2487-
wrapper = callbackInfo.This();
2488-
return nullptr;
2486+
return callbackInfo.This();
24892487
});
24902488

24912489
return wrapper;

0 commit comments

Comments
 (0)