]> git.kaiwu.me - njs.git/commit
Fixed working with array-like object in Promise.all() and friends.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 17 Jun 2022 00:33:49 +0000 (17:33 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 17 Jun 2022 00:33:49 +0000 (17:33 -0700)
commite008f7ae22834ff1173b7a0067b14c821102018d
tree3f5b0a2b27c23e5e122ce3d55d38f5f30d7bd2af
parentb403e2e83eb417e43c01707691b2092393d1911d
Fixed working with array-like object in Promise.all() and friends.

Prevously, the code while iterating over an array-like object did not
take into account objects with absent elements.  As a result, the
resulting array object was returning with elements containing garbage
values.

The fix is to allocate and fill the resulting array object on the fly.

This closes #538 issue on Github.
src/njs_promise.c
src/test/njs_unit_test.c