summaryrefslogtreecommitdiff
path: root/doc/api/n-api.md
diff options
context:
space:
mode:
authorDenys Otrishko <shishugi@gmail.com>2019-11-23 23:08:11 +0200
committerAnna Henningsen <anna@addaleax.net>2019-11-28 15:15:36 +0100
commita1cbbd1da6d7ea9fbdbdabba6ac78b2b4cef9621 (patch)
tree65d062fb499e04babcadfaacab2a9f9fa2f67d83 /doc/api/n-api.md
parent15146e6f3743e3df5cff8fd04677fe38efc91c94 (diff)
downloadandroid-node-v8-a1cbbd1da6d7ea9fbdbdabba6ac78b2b4cef9621.tar.gz
android-node-v8-a1cbbd1da6d7ea9fbdbdabba6ac78b2b4cef9621.tar.bz2
android-node-v8-a1cbbd1da6d7ea9fbdbdabba6ac78b2b4cef9621.zip
n-api: implement napi_is_detached_arraybuffer
This implements ArrayBuffer#IsDetachedBuffer operation as per ECMAScript specification Section 24.1.1.2 https://tc39.es/ecma262/#sec-isdetachedbuffer Closes: https://github.com/nodejs/node/issues/29955 PR-URL: https://github.com/nodejs/node/pull/30613 Fixes: https://github.com/nodejs/node/issues/29955 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'doc/api/n-api.md')
-rw-r--r--doc/api/n-api.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index 0e88387e51..c2812c9ebd 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -3258,6 +3258,31 @@ that is, created with [`napi_create_external_arraybuffer`][].
This API represents the invocation of the `ArrayBuffer` detach operation as
defined in [Section 24.1.1.3][] of the ECMAScript Language Specification.
+### napi_is_detached_arraybuffer
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental
+
+```C
+napi_status napi_is_detached_arraybuffer(napi_env env,
+ napi_value arraybuffer,
+ bool* result)
+```
+
+* `[in] env`: The environment that the API is invoked under.
+* `[in] arraybuffer`: The JavaScript `ArrayBuffer` to be checked.
+* `[out] result`: Whether the `arraybuffer` is detached.
+
+Returns `napi_ok` if the API succeeded.
+
+The `ArrayBuffer` is considered detached if its internal data is `null`.
+
+This API represents the invocation of the `ArrayBuffer` `IsDetachedBuffer`
+operation as defined in [Section 24.1.1.2][] of the ECMAScript Language
+Specification.
+
## Working with JavaScript Properties
N-API exposes a set of APIs to get and set properties on JavaScript
@@ -5259,6 +5284,7 @@ This API may only be called from the main thread.
[Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations
[Section 8.7]: https://tc39.es/ecma262/#sec-agents
[Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
+[Section 24.1.1.2]: https://tc39.es/ecma262/#sec-isdetachedbuffer
[Travis CI]: https://travis-ci.org
[Visual Studio]: https://visualstudio.microsoft.com
[Working with JavaScript Properties]: #n_api_working_with_javascript_properties