GeezerVison is showing github.com — node-api: introduce experimental feature flags · nodejs/node@3d0b233
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/contributing/adding-new-napi-api.md +4Lines changed: 4 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,10 @@ Node-API. |
34 | 34 | * Experimental APIs **must** be documented as such. |
35 | 35 | * Experimental APIs **must** require an explicit compile-time flag |
36 | 36 | (`#define`) to be set to opt-in. |
| 37 | + * A feature flag of the form `NODE_API_EXPERIMENTAL_HAS_<FEATURE>` **must** |
| 38 | + be added with each experimental feature in order to allow code to |
| 39 | + distinguish between experimental features as present in one version of |
| 40 | + Node.js versus another. |
37 | 41 | * Experimental APIs **must** be considered for backport. |
38 | 42 | * Experimental status exit criteria **must** involve at least the |
39 | 43 | following: |
|
Collapse file
Copy file name to clipboardExpand all lines: doc/contributing/releases-node-api.md +2Lines changed: 2 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -100,6 +100,8 @@ and update the define version guards with the release version: |
100 | 100 | + #endif // NAPI_VERSION >= 10 |
101 | 101 | ``` |
102 | 102 |
|
| 103 | +Remove any feature flags of the form `NODE_API_EXPERIMENTAL_HAS_<FEATURE>`. |
| 104 | +
|
103 | 105 | Also, update the Node-API version value of the `napi_get_version` test in |
104 | 106 | `test/js-native-api/test_general/test.js` with the release version `x`: |
105 | 107 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/js_native_api.h +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -93,6 +93,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env, |
93 | 93 | size_t length, |
94 | 94 | napi_value* result); |
95 | 95 | #ifdef NAPI_EXPERIMENTAL |
| 96 | +#define NODE_API_EXPERIMENTAL_HAS_EXTERNAL_STRINGS |
96 | 97 | NAPI_EXTERN napi_status NAPI_CDECL |
97 | 98 | node_api_create_external_string_latin1(napi_env env, |
98 | 99 | char* str, |
@@ -518,6 +519,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_add_finalizer(napi_env env, |
518 | 519 | #endif // NAPI_VERSION >= 5 |
519 | 520 |
|
520 | 521 | #ifdef NAPI_EXPERIMENTAL |
| 522 | +#define NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER |
521 | 523 |
|
522 | 524 | NAPI_EXTERN napi_status NAPI_CDECL |
523 | 525 | node_api_post_finalizer(napi_env env, |
|