Dmitry Volyntsev
May 06, 2022 10:00PM
details: https://hg.nginx.org/njs/rev/5c7e02885c26
branches:
changeset: 1852:5c7e02885c26
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri May 06 18:55:35 2022 -0700
description:
Fixed Array.prototype.fill() for typed-arrays.

This closes #478 issue on Github.

diffstat:

src/njs_typed_array.c | 2 --
src/test/njs_unit_test.c | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 3f6f3ba16741 -r 5c7e02885c26 src/njs_typed_array.c
--- a/src/njs_typed_array.c Fri May 06 18:55:07 2022 -0700
+++ b/src/njs_typed_array.c Fri May 06 18:55:35 2022 -0700
@@ -702,8 +702,6 @@ njs_typed_array_set_value(njs_vm_t *vm,

njs_typed_array_prop_set(vm, array, index, num);

- njs_set_number(setval, num);
-
return NJS_OK;
}

diff -r 3f6f3ba16741 -r 5c7e02885c26 src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c Fri May 06 18:55:07 2022 -0700
+++ b/src/test/njs_unit_test.c Fri May 06 18:55:35 2022 -0700
@@ -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'") },

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] Fixed Array.prototype.fill() for typed-arrays.

Dmitry Volyntsev 420 May 06, 2022 10:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 196
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready