Skip to content

Commit

Permalink
Fixed Array.prototype.fill() for typed-arrays.
Browse files Browse the repository at this point in the history
This closes #478 issue on Github.
  • Loading branch information
xeioex committed May 7, 2022
1 parent 81af263 commit 5c6130a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/njs_typed_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions src/test/njs_unit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'") },

Expand Down

0 comments on commit 5c6130a

Please sign in to comment.