]> git.kaiwu.me - njs.git/commit
XML: preserve node methods with matching children
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 29 Sep 2026 05:23:45 +0000 (22:23 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 29 Sep 2026 20:48:28 +0000 (13:48 -0700)
commitc08eafae17a90e1b72044b22b3d802f89a574abb
tree72dbb8b701dbb98408e0a5801d9e0a6dc4ed18e1
parent96501ae3a6acb17e97f2223302e6f864d841e0bd
XML: preserve node methods with matching children

QuickJS exposes child elements as own properties, so a child named
like an XMLNode method hides the method on its prototype. Let methods
take precedence over bare child names, as on the njs engine. Keep the
child accessible through $tag$name and avoid deleting it when deleting
the method name.

Cover collisions for all XMLNode methods and prototype changes.
external/qjs_xml_module.c
test/xml/xml.t.mjs
ts/njs_modules/xml.d.ts