mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Add missing feature guard to jerry_create_typedarray_for_arraybuffer function (#3035)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
parent
3ba6adcc71
commit
ea77a79461
@ -3594,8 +3594,15 @@ jerry_create_typedarray_for_arraybuffer (jerry_typedarray_type_t type_name, /**<
|
||||
const jerry_value_t arraybuffer) /**< ArrayBuffer to use */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
jerry_length_t byteLength = jerry_get_arraybuffer_byte_length (arraybuffer);
|
||||
return jerry_create_typedarray_for_arraybuffer_sz (type_name, arraybuffer, 0, byteLength);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (type_name);
|
||||
JERRY_UNUSED (arraybuffer);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray_for_arraybuffer */
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user