es6 array iterator polyfill in_iter-define: "Safari has buggy iterators w/o next
" - is the logic for this actually correct?
#236
Labels
next
" - is the logic for this actually correct?
#236
I am referring to this line from this file:
it is used when deciding to override
Array.prototype[Symbol.iterator]
, here:The problem is the value of
$default
simply grabs the existing native implementation which we just decided is buggy:It will use either
Array.prototype[Symbol.iterator]
orArray.prototype.values
.So either this logic is wrong, or this specific Safari bug only affects the iterator returned by
Array.prototype.keys
(and not.values
or[Symbol.iterator]
) which seems unlikely. Why bother overwritinghide(proto, ITERATOR, $default);
in that case?I ran into this while working with a page inside EAWebKit. Of course this is not an officially supported engine, however, its JS engine definitely exhibits this exact problem (
[].keys()
returns an iterator without a.next()
method - as does.values()
). My guess is EA just so happened to fork off the same buggy version of WebKit as Safari did when this behavior was dealt with.core-js definitely fails to polyfill Array iterators in EAWebKit, so this leaves two possibilities:
In the latter case we need to seriously re-evaluate EAWebKit and be on the lookout for all sorts of bugs unique to it, so I am very keen on finding out which it actually is.
If it's the former case I am happy to provide a PR.
The text was updated successfully, but these errors were encountered: