Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classList doesn't support Symbol.iterator #1146

Open
davletovalmir opened this issue Oct 26, 2023 · 1 comment
Open

classList doesn't support Symbol.iterator #1146

davletovalmir opened this issue Oct 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@davletovalmir
Copy link

Describe the bug
You can't with [...dom.classList] with happy-dom, because it doesn't implement the iterator (Symbol.iterator).

To Reproduce
Steps to reproduce the behavior:

  1. Render anything with happy-dom (e.g. <div class="hi"></div>
  2. Get that element: const hi = document.querySelector('.hi')
  3. Log the spread classList: console.log([...hi.classList])
  4. See error: Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.

Expected behavior
Logs ["hi"] into stdout

Screenshots
N/A

Device:

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
N/A

@davletovalmir davletovalmir added the bug Something isn't working label Oct 26, 2023
@TreyVigus
Copy link
Contributor

Looks like this was resolved with #1365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants