From 5c6130a2a0b4c41ab415f6b8992aa323636338b9 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 6 May 2022 18:55:35 -0700 Subject: [PATCH] Fixed Array.prototype.fill() for typed-arrays. This closes #478 issue on Github. --- src/njs_typed_array.c | 2 -- src/test/njs_unit_test.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/njs_typed_array.c b/src/njs_typed_array.c index 94dfd5e8..2e8b0c89 100644 --- a/src/njs_typed_array.c +++ b/src/njs_typed_array.c @@ -702,8 +702,6 @@ njs_typed_array_set_value(njs_vm_t *vm, njs_typed_array_t *array, njs_typed_array_prop_set(vm, array, index, num); - njs_set_number(setval, num); - return NJS_OK; } diff --git a/src/test/njs_unit_test.c b/src/test/njs_unit_test.c index 77ec044e..490c0773 100644 --- a/src/test/njs_unit_test.c +++ b/src/test/njs_unit_test.c @@ -5409,6 +5409,9 @@ static njs_unit_test_t njs_test[] = "Array.prototype.fill.call(o, 2).a"), njs_str("4") }, + { njs_str("Array.prototype.fill.call(new Int32Array(1))"), + njs_str("0") }, + { njs_str("ArrayBuffer()"), njs_str("TypeError: Constructor ArrayBuffer requires 'new'") }, -- 2.47.3