napi_create_int32
napi_status napi_create_int32(napi_env env, int32_t value, napi_value* result)
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[in] value
:要在 JavaScript 中表示的整数值。¥
[in] value
: Integer value to be represented in JavaScript. -
[out] result
:代表 JavaScriptnumber
的napi_value
。¥
[out] result
: Anapi_value
representing a JavaScriptnumber
.
如果 API 成功,则返回 napi_ok
。
¥Returns napi_ok
if the API succeeded.
该 API 用于将 C int32_t
类型转换为 JavaScript number
类型。
¥This API is used to convert from the C int32_t
type to the JavaScript
number
type.
JavaScript number
类型在 ECMAScript 语言规范的 第 6.1.6 节 中进行了描述。
¥The JavaScript number
type is described in
Section 6.1.6 of the ECMAScript Language Specification.