Fix DataView argument handling in case of undefined value (#3930)

The DataView's third argument incorrectly processed the "undefined"
value resulting in a RangeError.

Fixes: #3927

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál
2020-06-25 14:05:08 +02:00
committed by GitHub
parent ae17c1184c
commit c12c60c550
2 changed files with 52 additions and 1 deletions
@@ -106,7 +106,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
/* 11 - 12. */
uint32_t viewByteLength;
if (arguments_list_len > 2)
if (arguments_list_len > 2 && !ecma_is_value_undefined (arguments_list_p[2]))
{
/* 12.a */
ecma_value_t byte_length_value = ecma_op_to_length (arguments_list_p[2], &viewByteLength);