]> git.kaiwu.me - njs.git/commit
TypedArray: fix numeric property definitions
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 4 Sep 2026 01:48:39 +0000 (18:48 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 4 Sep 2026 21:53:08 +0000 (14:53 -0700)
commit7e4194c53303d222bdc77d0d742a71be298b8cf8
tree62deac6dad3bb6a602eb0020f992a2025a2f1cb6
parentbe7faf3dc64e72e1a77e0e28dca2d81abefaaea0
TypedArray: fix numeric property definitions

Previously, integer-indexed exotic validation was restricted to keys marked
as strings.  Numeric atoms and the canonical string "NaN" could bypass the
check and be installed as ordinary typed-array properties.

The fix is to validate numeric atoms and canonical numeric strings after key
conversion, and to remove the obsolete source-type flag.

The numeric-key bypass was introduced in b28e50b1 (0.9.0); the incomplete
canonical-index handling dates to bf208048 (0.3.8).

This closes #1098 issue on GitHub.
src/njs_object.h
src/njs_object_prop.c
src/test/njs_unit_test.c