Skip to content

Commit

Permalink
[Fix] in WSH, Object.getPrototypeOf([].values()) is falsy
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored and ljharb committed Apr 28, 2021
1 parent d4be3e6 commit 023fde8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion es6-shim.js
Expand Up @@ -1268,7 +1268,10 @@
// Chrome defines keys/values/entries on Array, but doesn't give us
// any way to identify its iterator. So add our own shimmed field.
if (Object.getPrototypeOf) {
addIterator(Object.getPrototypeOf([].values()));
var ChromeArrayIterator = Object.getPrototypeOf([].values());
if (ChromeArrayIterator) { // in WSH, this is `undefined`
addIterator(ChromeArrayIterator);
}
}

// note: this is positioned here because it relies on Array#entries
Expand Down

0 comments on commit 023fde8

Please sign in to comment.