Closed silverwind closed 4 months ago
Describe the bug DOMTokenList is currently not iterable in happy-dom while it is in jsdom, Firefox and Chrome.
DOMTokenList
The iterator should function exactly the same as DOMTokenList#values().
DOMTokenList#values()
To Reproduce
const div = document.createElement("div"); div.classList.add("foo", "bar"); for (const cls of div.classList) console.log(cls);
Expected behavior Outputs foo\nbar\n.
foo\nbar\n
Actual behaviour TypeError: div.classList is not iterable
TypeError: div.classList is not iterable
Describe the bug
DOMTokenList
is currently not iterable in happy-dom while it is in jsdom, Firefox and Chrome.The iterator should function exactly the same as
DOMTokenList#values()
.To Reproduce
Expected behavior Outputs
foo\nbar\n
.Actual behaviour
TypeError: div.classList is not iterable