From: Dmitry Volyntsev Date: Sat, 7 May 2022 01:55:35 +0000 (-0700) Subject: Fixed Array.prototype.fill() for typed-arrays. X-Git-Tag: 0.7.4~12 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=5c6130a2a0b4c41ab415f6b8992aa323636338b9;p=njs.git Fixed Array.prototype.fill() for typed-arrays. This closes #478 issue on Github. --- 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'") },