Skip to content

Commit

Permalink
A better check for ArrayIterator and its subclasses.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 7, 2014
1 parent db6c5a0 commit 396a3fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,10 @@
defineProperties(ArrayIterator.prototype, {
next: function() {
var i = this.i, array = this.array;
if (i === undefined || this.kind === undefined) {
if (!(this instanceof ArrayIterator)) {
throw new TypeError('Not an ArrayIterator');
}
if (array!==undefined) {
if (array !== undefined) {
var len = ES.ToLength(array.length);
for (; i < len; i++) {
var kind = this.kind;
Expand Down

0 comments on commit 396a3fc

Please sign in to comment.