Documentation mismatch for N-API structures
Documentation on the N-API page describes napi_property_attributes as following:
typedef enum { napi_default = 0, napi_read_only = 1 << 0, napi_dont_enum = 1 << 1, napi_dont_delete = 1 << 2, napi_static_property = 1 << 10, } napi_property_attributes;
whereas src/node_api_types.h describes it as:
typedef enum { napi_default = 0, napi_writable = 1 << 0, napi_enumerable = 1 << 1, napi_configurable = 1 << 2, // Used with napi_define_class to distinguish static properties // from instance properties. Ignored by napi_define_properties. napi_static = 1 << 10, } napi_property_attributes;
Basically, values of all bit flags were inverted.
Given the last commit, it seems it's the documentation that is outdated here but would be nice to confirm and sync two places to agree with each other.
Another one is napi_property_descriptor - website docs don't mention second name field of type napi_value.