Skip to content

Commit

Permalink
Better ES3 support:
Browse files Browse the repository at this point in the history
 - `delete` is a ES3 reserved word and must be quoted.
 - `int` is a reserved word
  • Loading branch information
ljharb committed Dec 31, 2014
1 parent dbfba27 commit 4306155
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe('Collections', function () {

it('should return false when deleting a nonexistent key', function () {
expect(map.has('a')).to.equal(false);
expect(map.delete('a')).to.equal(false);
expect(map['delete']('a')).to.equal(false);
});

it('should have keys, values and size props', function () {
Expand Down Expand Up @@ -477,7 +477,7 @@ describe('Collections', function () {

it('should return false when deleting an item not in the set', function () {
expect(set.has('a')).to.equal(false);
expect(set.delete('a')).to.equal(false);
expect(set['delete']('a')).to.equal(false);
});

it('should accept an iterable as argument', function () {
Expand Down
12 changes: 6 additions & 6 deletions test/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ describe('Number', function (undefined) {

it('should be true when abs(number) is less than 2^53', function () {
var safeIntegers = [0, 1, Math.pow(2, 53) - 1];
safeIntegers.forEach(function (int) {
expect(Number.isInteger(int)).to.equal(true);
expect(Number.isInteger(-int)).to.equal(true);
safeIntegers.forEach(function (integer) {
expect(Number.isInteger(integer)).to.equal(true);
expect(Number.isInteger(-integer)).to.equal(true);
});
});
});
Expand Down Expand Up @@ -180,9 +180,9 @@ describe('Number', function (undefined) {

it('should be true when abs(number) is less than 2^53', function () {
var safeIntegers = [0, 1, Math.pow(2, 53) - 1];
safeIntegers.forEach(function (int) {
expect(Number.isSafeInteger(int)).to.equal(true);
expect(Number.isSafeInteger(-int)).to.equal(true);
safeIntegers.forEach(function (integer) {
expect(Number.isSafeInteger(integer)).to.equal(true);
expect(Number.isSafeInteger(-integer)).to.equal(true);
});
});
});
Expand Down

0 comments on commit 4306155

Please sign in to comment.