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

fix(JS): selectors is a Set with size, not length #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mountainash
Copy link

@adamschwartz
Copy link
Owner

Looks good, thanks. Quick question before merging: was this working before (or is it working now)? If so, does that mean that Worker’s Set implementation just happened to support a .length alias as well?

mountainash

This comment was marked as duplicate.

@mountainash
Copy link
Author

mountainash commented Jun 24, 2023

Try this in your JS console:

var mySet = new Set();
mySet.add(1);
mySet.add(5);
mySet.add('some text');

console.info(mySet.length); // undefined

console.info(mySet.size); // 3

You'll see that length fails. I've updated the commit so that the JSON output format remains the same (so more of a "refactor" than a "fix").

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

Successfully merging this pull request may close these issues.

2 participants