]> git.kaiwu.me - njs.git/commit
Fix Array.prototype.concat() with sparse arrays
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 4 Sep 2026 01:47:58 +0000 (18:47 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 4 Sep 2026 21:53:08 +0000 (14:53 -0700)
commite68fef653d416056af88884b70cd6252bef2140a
tree39512f07134a44d01ea46e173031b7267e889adb
parentbb6f23ccc119041657263555d686563097a3d09e
Fix Array.prototype.concat() with sparse arrays

Previously, the fast concat path represented a missing source property with
njs_value_invalid and still created the corresponding destination property.
For a slow sparse destination this materialized an internal hole sentinel as
a normal property, which later property access could interpret as an invalid
accessor.

The fix is to advance the destination index without creating a property when
the source lookup reports a hole.

The issue was introduced in 232fb594 (0.7.2).

This closes #1095 issue on GitHub.
src/njs_array.c
src/test/njs_unit_test.c