From f25e9725946b483ec6c8ebd39d3a9a8d3e83d998 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Sat, 14 Feb 2026 14:51:33 +0800 Subject: [PATCH] NodeList index fix + Node.childNode fix An index out of range request to a nodelist , e.g. childNodes[1000] now properly returns a error.NotHandled error, which is given to v8 as a non-intercepted property. When a ChildNode node list is created from Node.childNode, we store the *Node rather than its children. ChildNode is meant to be live, so if the node's children changes, we should capture that. --- src/browser/tests/node/child_nodes.html | 2 ++ src/browser/webapi/Node.zig | 4 ++-- src/browser/webapi/collections/ChildNodes.zig | 10 +++++----- src/browser/webapi/collections/NodeList.zig | 6 +++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/browser/tests/node/child_nodes.html b/src/browser/tests/node/child_nodes.html index 3a6b6797..a5780d4b 100644 --- a/src/browser/tests/node/child_nodes.html +++ b/src/browser/tests/node/child_nodes.html @@ -22,6 +22,8 @@ testing.expectEqual(undefined, children[-1]); testing.expectEqual(['p1', 'p2'], Array.from(children).map((n) => n.id)); + + testing.expectEqual(false, 10 in children);