napi_create_symbol
napi_status napi_create_symbol(napi_env env,
napi_value description,
napi_value* result)
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[in] description
:可选的napi_value
,它指的是要设置为符号描述的 JavaScriptstring
。¥
[in] description
: Optionalnapi_value
which refers to a JavaScriptstring
to be set as the description for the symbol. -
[out] result
:代表 JavaScriptsymbol
的napi_value
。¥
[out] result
: Anapi_value
representing a JavaScriptsymbol
.
如果 API 成功,则返回 napi_ok
。
¥Returns napi_ok
if the API succeeded.
此 API 从 UTF8 编码的 C 字符串创建 JavaScript symbol
值。
¥This API creates a JavaScript symbol
value from a UTF8-encoded C string.
JavaScript symbol
类型在 ECMAScript 语言规范的 第 19.4 节 中进行了描述。
¥The JavaScript symbol
type is described in Section 19.4
of the ECMAScript Language Specification.