Skip to content

Commit

Permalink
Fix Chrome bug with missing Array#values.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 19, 2014
1 parent 40a4963 commit bb104e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,13 @@
if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) {
delete Array.prototype.entries;
}

// Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values
if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) {
defineProperties(Array.prototype, {
values: Array.prototype[$iterator$]
});
}
defineProperties(Array.prototype, ArrayPrototypeShims);

addIterator(Array.prototype, function () { return this.values(); });
Expand Down

0 comments on commit bb104e8

Please sign in to comment.