Merge pull request #1435 from lightpanda-io/handle_invalid_attribute_functions

skip invalid attribute functions
This commit is contained in:
Karl Seguin
2026-01-29 16:50:40 +08:00
committed by GitHub

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);