GithubHelp home page GithubHelp logo

Comments (15)

mjackson avatar mjackson commented on May 29, 2024

I'm not 100% sure, but it seems like this is a dup of #3.

from is-equal.

ljharb avatar ljharb commented on May 29, 2024

I'm using those test cases, and it's working for me in Safari 7 and 8, and IE 9 - 11 :-/

from is-equal.

ljharb avatar ljharb commented on May 29, 2024

Is there any possibility that in your tests, you've got something that modifies globals?

from is-equal.

mjackson avatar mjackson commented on May 29, 2024

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.

mjackson avatar mjackson commented on May 29, 2024

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 Sets.

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.

ljharb avatar ljharb commented on May 29, 2024

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.

mjackson avatar mjackson commented on May 29, 2024

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.

ljharb avatar ljharb commented on May 29, 2024

@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.

Poplava avatar Poplava commented on May 29, 2024

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.

ljharb avatar ljharb commented on May 29, 2024

@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.

Poplava avatar Poplava commented on May 29, 2024

@ljharb I didn't use core-js. I've just realized, Map and Set may come from babel-polyfill.

from is-equal.

ljharb avatar ljharb commented on May 29, 2024

@Poplava babel-polyfill is core-js.

from is-equal.

Poplava avatar Poplava commented on May 29, 2024

@ljharb oh, really! I'm sorry... I confused.

from is-equal.

ljharb avatar ljharb commented on May 29, 2024

@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 Maps and Sets should just automatically start working with is-equal.

from is-equal.

mjackson avatar mjackson commented on May 29, 2024

πŸ‘ Thanks for the quick turnaround on this, @ljharb

from is-equal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.