Skip to content

Commit

Permalink
Separate shim definition from shim application, for replacing buggy i…
Browse files Browse the repository at this point in the history
…mplementations
  • Loading branch information
ljharb committed Sep 3, 2014
1 parent 19c3033 commit c997b56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
});
addIterator(ArrayIterator.prototype);

defineProperties(Array.prototype, {
var arrayPrototypeShims = {
copyWithin: function(target, start) {
var end = arguments[2]; // copyWithin.length must be 2
var o = ES.ToObject(this);
Expand Down Expand Up @@ -742,7 +742,9 @@
entries: function() {
return new ArrayIterator(this, "entry");
}
});
};
defineProperties(Array.prototype, arrayPrototypeShims);

addIterator(Array.prototype, function() { return this.values(); });
// Chrome defines keys/values/entries on Array, but doesn't give us
// any way to identify its iterator. So add our own shimmed field.
Expand Down

0 comments on commit c997b56

Please sign in to comment.