js: implement Element.getAttributeNames()

The method was missing, so calling it threw TypeError: ... is not a function, which broke Vue 3/Nuxt client hydration (Closes #297). Back it with the existing attribute_names op, the same source as the attributes getter, so the order matches attributes and outerHTML.
This commit is contained in:
Gabriel authored and GitHub committed 2026-06-13 16:24:59 +00:00
commit af2f89a03e
1 file changed
+1
+1
View File
@@ -1072,6 +1072,7 @@ class Element extends Node {
removeAttributeNS(ns, n) { _dom("remove_attribute", this._nid, String(n)); }
hasAttribute(n) { return this.getAttribute(n) !== null; }
hasAttributes() { return true; } // Simplified
getAttributeNames() { return _domParse("attribute_names", this._nid) || []; }
get attributes() {
const el = this;
const names = _domParse("attribute_names", el._nid) || [];