napi_valuetype
typedef enum {
// ES6 types (corresponds to typeof)
napi_undefined,
napi_null,
napi_boolean,
napi_number,
napi_string,
napi_symbol,
napi_object,
napi_function,
napi_external,
napi_bigint,
} napi_valuetype;
描述 napi_value
的类型。这通常对应于 ECMAScript 语言规范的 第 6.1 节 中描述的类型。除了该部分中的类型外,napi_valuetype
还可以用外部数据表示 Function
和 Object
。
¥Describes the type of a napi_value
. This generally corresponds to the types
described in Section 6.1 of the ECMAScript Language Specification.
In addition to types in that section, napi_valuetype
can also represent
Function
s and Object
s with external data.
napi_external
类型的 JavaScript 值在 JavaScript 中显示为普通对象,因此不能在其上设置任何属性,也没有原型。
¥A JavaScript value of type napi_external
appears in JavaScript as a plain
object such that no properties can be set on it, and no prototype.