built-ins/WeakMap/*: make all indentation consistent (depth & character) (#1428)

This commit is contained in:
Rick Waldron 2018-02-15 15:40:46 -05:00 committed by Leo Balter
parent e0db75f74b
commit 621d34d5ea
12 changed files with 41 additions and 17 deletions

View File

@ -27,7 +27,10 @@ WeakMap.prototype.set = function(key, value) {
});
return set.call(this, key, value);
};
var map = new WeakMap([[first, 42], [second, 43]]);
var map = new WeakMap([
[first, 42],
[second, 43]
]);
assert.sameValue(results.length, 2, 'Called WeakMap#set for each object');
assert.sameValue(results[0].key, first, 'Adds object in order - first key');

View File

@ -20,14 +20,19 @@ var iterable = {};
iterable[Symbol.iterator] = function() {
return {
next: function() {
return { value: [], done: false };
return {
value: [],
done: false
};
},
return: function() {
count += 1;
}
};
};
WeakMap.prototype.set = function() { throw new Test262Error(); };
WeakMap.prototype.set = function() {
throw new Test262Error();
};
assert.throws(Test262Error, function() {
new WeakMap(iterable);

View File

@ -28,7 +28,10 @@ var iterable = {};
iterable[Symbol.iterator] = function() {
return {
next: function() {
return { value: nextItem, done: false };
return {
value: nextItem,
done: false
};
},
return: function() {
count += 1;

View File

@ -45,5 +45,7 @@ assert.throws(TypeError, function() {
});
assert.throws(TypeError, function() {
new WeakMap([['a', 1], 2]);
new WeakMap([
['a', 1], 2
]);
});

View File

@ -22,7 +22,9 @@ info: |
---*/
var foo = {};
var map = new WeakMap([[foo, 42]]);
var map = new WeakMap([
[foo, 42]
]);
var result = map.delete(foo);

View File

@ -21,7 +21,9 @@ info: |
var foo = {};
var bar = {};
var baz = [];
var map = new WeakMap([[foo,0]]);
var map = new WeakMap([
[foo, 0]
]);
assert.sameValue(map.get(foo), 0);

View File

@ -18,6 +18,8 @@ info: |
---*/
var foo = {};
var map = new WeakMap([[foo, 1]]);
var map = new WeakMap([
[foo, 1]
]);
assert.sameValue(map.set(foo, 1), map, '`map.set(foo, 1)` returns `map`');

View File

@ -20,14 +20,19 @@ var iterable = {};
iterable[Symbol.iterator] = function() {
return {
next: function() {
return { value: null, done: false };
return {
value: null,
done: false
};
},
return: function() {
count += 1;
}
};
};
WeakSet.prototype.add = function() { throw new Test262Error(); };
WeakSet.prototype.add = function() {
throw new Test262Error();
};
assert.throws(Test262Error, function() {
new WeakSet(iterable);