]> git.kaiwu.me - njs.git/commit
Fixed Array.prototype.slice() when array is changed while iterating.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 13 Jan 2022 15:59:08 +0000 (15:59 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 13 Jan 2022 15:59:08 +0000 (15:59 +0000)
commit377745d4c56bffba9a62c4f85465389b71115df8
treec27ba941d0db77666a9d47a80a3b4195b8971d2a
parente00eac3d6080d39b414f366d88c7dc167f082055
Fixed Array.prototype.slice() when array is changed while iterating.

Previously, the flat array may be converted to a slow one as a
side-effect of a custom getter invocation for a proto array object.
The function erroneously assumed that the this array remains flat
while iterating.

The fix is to eliminate the micro-optimization which uses direct
pointers.

The problem is similar to the previous (9578cc729205) commit.

This closes #445 issue on Github.
src/njs_array.c
src/test/njs_unit_test.c