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 语言规范 章节语言类型 中描述的类型。除了该部分中的类型外,napi_valuetype 还可以表示带有外部数据的 FunctionObject

【Describes the type of a napi_value. This generally corresponds to the types described in Section language types of the ECMAScript Language Specification. In addition to types in that section, napi_valuetype can also represent Functions and Objects 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.】