Skip to content

Commit

Permalink
Fixing Map/Set invalid receiver error messages for WebKit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 28, 2015
1 parent c652565 commit dc01774
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ describe('Collections', function () {
});

it('throws when called on a non-Map', function () {
var expectedMessage = /^(Method )?Map.prototype.entries called on incompatible receiver |^entries method called on incompatible /;
var expectedMessage = /^(Method )?Map.prototype.entries called on incompatible receiver |^entries method called on incompatible |^Cannot create a Map entry iterator for a non-Map object./;
var nonMaps = [true, false, 'abc', NaN, new Set([1, 2]), { a: true }, [1], Object('abc'), Object(NaN)];
nonMaps.forEach(function (nonMap) {
expect(function () { return Map.prototype.entries.call(nonMap); }).to['throw'](TypeError, expectedMessage);
Expand Down Expand Up @@ -758,7 +758,7 @@ describe('Collections', function () {
});

it('throws when called on a non-Set', function () {
var expectedMessage = /^(Method )?Set.prototype.values called on incompatible receiver |^values method called on incompatible /;
var expectedMessage = /^(Method )?Set.prototype.values called on incompatible receiver |^values method called on incompatible |^Cannot create a Set value iterator for a non-Set object.$/;
var nonSets = [true, false, 'abc', NaN, new Map([[1, 2]]), { a: true }, [1], Object('abc'), Object(NaN)];
nonSets.forEach(function (nonSet) {
expect(function () { return Set.prototype.values.call(nonSet); }).to['throw'](TypeError, expectedMessage);
Expand Down

0 comments on commit dc01774

Please sign in to comment.