napi_status napi_create_symbol(napi_env env,
napi_value description,
napi_value* result)
[in] env
: The environment that the API is invoked under.[in] description
: Optionalnapi_value
which refers to a JavaScriptString
to be set as the description for the symbol.[out] result
: Anapi_value
representing a JavaScriptSymbol
.
Returns napi_ok
if the API succeeded.
This API creates a JavaScript Symbol
object from a UTF8-encoded C string.
The JavaScript Symbol
type is described in [Section 19.4][]
of the ECMAScript Language Specification.