n-api: add more property defaults by Flarna · Pull Request #35214 · nodejs/node

@Flarna

Add a default value for class method and js like property in enum
napi_property_attributes.

n-api currently offers only one default which is non configurable,
non writable, non enumerable - like Object.defineProperty(). While
this is formal correct the usual way to create properties in JS is
either by defining a class or use obj.prop = value.

The defaults from these variants are now backed into enum values.

@nodejs-github-bot added the c++

Issues and PRs that require attention from people who are familiar with C++.

label

Sep 15, 2020

addaleax

addaleax

@Flarna

@Flarna Flarna added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Sep 15, 2020

gabrielschulhof

@Flarna

gabrielschulhof

This was referenced

Sep 16, 2020

@Flarna @gabrielschulhof

Co-authored-by: Gabriel Schulhof <gabrielschulhof@gmail.com>

Flarna added a commit that referenced this pull request

Sep 17, 2020
Add a default value for class method and js like property in enum
napi_property_attributes.

n-api currently offers only one default which is non configurable,
non writable, non enumerable - like Object.defineProperty(). While
this is formal correct the usual way to create properties in JS is
either by defining a class or use obj.prop = value.

The defaults from these variants are now backed into enum values.

PR-URL: #35214
Refs: nodejs/node-addon-api#811
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>

This was referenced

Jun 23, 2021

This was referenced

Jul 1, 2021

This was referenced

Jul 11, 2021

This was referenced

Jul 23, 2021

This was referenced

Jul 31, 2021

This was referenced

Aug 11, 2021