mathiasbynens / Array.from

A robust & optimized ES3-compatible polyfill for the `Array.from` method in ECMAScript 6.

Home Page:https://mths.be/array-from

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map/Set Iterator tests broken in Firefox

ljharb opened this issue · comments

@falsandtru @JakeChampion

I'm not sure how you were testing in Safari after those PRs, but things were decidedly not passing - they are now, at least.

With the latest changes - your PRs and my later tweaks/fixes - everything passes in all versions of Safari, as well as latest Chrome. However, the iterator tests do not pass in Firefox.

We can't release with these changes until all versions of Safari, Firefox, Chrome, IE, and Edge pass all tests.

The way I test is npm install -g testling and testling -u - then running that URL in the relevant browser. Let's get this figured out!

I've been testing with zuul -- npm i -g zuul and zuul tests/tests.js --ui tape. I'll look into testling, thanks for the tip :-)

@ljharb @JakeChampion Can you share details of test failures about cloud testing? Now I'm trying to use zuul, but zuul is too slow.

@ljharb Test failures are probably added by b418493. t.test('works with Map objects', { 'skip': !hasMap }, function (te) { checks only the Map feature, but sometimes it is not iterable. Map basic support is added in Firefox 13, but its iterability is added in 17, and our test targets are firefox/15.0..latest(package.json).

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

Another, Firefox browsers have 3 type iterators which are 'iterator', '@@iterator', and Symbol.iterator. If we support Firefox of less than Gecko 27, we need to support the 'iterator' iterator.

[2] From Gecko 17 (Firefox 17 / Thunderbird 17 / SeaMonkey 2.14) to Gecko 26 (Firefox 26 / Thunderbird 26 / SeaMonkey 2.23 / Firefox OS 1.2) the iterator property was used (bug 907077), and from Gecko 27 to Gecko 35 the "@@iterator" placeholder was used. In Gecko 36 (Firefox 36 / Thunderbird 36 / SeaMonkey 2.33), the @@iterator symbol got implemented (bug 918828).

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of

But those legacy iterators probably can be supported by for-of statements. So implementations for '@@iterator' probably can and should be removed.

@falsandtru we should handle FF 13-17 as well - unrelated to what's specified in "testling" in package.json.

In implementations where there is an iterator property, will for..of read it off of the value?

will for..of read it off of the value?

Maybe, so it(#43) is made as the additional change after merging #42 and #44. #42 and #44 are fixes for this issue.

Here are the test failures for firefox on master -- https://gist.github.com/JakeChampion/364bec6361989d0c0945fbf93db5f674

Now that we're using es-get-iterator by way of iterate-value, these tests should pass in every browser and engine. v1.1.0 will be released shortly containing all these fixes.