Handle invalid attribute functions

This commit is contained in:
Karl Seguin
2026-01-29 16:26:27 +08:00
parent 232e7a1759
commit 175edca8c7

View File

@@ -2243,7 +2243,7 @@ fn populateElementAttributes(self: *Page, element: *Element, list: anytype) !voi
// We may have found an event handler.
if (has_on_prefix) {
// Must be usable as function.
const func = try self.js.stringToPersistedFunction(attr.value.slice());
const func = self.js.stringToPersistedFunction(attr.value.slice()) catch continue;
// Longest known listener kind is 32 bytes long.
const remaining: u6 = @truncate(name.len -| 2);