Skip to content

Comments

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

Open
mountainash wants to merge 2 commits intoadamschwartz:masterfrom
truthdomains:fix/set-no-length
Open

fix(JS): selectors is a Set with size, not length#11
mountainash wants to merge 2 commits intoadamschwartz:masterfrom
truthdomains:fix/set-no-length

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