]> git.kaiwu.me - njs.git/commit
Fixed aggregation methods of Promise ctor with array-like object.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 26 Apr 2022 23:07:02 +0000 (16:07 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 26 Apr 2022 23:07:02 +0000 (16:07 -0700)
commit31ed93a5623f24ca94e6d47e895ba735d9d97d46
tree8262bf4539340adea8238ae48097344d4efbcee1
parent2e00e95473861846aa8538be87db07699d9f676d
Fixed aggregation methods of Promise ctor with array-like object.

Previously, while iterating over an array-like object the methods may be
resolved with INVALID values. INVALID value is a special internal type which
should never be visible by ordinary functions.

The fix is to ensure that absent elements are represented by undefined value.

The following methods were fixed Promise.all(), Promise.allSettled(),
    Promise.any(), Promise.race().

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