mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 08:54:35 +02:00
built-ins/WeakMap/*: make all indentation consistent (depth & character) (#1428)
This commit is contained in:
parent
e0db75f74b
commit
621d34d5ea
@ -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');
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -45,5 +45,7 @@ assert.throws(TypeError, function() {
|
||||
});
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new WeakMap([['a', 1], 2]);
|
||||
new WeakMap([
|
||||
['a', 1], 2
|
||||
]);
|
||||
});
|
||||
|
@ -22,7 +22,9 @@ info: |
|
||||
---*/
|
||||
|
||||
var foo = {};
|
||||
var map = new WeakMap([[foo, 42]]);
|
||||
var map = new WeakMap([
|
||||
[foo, 42]
|
||||
]);
|
||||
|
||||
var result = map.delete(foo);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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`');
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user