Skip to content

Iterator constructor test doesn't work #2275

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

Open
foolip opened this issue Apr 11, 2025 · 0 comments
Open

Iterator constructor test doesn't work #2275

foolip opened this issue Apr 11, 2025 · 0 comments

Comments

@foolip
Copy link
Member

foolip commented Apr 11, 2025

https://mdn-bcd-collector.gooborg.com/tests/javascript/builtins/Iterator/Iterator

As discussed in mdn/browser-compat-data#26472 and linked issues, the Iterator constructor cannot be used directly, only as super() for a subclass.

The generated test for it is currently:

(function () {
  if (!("Iterator" in self)) {
    return { result: false, message: "Iterator is not defined" };
  }
  return bcd.testConstructor("Iterator", false);
})();

And that currently results in "Support Unknown" as invoking the constructor throws a TypeError, as it should.

A test for this would have to do something more like the example in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/Iterator#examples

foolip added a commit to mdn/browser-compat-data that referenced this issue Apr 11, 2025
The tests for the in mdn-bcd-collector don't work:
openwebdocs/mdn-bcd-collector#2275

Instead the second example in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/Iterator#examples
was pasted into Safari 18.4 Web Inspector to confirm it works.
caugner pushed a commit to mdn/browser-compat-data that referenced this issue Apr 11, 2025
Mark the Iterator constructor as supported in Safari 18.4

The tests for the in mdn-bcd-collector don't work:
openwebdocs/mdn-bcd-collector#2275

Instead the second example in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/Iterator#examples
was pasted into Safari 18.4 Web Inspector to confirm it works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant