Comments (15)
I'm not 100% sure, but it seems like this is a dup of #3.
from is-equal.
I'm using those test cases, and it's working for me in Safari 7 and 8, and IE 9 - 11 :-/
from is-equal.
Is there any possibility that in your tests, you've got something that modifies globals?
from is-equal.
Is there any possibility that in your tests, you've got something that modifies globals?
Yes, there is. I'm using Babel's polyfill to get Map/Set support in those browsers. That's probably the culprit.
Either:
a) I should just skip Map/Set tests in environments that don't support them (probably easiest) or
b) we should make sure is-equal
is ok with the Babel polyfill
I'm open to either.
from is-equal.
ok, I just pushed a commit that only runs tests for Map
and Set
in environments that support them natively (no polyfill). However, it looks like I've still got a problem in IE11 where this test is failing with Set
s.
From what I can tell, it looks like
isEqual(new Set('a'), new Set('b')) === true
in IE11. Can you please confirm?
from is-equal.
OK, so, core-js (babel's polyfill) definitely does slightly different things than es6-shim's (which is what is-equal is tested with) - they're not fully spec-compliant. I can definitely try to add tests though to make is-equal work with those.
Regarding IE 11, this is actually a browser bug - new Set('a').size === 0
is true in IE 11, so both of your sets are empty. There's enough browser bugs with passing an iterable in both Map
and Set
that you simply can not rely on it working, unless of course you're using the es6-shim. If you change your tests to var a = new Set(); a.add('a'); var b = new Set(); b.add('b'); isEqual(a, b) === true
will pass as expected.
from is-equal.
Thanks for the tip. I've updated my Set
tests accordingly and everything's green in IE 11. Looks like is-equal
just needs compat with core-js
.
from is-equal.
@mjackson I've narrowed down the issue to a bug in core-js
, and filed the above issue to attempt to resolve it.
from is-equal.
I found a similar problem in [email protected]
Problem is that Phantom is not throwing an error while calling Map.prototype.forEach
with object as first arg.
https://github.com/ljharb/is-equal/blob/master/index.js#L68
And the tryMapSetEntries
returns an empty array instead of false.
It looks like PhantomJS issue, but may be it will help you.
from is-equal.
@Poplava phantomjs 1.9 has Map and Set? I thought it didn't even have "bind". Are you using core-js
with it?
from is-equal.
@ljharb I didn't use core-js
. I've just realized, Map and Set may come from babel-polyfill
.
from is-equal.
@Poplava babel-polyfill
is core-js
.
from is-equal.
@ljharb oh, really! I'm sorry... I confused.
from is-equal.
@mjackson v1.4.1
is released - this will ensure both that core-js
doesn't cause false positives due to Map
/Set
support, and also that when zloirock/core-js#144 is fixed, core-js
Map
s and Set
s should just automatically start working with is-equal
.
from is-equal.
π Thanks for the quick turnaround on this, @ljharb
from is-equal.
Related Issues (20)
- Set and Map only works in order HOT 5
- Object.create(null) is not equal to {}βFeature or bug? HOT 3
- An in-range update of eslint is breaking the build π¨ HOT 2
- Version 10 of node.js has been released HOT 1
- An in-range update of tape is breaking the build π¨ HOT 1
- An in-range update of is-callable is not breaking the build π¨ HOT 1
- An in-range update of replace is breaking the build π¨ HOT 2
- An in-range update of core-js is breaking the build π¨ HOT 1
- An in-range update of @ljharb/eslint-config is breaking the build π¨ HOT 2
- An in-range update of eslint is breaking the build π¨ HOT 3
- An in-range update of tape is breaking the build π¨ HOT 6
- Action required: Greenkeeper could not be activated π¨
- Typescript definition HOT 1
- Syntax error with which-collection dependency in 1.6.1 HOT 3
- An in-range update of make-generator-function is breaking the build π¨ HOT 1
- An in-range update of make-arrow-function is breaking the build π¨ HOT 1
- An in-range update of auto-changelog is breaking the build π¨ HOT 2
- Dependency Dashboard
- 1.6.2 tests don't start (project create with nwb) HOT 6
- Can we try object.toString before Object.prototype.toString? HOT 6
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 is-equal.