mirror of https://github.com/tc39/test262.git
built-ins/Set/*: make all indentation consistent (depth & character) (#1431)
This commit is contained in:
parent
a61b9cd671
commit
af37c92af7
|
@ -11,7 +11,7 @@ description: >
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.getPrototypeOf(Set.prototype),
|
||||
Object.prototype,
|
||||
"`Object.getPrototypeOf(Set.prototype)` returns `Object.prototype`"
|
||||
Object.getPrototypeOf(Set.prototype),
|
||||
Object.prototype,
|
||||
"`Object.getPrototypeOf(Set.prototype)` returns `Object.prototype`"
|
||||
);
|
||||
|
|
|
@ -8,7 +8,7 @@ description: >
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.getPrototypeOf(Set),
|
||||
Function.prototype,
|
||||
"`Object.getPrototypeOf(Set)` returns `Function.prototype`"
|
||||
Object.getPrototypeOf(Set),
|
||||
Function.prototype,
|
||||
"`Object.getPrototypeOf(Set)` returns `Function.prototype`"
|
||||
);
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.add,
|
||||
"function",
|
||||
"`typeof Set.prototype.add` is `'function'`"
|
||||
typeof Set.prototype.add,
|
||||
"function",
|
||||
"`typeof Set.prototype.add` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "add");
|
||||
|
|
|
@ -14,6 +14,6 @@ description: >
|
|||
|
||||
---*/
|
||||
|
||||
var s = new Set([ 1 ]);
|
||||
var s = new Set([1]);
|
||||
|
||||
assert.sameValue(s.add(1), s, "`s.add(1)` returns `s`");
|
||||
|
|
|
@ -16,7 +16,7 @@ description: >
|
|||
|
||||
---*/
|
||||
|
||||
var s = new Set([ 1 ]);
|
||||
var s = new Set([1]);
|
||||
|
||||
assert.sameValue(s.size, 1, "The value of `s.size` is `1`");
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ description: >
|
|||
|
||||
---*/
|
||||
|
||||
var s = new Set([ -0 ]);
|
||||
var s = new Set([-0]);
|
||||
|
||||
assert.sameValue(s.size, 1, "The value of `s.size` is `1`");
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.clear,
|
||||
"function",
|
||||
"`typeof Set.prototype.clear` is `'function'`"
|
||||
typeof Set.prototype.clear,
|
||||
"function",
|
||||
"`typeof Set.prototype.clear` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "clear");
|
||||
|
|
|
@ -10,7 +10,7 @@ description: >
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Set.prototype.constructor,
|
||||
Set,
|
||||
"The value of `Set.prototype.constructor` is `Set`"
|
||||
Set.prototype.constructor,
|
||||
Set,
|
||||
"The value of `Set.prototype.constructor` is `Set`"
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ description: >
|
|||
|
||||
---*/
|
||||
|
||||
var s = new Set([ 1 ]);
|
||||
var s = new Set([1]);
|
||||
|
||||
assert.sameValue(s.size, 1, "The value of `s.size` is `1`");
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ description: >
|
|||
|
||||
---*/
|
||||
|
||||
var s = new Set([ -0 ]);
|
||||
var s = new Set([-0]);
|
||||
|
||||
assert.sameValue(s.size, 1, "The value of `s.size` is `1`");
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.delete,
|
||||
"function",
|
||||
"`typeof Set.prototype.delete` is `'function'`"
|
||||
typeof Set.prototype.delete,
|
||||
"function",
|
||||
"`typeof Set.prototype.delete` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "delete");
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.entries,
|
||||
"function",
|
||||
"`typeof Set.prototype.entries` is `'function'`"
|
||||
typeof Set.prototype.entries,
|
||||
"function",
|
||||
"`typeof Set.prototype.entries` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "entries");
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.forEach,
|
||||
"function",
|
||||
"`typeof Set.prototype.forEach` is `'function'`"
|
||||
typeof Set.prototype.forEach,
|
||||
"function",
|
||||
"`typeof Set.prototype.forEach` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "forEach");
|
||||
|
|
|
@ -13,7 +13,7 @@ description: >
|
|||
var s = new Set([1]);
|
||||
|
||||
assert.sameValue(
|
||||
s.forEach(function() {}),
|
||||
undefined,
|
||||
"`s.forEach(function() {})` returns `undefined`"
|
||||
s.forEach(function() {}),
|
||||
undefined,
|
||||
"`s.forEach(function() {})` returns `undefined`"
|
||||
);
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.has,
|
||||
"function",
|
||||
"`typeof Set.prototype.has` is `'function'`"
|
||||
typeof Set.prototype.has,
|
||||
"function",
|
||||
"`typeof Set.prototype.has` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "has");
|
||||
|
|
|
@ -19,4 +19,3 @@ var result = s.delete(undefined);
|
|||
|
||||
assert.sameValue(s.has(undefined), false, "`s.has(undefined)` returns `false`");
|
||||
assert.sameValue(result, true, "The result of `s.delete(undefined)` is `true`");
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Set.prototype.keys,
|
||||
Set.prototype.values,
|
||||
"The value of `Set.prototype.keys` is `Set.prototype.values`"
|
||||
Set.prototype.keys,
|
||||
Set.prototype.values,
|
||||
"The value of `Set.prototype.keys` is `Set.prototype.values`"
|
||||
);
|
||||
|
|
|
@ -13,14 +13,14 @@ includes: [propertyHelper.js]
|
|||
var descriptor = Object.getOwnPropertyDescriptor(Set.prototype, "size");
|
||||
|
||||
assert.sameValue(
|
||||
typeof descriptor.get,
|
||||
"function",
|
||||
"`typeof descriptor.get` is `'function'`"
|
||||
typeof descriptor.get,
|
||||
"function",
|
||||
"`typeof descriptor.get` is `'function'`"
|
||||
);
|
||||
assert.sameValue(
|
||||
typeof descriptor.set,
|
||||
"undefined",
|
||||
"`typeof descriptor.set` is `\"undefined\"`"
|
||||
typeof descriptor.set,
|
||||
"undefined",
|
||||
"`typeof descriptor.set` is `\"undefined\"`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "size");
|
||||
|
|
|
@ -11,9 +11,9 @@ includes: [propertyHelper.js]
|
|||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
typeof Set.prototype.values,
|
||||
"function",
|
||||
"`typeof Set.prototype.values` is `'function'`"
|
||||
typeof Set.prototype.values,
|
||||
"function",
|
||||
"`typeof Set.prototype.values` is `'function'`"
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Set.prototype, "values");
|
||||
|
|
|
@ -25,14 +25,19 @@ var iterable = {};
|
|||
iterable[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return { value: null, done: false };
|
||||
return {
|
||||
value: null,
|
||||
done: false
|
||||
};
|
||||
},
|
||||
return: function() {
|
||||
count += 1;
|
||||
}
|
||||
};
|
||||
};
|
||||
Set.prototype.add = function() { throw new Error(); }
|
||||
Set.prototype.add = function() {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
assert.throws(Error, function() {
|
||||
new Set(iterable);
|
||||
|
|
|
@ -15,6 +15,7 @@ features: [Symbol.iterator]
|
|||
---*/
|
||||
|
||||
var iterable = {};
|
||||
|
||||
function MyError() {};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return {
|
||||
|
|
|
@ -17,6 +17,7 @@ features: [Symbol.iterator]
|
|||
|
||||
var count = 0;
|
||||
var iterable = {};
|
||||
|
||||
function MyError() {}
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return {
|
||||
|
|
|
@ -16,15 +16,15 @@ description: >
|
|||
var s1 = new Set();
|
||||
|
||||
assert.sameValue(
|
||||
Object.getPrototypeOf(s1),
|
||||
Set.prototype,
|
||||
"`Object.getPrototypeOf(s1)` returns `Set.prototype`"
|
||||
Object.getPrototypeOf(s1),
|
||||
Set.prototype,
|
||||
"`Object.getPrototypeOf(s1)` returns `Set.prototype`"
|
||||
);
|
||||
|
||||
var s2 = new Set([1, 2]);
|
||||
|
||||
assert.sameValue(
|
||||
Object.getPrototypeOf(s2),
|
||||
Set.prototype,
|
||||
"`Object.getPrototypeOf(s2)` returns `Set.prototype`"
|
||||
Object.getPrototypeOf(s2),
|
||||
Set.prototype,
|
||||
"`Object.getPrototypeOf(s2)` returns `Set.prototype`"
|
||||
);
|
||||
|
|
|
@ -17,7 +17,10 @@ features:
|
|||
- Symbol.iterator
|
||||
---*/
|
||||
|
||||
var set = new Set([[1, 11], [2, 22]]);
|
||||
var set = new Set([
|
||||
[1, 11],
|
||||
[2, 22]
|
||||
]);
|
||||
var iterator = set.keys();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
|
|
|
@ -17,7 +17,10 @@ features:
|
|||
- Symbol.iterator
|
||||
---*/
|
||||
|
||||
var set = new Set([[1, 11], [2, 22]]);
|
||||
var set = new Set([
|
||||
[1, 11],
|
||||
[2, 22]
|
||||
]);
|
||||
var iterator = set[Symbol.iterator]();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
|
|
|
@ -17,7 +17,10 @@ features:
|
|||
- Symbol.iterator
|
||||
---*/
|
||||
|
||||
var set = new Set([[1, 11], [2, 22]]);
|
||||
var set = new Set([
|
||||
[1, 11],
|
||||
[2, 22]
|
||||
]);
|
||||
var iterator = set.values();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
|
|
Loading…
Reference in New Issue