diff options
Diffstat (limited to 'test/built-ins/Map')
25 files changed, 35 insertions, 88 deletions
diff --git a/test/built-ins/Map/iterable-calls-set.js b/test/built-ins/Map/iterable-calls-set.js index 3b512eb4b..989cab985 100644 --- a/test/built-ins/Map/iterable-calls-set.js +++ b/test/built-ins/Map/iterable-calls-set.js @@ -18,10 +18,7 @@ includes: [compareArray.js] var mapSet = Map.prototype.set; var counter = 0; -var iterable = [ - ["foo", 1], - ["bar", 2] -]; +var iterable = [["foo", 1], ["bar", 2]]; var results = []; var _this = []; diff --git a/test/built-ins/Map/iterator-close-after-set-failure.js b/test/built-ins/Map/iterator-close-after-set-failure.js index 321c0a729..144d74373 100644 --- a/test/built-ins/Map/iterator-close-after-set-failure.js +++ b/test/built-ins/Map/iterator-close-after-set-failure.js @@ -20,19 +20,14 @@ var iterable = {}; iterable[Symbol.iterator] = function() { return { next: function() { - return { - value: [], - done: false - }; + return { value: [], done: false }; }, return: function() { count += 1; } }; }; -Map.prototype.set = function() { - throw new Test262Error(); -} +Map.prototype.set = function() { throw new Test262Error(); } assert.throws(Test262Error, function() { new Map(iterable); diff --git a/test/built-ins/Map/iterator-items-are-not-object-close-iterator.js b/test/built-ins/Map/iterator-items-are-not-object-close-iterator.js index 8c9bc4fe8..4e8e10a6c 100644 --- a/test/built-ins/Map/iterator-items-are-not-object-close-iterator.js +++ b/test/built-ins/Map/iterator-items-are-not-object-close-iterator.js @@ -27,10 +27,7 @@ var iterable = {}; iterable[Symbol.iterator] = function() { return { next: function() { - return { - value: nextItem, - done: false - }; + return { value: nextItem, done: false }; }, return: function() { count += 1; diff --git a/test/built-ins/Map/iterator-items-are-not-object.js b/test/built-ins/Map/iterator-items-are-not-object.js index aceebcef7..18b2b6df2 100644 --- a/test/built-ins/Map/iterator-items-are-not-object.js +++ b/test/built-ins/Map/iterator-items-are-not-object.js @@ -44,7 +44,5 @@ assert.throws(TypeError, function() { }); assert.throws(TypeError, function() { - new Map([ - ['a', 1], 2 - ]); + new Map([['a', 1], 2]); }); diff --git a/test/built-ins/Map/map-iterable-throws-when-set-is-not-callable.js b/test/built-ins/Map/map-iterable-throws-when-set-is-not-callable.js index 89fc9ce3c..d4ec50d3f 100644 --- a/test/built-ins/Map/map-iterable-throws-when-set-is-not-callable.js +++ b/test/built-ins/Map/map-iterable-throws-when-set-is-not-callable.js @@ -23,8 +23,5 @@ info: | Map.prototype.set = null; assert.throws(TypeError, function() { - new Map([ - [1, 1], - [2, 2] - ]); + new Map([[1,1], [2,2]]); }); diff --git a/test/built-ins/Map/map-iterable.js b/test/built-ins/Map/map-iterable.js index e46330ead..3aab35f3d 100644 --- a/test/built-ins/Map/map-iterable.js +++ b/test/built-ins/Map/map-iterable.js @@ -17,8 +17,8 @@ info: | ---*/ var m = new Map([ - ["attr", 1], - ["foo", 2] + [ "attr", 1 ], + [ "foo", 2 ] ]); assert.sameValue(m.size, 2, 'The value of `m.size` is `2`'); diff --git a/test/built-ins/Map/newtarget.js b/test/built-ins/Map/newtarget.js index 0206d23b1..a9589a4cc 100644 --- a/test/built-ins/Map/newtarget.js +++ b/test/built-ins/Map/newtarget.js @@ -25,10 +25,7 @@ assert.sameValue( "`Object.getPrototypeOf(m1)` returns `Map.prototype`" ); -var m2 = new Map([ - [1, 1], - [2, 2] -]); +var m2 = new Map([[1, 1], [2, 2]]); assert.sameValue( Object.getPrototypeOf(m2), diff --git a/test/built-ins/Map/prototype/clear/clear-map.js b/test/built-ins/Map/prototype/clear/clear-map.js index e5341fbdd..b6580d0a4 100644 --- a/test/built-ins/Map/prototype/clear/clear-map.js +++ b/test/built-ins/Map/prototype/clear/clear-map.js @@ -17,14 +17,11 @@ info: | features: [Symbol] ---*/ -var m1 = new Map([ - ['foo', 'bar'], - [1, 1] -]); +var m1 = new Map([['foo', 'bar'], [1, 1]]); var m2 = new Map(); var m3 = new Map(); m2.set('foo', 'bar'); -m2.set(1, 1); +m2.set(1,1); m2.set(Symbol('a'), Symbol('a')); m1.clear(); diff --git a/test/built-ins/Map/prototype/clear/clear.js b/test/built-ins/Map/prototype/clear/clear.js index 80fe0ac78..59f28de2e 100644 --- a/test/built-ins/Map/prototype/clear/clear.js +++ b/test/built-ins/Map/prototype/clear/clear.js @@ -11,9 +11,9 @@ includes: [propertyHelper.js] ---*/ assert.sameValue( - typeof Map.prototype.clear, - 'function', - 'typeof Map.prototype.clear is "function"' + typeof Map.prototype.clear, + 'function', + 'typeof Map.prototype.clear is "function"' ); verifyNotEnumerable(Map.prototype, 'clear'); diff --git a/test/built-ins/Map/prototype/clear/map-data-list-is-preserved.js b/test/built-ins/Map/prototype/clear/map-data-list-is-preserved.js index e83b87d5c..f49aefda0 100644 --- a/test/built-ins/Map/prototype/clear/map-data-list-is-preserved.js +++ b/test/built-ins/Map/prototype/clear/map-data-list-is-preserved.js @@ -20,11 +20,7 @@ info: | 6. Return undefined. ---*/ -var m = new Map([ - [1, 1], - [2, 2], - [3, 3] -]); +var m = new Map([[1,1], [2,2], [3,3]]); var e = m.entries(); e.next(); diff --git a/test/built-ins/Map/prototype/clear/returns-undefined.js b/test/built-ins/Map/prototype/clear/returns-undefined.js index ce4cfcff2..1e1d662aa 100644 --- a/test/built-ins/Map/prototype/clear/returns-undefined.js +++ b/test/built-ins/Map/prototype/clear/returns-undefined.js @@ -16,10 +16,7 @@ info: | 6. Return undefined. ---*/ -var m1 = new Map([ - ['foo', 'bar'], - [1, 1] -]); +var m1 = new Map([['foo', 'bar'], [1, 1]]); assert.sameValue(m1.clear(), undefined, 'clears a map and returns undefined'); assert.sameValue(m1.clear(), undefined, 'returns undefined on an empty map'); diff --git a/test/built-ins/Map/prototype/delete/delete.js b/test/built-ins/Map/prototype/delete/delete.js index 6d01496fe..4bf8688ef 100644 --- a/test/built-ins/Map/prototype/delete/delete.js +++ b/test/built-ins/Map/prototype/delete/delete.js @@ -11,9 +11,9 @@ includes: [propertyHelper.js] ---*/ assert.sameValue( - typeof Map.prototype.delete, - 'function', - 'typeof Map.prototype.delete is "function"' + typeof Map.prototype.delete, + 'function', + 'typeof Map.prototype.delete is "function"' ); verifyNotEnumerable(Map.prototype, 'delete'); diff --git a/test/built-ins/Map/prototype/delete/does-not-break-iterators.js b/test/built-ins/Map/prototype/delete/does-not-break-iterators.js index 1a788fdc0..895a7ecef 100644 --- a/test/built-ins/Map/prototype/delete/does-not-break-iterators.js +++ b/test/built-ins/Map/prototype/delete/does-not-break-iterators.js @@ -16,11 +16,7 @@ info: | ... ---*/ -var m = new Map([ - ['a', 1], - ['b', 2], - ['c', 3] -]); +var m = new Map([['a',1], ['b', 2], ['c', 3]]); var e = m.entries(); e.next(); diff --git a/test/built-ins/Map/prototype/delete/returns-false.js b/test/built-ins/Map/prototype/delete/returns-false.js index d1db1c97c..2f2300d35 100644 --- a/test/built-ins/Map/prototype/delete/returns-false.js +++ b/test/built-ins/Map/prototype/delete/returns-false.js @@ -15,10 +15,7 @@ info: | 6. Return false. ---*/ -var m = new Map([ - ['a', 1], - ['b', 2] -]); +var m = new Map([['a',1], ['b', 2]]); assert.sameValue(m.delete('not-in-the-map'), false); diff --git a/test/built-ins/Map/prototype/delete/returns-true-for-deleted-entry.js b/test/built-ins/Map/prototype/delete/returns-true-for-deleted-entry.js index 1f4ccb52e..02ad4b12d 100644 --- a/test/built-ins/Map/prototype/delete/returns-true-for-deleted-entry.js +++ b/test/built-ins/Map/prototype/delete/returns-true-for-deleted-entry.js @@ -16,10 +16,7 @@ info: | ... ---*/ -var m = new Map([ - ['a', 1], - ['b', 2] -]); +var m = new Map([['a',1], ['b', 2]]); var result = m.delete('a'); diff --git a/test/built-ins/Map/prototype/entries/returns-iterator.js b/test/built-ins/Map/prototype/entries/returns-iterator.js index 96626b244..b2a8ef5c4 100644 --- a/test/built-ins/Map/prototype/entries/returns-iterator.js +++ b/test/built-ins/Map/prototype/entries/returns-iterator.js @@ -17,9 +17,9 @@ info: | ---*/ var map = new Map(); -map.set('a', 1); -map.set('b', 2); -map.set('c', 3); +map.set('a',1); +map.set('b',2); +map.set('c',3); var iterator = map.entries(); var result; diff --git a/test/built-ins/Map/prototype/forEach/callback-result-is-abrupt.js b/test/built-ins/Map/prototype/forEach/callback-result-is-abrupt.js index f377e9c6e..d61bb4e2d 100644 --- a/test/built-ins/Map/prototype/forEach/callback-result-is-abrupt.js +++ b/test/built-ins/Map/prototype/forEach/callback-result-is-abrupt.js @@ -19,9 +19,7 @@ info: | flags: [noStrict] ---*/ -var map = new Map([ - [0, 0] -]); +var map = new Map([[0, 0]]); assert.throws(Test262Error, function() { map.forEach(function() { diff --git a/test/built-ins/Map/prototype/get/returns-undefined.js b/test/built-ins/Map/prototype/get/returns-undefined.js index 84f511184..42744d8c6 100644 --- a/test/built-ins/Map/prototype/get/returns-undefined.js +++ b/test/built-ins/Map/prototype/get/returns-undefined.js @@ -20,7 +20,7 @@ var map = new Map(); assert.sameValue( map.get('item'), undefined, - 'returns undefined if key is not on the map' + 'returns undefined if key is not on the map' ); map.set('item', 1); diff --git a/test/built-ins/Map/prototype/has/return-false-different-key-types.js b/test/built-ins/Map/prototype/has/return-false-different-key-types.js index 86c0897c0..0be565021 100644 --- a/test/built-ins/Map/prototype/has/return-false-different-key-types.js +++ b/test/built-ins/Map/prototype/has/return-false-different-key-types.js @@ -18,7 +18,7 @@ features: [Symbol] var map = new Map(); assert.sameValue(map.has('str'), false); -assert.sameValue(map.has(1), false); +assert.sameValue(map.has(1), false); assert.sameValue(map.has(NaN), false); assert.sameValue(map.has(true), false); assert.sameValue(map.has(false), false); diff --git a/test/built-ins/Map/prototype/has/return-true-different-key-types.js b/test/built-ins/Map/prototype/has/return-true-different-key-types.js index bcdaa0418..591f45109 100644 --- a/test/built-ins/Map/prototype/has/return-true-different-key-types.js +++ b/test/built-ins/Map/prototype/has/return-true-different-key-types.js @@ -33,7 +33,7 @@ map.set(null, undefined); map.set(undefined, undefined); assert.sameValue(map.has('str'), true); -assert.sameValue(map.has(1), true); +assert.sameValue(map.has(1), true); assert.sameValue(map.has(NaN), true); assert.sameValue(map.has(true), true); assert.sameValue(map.has(false), true); diff --git a/test/built-ins/Map/prototype/set/append-new-values-return-map.js b/test/built-ins/Map/prototype/set/append-new-values-return-map.js index 5d84eb8a2..8e5d43069 100644 --- a/test/built-ins/Map/prototype/set/append-new-values-return-map.js +++ b/test/built-ins/Map/prototype/set/append-new-values-return-map.js @@ -20,7 +20,7 @@ var result = map.set(1, 1); assert.sameValue(result, map); -result = map.set(1, 1).set(2, 2).set(3, 3); +result = map.set(1,1).set(2,2).set(3,3); assert.sameValue(result, map, 'Map.prototype.set is chainable'); diff --git a/test/built-ins/Map/prototype/set/append-new-values.js b/test/built-ins/Map/prototype/set/append-new-values.js index 93b99dcd9..3cc9f6f62 100644 --- a/test/built-ins/Map/prototype/set/append-new-values.js +++ b/test/built-ins/Map/prototype/set/append-new-values.js @@ -17,11 +17,7 @@ features: [Symbol] ---*/ var s = Symbol(2); -var map = new Map([ - [4, 4], - ['foo3', 3], - [s, 2] -]); +var map = new Map([[4, 4], ['foo3', 3], [s, 2]]); map.set(null, 42); map.set(1, 'valid'); diff --git a/test/built-ins/Map/prototype/set/replaces-a-value-normalizes-zero-key.js b/test/built-ins/Map/prototype/set/replaces-a-value-normalizes-zero-key.js index 427e7eb2c..991c8a277 100644 --- a/test/built-ins/Map/prototype/set/replaces-a-value-normalizes-zero-key.js +++ b/test/built-ins/Map/prototype/set/replaces-a-value-normalizes-zero-key.js @@ -16,15 +16,11 @@ info: | ... ---*/ -var map = new Map([ - [+0, 1] -]); +var map = new Map([[+0, 1]]); map.set(-0, 42); assert.sameValue(map.get(+0), 42, 'zero key is normalized in SameValueZero'); -map = new Map([ - [-0, 1] -]); +map = new Map([[-0, 1]]); map.set(+0, 42); assert.sameValue(map.get(-0), 42, 'zero key is normalized in SameValueZero'); diff --git a/test/built-ins/Map/prototype/set/replaces-a-value-returns-map.js b/test/built-ins/Map/prototype/set/replaces-a-value-returns-map.js index f211e63a5..447a8c4d9 100644 --- a/test/built-ins/Map/prototype/set/replaces-a-value-returns-map.js +++ b/test/built-ins/Map/prototype/set/replaces-a-value-returns-map.js @@ -17,9 +17,7 @@ info: | ... ---*/ -var map = new Map([ - ['item', 0] -]); +var map = new Map([['item', 0]]); var map2 = new Map(); var x = map.set('item', 42); diff --git a/test/built-ins/Map/prototype/set/replaces-a-value.js b/test/built-ins/Map/prototype/set/replaces-a-value.js index 21f48ea88..35b339dc6 100644 --- a/test/built-ins/Map/prototype/set/replaces-a-value.js +++ b/test/built-ins/Map/prototype/set/replaces-a-value.js @@ -16,9 +16,7 @@ info: | ... ---*/ -var m = new Map([ - ['item', 1] -]); +var m = new Map([['item', 1]]); m.set('item', 42); assert.sameValue(m.get('item'), 42); |