-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
napi: implement napi_is_detached_arraybuffer #30613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cb8752
5bf270e
7352a88
8dc4a18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. section numbers tend to change, i'd just say "as defined in the ecmascript language specifiation." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a good idea but a lot of the other functions (in this doc) have links to the appropriate sections in the spec so I'm not sure. |
||
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 | ||
|
Uh oh!
There was an error while loading. Please reload this page.