Skip to content

Commit 7d9f265

Browse files
committed
fixup! node-api: clarify enum value ABI stability
1 parent 2ac779f commit 7d9f265

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

doc/api/n-api.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,19 @@ An enum value will not be removed or renamed.
132132

133133
For an enum type returned from a Node-API function, or provided as an out
134134
parameter of a Node-API function, the value is an integer value and an addon
135-
should handle unknown values. For example, when checking `napi_status` in
136-
switch statements, an addon should include a default branch, as new status
137-
codes may be introduced in newer Node.js versions
135+
should handle unknown values. New values are allowed to be introduced without
136+
a version guard. For example, when checking `napi_status` in switch statements,
137+
an addon should include a default branch, as new status codes may be introduced
138+
in newer Node.js versions.
138139

139140
For an enum type used in an in-parameter, the result of passing an unknown
140141
integer value to Node-API functions is undefined unless otherwise documented.
141-
For example, `napi_get_all_property_names` can be extended with new enum value
142-
of `napi_key_filter`.
142+
A new value is added with a version guard to indicate the Node-API version in
143+
which it was introduced. For example, `napi_get_all_property_names` can be
144+
extended with new enum value of `napi_key_filter`.
145+
146+
For an enum type used in both in-parameters and out-parameters, new values are
147+
allowed to be introduced without a version guard.
143148

144149
## Building
145150

0 commit comments

Comments
 (0)