Skip to content

Commit e2480ba

Browse files
author
Gabriel Schulhof
committed
napi: fix implementation of napi_create_boolean
Need to call JsBoolToBoolean(), not JsDoubleToNumber() when creating a JS boolean from a bool. Closes: #31
1 parent 7be3626 commit e2480ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_jsrtapi.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ napi_value napi_create_number(napi_env e, double v) {
501501
napi_value napi_create_boolean(napi_env e, bool b) {
502502
JsErrorCode error = JsNoError;
503503
JsValueRef booleanValue = nullptr;
504-
error = JsDoubleToNumber(b, &booleanValue);
504+
error = JsBoolToBoolean(b, &booleanValue);
505505
return reinterpret_cast<napi_value>(booleanValue);
506506
}
507507

0 commit comments

Comments
 (0)