Skip to content

Commit

Permalink
Make sure none of these ToLength tests throw *any* error.
Browse files Browse the repository at this point in the history
This fails on `Array#map` with a clearer message in Firefox v38. Relates to #347.
  • Loading branch information
ljharb committed Jun 12, 2015
1 parent 5566960 commit 5ff2b94
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ var runArrayTests = function () {
it('uses ToLength to clamp negative values to zero', function () {
expect(function () {
Array.prototype.forEach.call(negativeLength, throwRangeError);
}).not.to['throw'](RangeError);
}).not.to['throw']();
});
});

Expand All @@ -858,7 +858,7 @@ var runArrayTests = function () {
var mapped;
expect(function () {
mapped = Array.prototype.map.call(negativeLength, throwRangeError);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(mapped).to.eql([]);
});
});
Expand All @@ -868,7 +868,7 @@ var runArrayTests = function () {
var filtered;
expect(function () {
filtered = Array.prototype.filter.call(negativeLength, throwRangeError);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(filtered).to.eql([]);
});
});
Expand All @@ -878,7 +878,7 @@ var runArrayTests = function () {
var result;
expect(function () {
result = Array.prototype.some.call(negativeLength, throwRangeError);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(result).to.equal([].some(Object));
});
});
Expand All @@ -888,7 +888,7 @@ var runArrayTests = function () {
var result;
expect(function () {
result = Array.prototype.every.call(negativeLength, throwRangeError);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(result).to.equal([].every(Object));
});
});
Expand All @@ -899,7 +899,7 @@ var runArrayTests = function () {
var reduced;
expect(function () {
reduced = Array.prototype.reduce.call(negativeLength, throwRangeError, accumulator);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(reduced).to.equal(accumulator);
});
});
Expand All @@ -913,7 +913,7 @@ var runArrayTests = function () {
var reduced;
expect(function () {
reduced = Array.prototype.reduceRight.call(obj, throwRangeError, accumulator);
}).not.to['throw'](RangeError);
}).not.to['throw']();
expect(reduced).to.equal(accumulator);
});
});
Expand Down

0 comments on commit 5ff2b94

Please sign in to comment.