diff --git a/doc/api/n-api.md b/doc/api/n-api.md index b35a99f5c46021..8063eaf7348dc0 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2876,8 +2876,8 @@ napi_status napi_wrap(napi_env env, Returns `napi_ok` if the API succeeded. -Wraps a native instance in JavaScript object of the corresponding type. -The native instance can be retrieved later using `napi_unwrap()`. +Wraps a native instance in a JavaScript object. The native instance can be +retrieved later using `napi_unwrap()`. When JavaScript code invokes a constructor for a class that was defined using `napi_define_class()`, the `napi_callback` for the constructor is invoked. @@ -2905,6 +2905,10 @@ required in order to enable correct proper of the reference. Afterward, additional manipulation of the wrapper's prototype chain may cause `napi_unwrap()` to fail. +*Note*: Calling `napi_wrap()` a second time on an object that already has a +native instance associated with it by virtue of a previous call to +`napi_wrap()` will cause an error to be returned. + ### *napi_unwrap*