js: implement Element.getAttributeNames()

The method was missing, so calling it threw TypeError: ... is not a
function, which broke Vue 3/Nuxt client hydration (issue #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:
SGavrl committed 2026-06-13 15:05:29 +00:00
1 parent cd889d5659
commit 09fe30ec39
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) || [];