closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

Native Array.from and polyfilled Set on Firefox 32-36 without Symbol.iterator support

Open vecmezoni opened this issue 4 years ago • 3 comments

Current Set conformance check forces polyfill for Set, but will keep original Array.from in Firefox 32-36. These versions use set["@@iterator"] instead of set[Symbol.iterator] which leads to Array.from(new Set("a")) to be [], although native implementation would return correct result.

I don't know whether

  1. Whether it is a concern at all (I think it is even that Firefox 32-36 quite rare they have better feature set than IE11 and probably shouldn't have broken experience)
  2. We should expose @@iterator in Set polyfill
  3. We should lookup @@iterator in Array.from
  4. Other options I haven't thought of

I assume that this can affect other collections and methods that expect iterator.

vecmezoni avatar Nov 11 '20 09:11 vecmezoni

I would expect the polyfill for Set to pull-in Symbol.iterator since it has 'require es6/symbol';. But, Firefox < 36 does not support Symbol.iterator.

rishipal avatar Nov 18 '20 00:11 rishipal

What language level output are you using? That version of Firefox may not support it.

rrdelaney avatar Nov 25 '20 20:11 rrdelaney

I think language_out it is ECMASCRIPT5

vecmezoni avatar Feb 03 '21 11:02 vecmezoni