Skip to content

Commit 4dd9b55

Browse files
committed
doc: add node_api_set_prototype API
1 parent e1b57e8 commit 4dd9b55

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/api/n-api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5049,6 +5049,28 @@ added to it, as well as marking all existing properties as non-configurable.
50495049
This is described in [Section 19.1.2.20](https://tc39.es/ecma262/#sec-object.seal)
50505050
of the ECMA-262 specification.
50515051

5052+
#### `node_api_set_prototype`
5053+
5054+
<!-- YAML
5055+
added: REPLACEME
5056+
-->
5057+
5058+
> Stability: 1 - Experimental
5059+
5060+
```c
5061+
napi_status node_api_set_prototype(napi_env env,
5062+
napi_value object,
5063+
napi_value value);
5064+
```
5065+
5066+
* `[in] env`: The environment that the Node-API call is invoked under.
5067+
* `[in] object`: The object on which to set the prototype.
5068+
* `[in] value`: The prototype value.
5069+
5070+
Returns `napi_ok` if the API succeeded.
5071+
5072+
This API sets the prototype of the `Object` passed in.
5073+
50525074
## Working with JavaScript functions
50535075

50545076
Node-API provides a set of APIs that allow JavaScript code to

0 commit comments

Comments
 (0)