napi_create_object
napi_status napi_create_object(napi_env env, napi_value* result)
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[out] result
:代表 JavaScriptObject
的napi_value
。¥
[out] result
: Anapi_value
representing a JavaScriptObject
.
如果 API 成功,则返回 napi_ok
。
¥Returns napi_ok
if the API succeeded.
此 API 分配默认的 JavaScript Object
。它相当于在 JavaScript 中执行 new Object()
。
¥This API allocates a default JavaScript Object
.
It is the equivalent of doing new Object()
in JavaScript.
JavaScript Object
类型在 ECMAScript 语言规范的 第 6.1.7 节 中进行了描述。
¥The JavaScript Object
type is described in Section 6.1.7 of the
ECMAScript Language Specification.