]> git.kaiwu.me - njs.git/commit
Fixed logical assignment short-circuit with non-writable properties.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 3 Mar 2026 02:00:09 +0000 (18:00 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 3 Mar 2026 15:23:09 +0000 (07:23 -0800)
commit9e97ff87c681d99635e1e2637f748742c65912fc
tree36e9a87478a29d4bd1b1b3af2967f029b2ef4afc
parentaa8ff7d04634080d3a28a207d688cd21b9b5392b
Fixed logical assignment short-circuit with non-writable properties.

When the logical condition was already satisfied (e.g., falsy for &&=,
truthy for ||=, non-nullish for ??=), the short-circuit jump landed on
the property set instruction instead of past it.  This caused spurious
TypeErrors for non-writable, getter-only, and non-extensible property
targets even though no assignment should occur.

This fixes logical assignment introduced in 1a64ba68.
This change fixes 9 more tests in test262.
src/njs_generator.c
src/test/njs_unit_test.c