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:
@@ -1384,11 +1384,10 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
/* Call external free callback if any. */
|
||||
ecma_arraybuffer_external_info *array_p = (ecma_arraybuffer_external_info *) ext_object_p;
|
||||
JERRY_ASSERT (array_p != NULL);
|
||||
|
||||
if (array_p->free_cb != NULL)
|
||||
{
|
||||
(array_p->free_cb) (array_p->buffer_p);
|
||||
array_p->free_cb (array_p->buffer_p);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user