]> git.kaiwu.me - njs.git/commit
Fixed retval handling after an exception.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 23 May 2024 06:08:15 +0000 (23:08 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 23 May 2024 06:08:15 +0000 (23:08 -0700)
commit6d624bbbef5c68ee9c28a9976bc8dd99b2fc11cf
tree7ac6fc1da592524556552979233b1c6e956a5bdd
parent09d04c3b468ea17d0f25160c2728e5d44b193ead
Fixed retval handling after an exception.

Previously, some functions set a retval too early.  If this happened
before an exception a partially created object in inconsistent state
may be visible outside the affected functions.

The following functions were fixed:
Object.prototype.valueOf()
Array.prototype.toSpliced()
Array.prototype.toReversed()
Array.prototype.toSorted()

This fixes #713 issue on Github.
src/njs_array.c
src/njs_object.c
src/test/njs_unit_test.c