Comments (5)
hi @michaelmior thank you for the bug report. I will investigate and will use this as a chance to revive this package.
from js-set-extension.
This revealed another bug in Set.prototype.equal
, where
Set {
Set { 1, 2, 3 },
Set { 1, 2 },
Set { 1, 3 },
Set { 2, 3 },
Set { 1 },
Set { 2 },
Set { 3 },
Set {}
}
and
Set {
Set { 3 },
Set { 3, 2 },
Set { 3, 1 },
Set { 3, 2, 1 },
Set {},
Set { 1 },
Set { 2 },
Set { 3 }
}
are evualuated as equal, while in fact they are not.
from js-set-extension.
Another bug is that there should be no doubled entries of Set { 3 }
. It is right to assume, that these are two totally different instances and therefore pass the checks but their absolute value representation are the same (Set { 3 }
should be considered equal to Set { 3 }
). So the Set.prototype.has
function is also involved here.
The has function is not involved, as it works correct. The add function is rather affected:
const set = (...args) => new Set(args)
const set1 = set(3)
const set2 = set(3)
const set3 = set()
set3.add(set1)
set3.has(set1) // true
set3.has(set2) // true
set3.add(set2) // should skip set2
set3 // Set { Set { 3 }, Set { 3 } }
from js-set-extension.
@michaelmior I added you as collaborator. If you accept I can assign you to review the PR #51 which attempts to fix the issue.
from js-set-extension.
Implemented, via #51
from js-set-extension.
Related Issues (20)
- Union HOT 3
- intersections HOT 2
- differences HOT 2
- products HOT 2
- power set HOT 1
- Keep orinal constructor name and add a flag instead to indicate the polyfill is present HOT 1
- more meta tags so people can find repo HOT 3
- Version 2 HOT 8
- Suggested properties HOT 5
- suggested function list HOT 7
- isEmpty method HOT 4
- create randomElement method HOT 3
- better whitespace in docs HOT 10
- Split into modules as file will soon exceed 1000 lines HOT 3
- Code coverage broken? HOT 1
- suggested Set implementation for JS 5 HOT 4
- Why can we use global variable? HOT 3
- Update CI Environment HOT 3
- Replace global with globalThis for browser HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-set-extension.