]> git.kaiwu.me - njs.git/commit
Fixed Array.prototype.concat() when "this" is a slow array.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 21 Feb 2022 16:52:47 +0000 (16:52 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 21 Feb 2022 16:52:47 +0000 (16:52 +0000)
commite673ae41a998d1391bd562edb2ed6d49db7cc716
treebf9b15d1acadfad4fa4071f76f162bfa479c3132
parent2ff8b264830da18528d6655b0e0654414cae9272
Fixed Array.prototype.concat() when "this" is a slow array.

Previously, when the current appended element is fast array the "this"
array was expected to always be a fast array also.  This may not be the
case when the previous appended element was not fast thus converting
the "this" array to a slow form.

Previous fix introduced in 2c1382bab643 (0.7.2) was not complete, the
correct fix is to never assume "this" is fast, whereas njs_array_add()
may only be called with fast arrays.

This closes #471 issue in Github.
src/njs_array.c
src/test/njs_unit_test.c