Revise the API ArrayBuffer related operations (#4284)
- External ArrayBuffer construction with 0 length should be equivalent to `new ArrayBuffer(0)` - Internally allocated ArrayBuffers should be detachable - Externally allocated ArrayBuffers free callback should be called when underlying buffer is detached JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -9011,7 +9011,9 @@ jerry_get_arraybuffer_pointer (const jerry_value_t value);
|
||||
- `value` - Array Buffer object.
|
||||
- return value
|
||||
- pointer to the Array Buffer's data area.
|
||||
- NULL if the `value` is not an Array Buffer object.
|
||||
- NULL if the `value` is:
|
||||
- not an ArrayBuffer object
|
||||
- an external ArrayBuffer has been detached
|
||||
|
||||
*New in version 2.0*.
|
||||
|
||||
@@ -9096,6 +9098,8 @@ jerry_value_t
|
||||
jerry_detach_arraybuffer (const jerry_value_t value);
|
||||
```
|
||||
|
||||
*Note*: If the ArrayBuffer has been created with `jerry_create_arraybuffer_external` the optional free callback is called on a successful detach operation
|
||||
|
||||
- `value` - ArrayBuffer to be detached
|
||||
- return
|
||||
- null value if success
|
||||
|
||||
Reference in New Issue
Block a user