Skip to content

Commit

Permalink
napi: fix implementation of napi_create_boolean
Browse files Browse the repository at this point in the history
Need to call JsBoolToBoolean(), not JsDoubleToNumber() when creating a
JS boolean from a bool.

Closes: #31
  • Loading branch information
Gabriel Schulhof committed Jan 16, 2017
1 parent 7be3626 commit e2480ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_jsrtapi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ napi_value napi_create_number(napi_env e, double v) {
napi_value napi_create_boolean(napi_env e, bool b) {
JsErrorCode error = JsNoError;
JsValueRef booleanValue = nullptr;
error = JsDoubleToNumber(b, &booleanValue);
error = JsBoolToBoolean(b, &booleanValue);
return reinterpret_cast<napi_value>(booleanValue);
}

Expand Down

0 comments on commit e2480ba

Please sign in to comment.