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

This commit is contained in:
Rick Waldron 2018-02-15 17:35:45 -05:00 committed by Leo Balter
parent b59d956b3c
commit 0bf08dff3d
71 changed files with 558 additions and 522 deletions

View File

@ -18,7 +18,10 @@ includes: [compareArray.js]
var mapSet = Map.prototype.set; var mapSet = Map.prototype.set;
var counter = 0; var counter = 0;
var iterable = [["foo", 1], ["bar", 2]]; var iterable = [
["foo", 1],
["bar", 2]
];
var results = []; var results = [];
var _this = []; var _this = [];

View File

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

View File

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

View File

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

View File

@ -23,5 +23,8 @@ info: |
Map.prototype.set = null; Map.prototype.set = null;
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
new Map([[1,1], [2,2]]); new Map([
[1, 1],
[2, 2]
]);
}); });

View File

@ -25,7 +25,10 @@ assert.sameValue(
"`Object.getPrototypeOf(m1)` returns `Map.prototype`" "`Object.getPrototypeOf(m1)` returns `Map.prototype`"
); );
var m2 = new Map([[1, 1], [2, 2]]); var m2 = new Map([
[1, 1],
[2, 2]
]);
assert.sameValue( assert.sameValue(
Object.getPrototypeOf(m2), Object.getPrototypeOf(m2),

View File

@ -17,7 +17,10 @@ info: |
features: [Symbol] features: [Symbol]
---*/ ---*/
var m1 = new Map([['foo', 'bar'], [1, 1]]); var m1 = new Map([
['foo', 'bar'],
[1, 1]
]);
var m2 = new Map(); var m2 = new Map();
var m3 = new Map(); var m3 = new Map();
m2.set('foo', 'bar'); m2.set('foo', 'bar');

View File

@ -20,7 +20,11 @@ info: |
6. Return undefined. 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(); var e = m.entries();
e.next(); e.next();

View File

@ -16,7 +16,10 @@ info: |
6. Return undefined. 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, 'clears a map and returns undefined');
assert.sameValue(m1.clear(), undefined, 'returns undefined on an empty map'); assert.sameValue(m1.clear(), undefined, 'returns undefined on an empty map');

View File

@ -16,7 +16,11 @@ 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(); var e = m.entries();
e.next(); e.next();

View File

@ -15,7 +15,10 @@ info: |
6. Return false. 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); assert.sameValue(m.delete('not-in-the-map'), false);

View File

@ -16,7 +16,10 @@ info: |
... ...
---*/ ---*/
var m = new Map([['a',1], ['b', 2]]); var m = new Map([
['a', 1],
['b', 2]
]);
var result = m.delete('a'); var result = m.delete('a');

View File

@ -20,8 +20,7 @@ var ynum = 3;
for (var i = 0; i < ynum; i++) for (var i = 0; i < ynum; i++)
{ {
assert.sameValue( assert.sameValue(
Math.atan2(y[i], x), Math.atan2(y[i], x), -0,
-0,
"(" + y[i] + ", Infinity)" "(" + y[i] + ", Infinity)"
); );
} }

View File

@ -18,8 +18,7 @@ var xnum = 3;
for (var i = 0; i < xnum; i++) for (var i = 0; i < xnum; i++)
{ {
assert.sameValue( assert.sameValue(
Math.atan2(y, x[i]), Math.atan2(y, x[i]), -0,
-0,
"(-0, " + x[i] + ")" "(-0, " + x[i] + ")"
); );
} }

View File

@ -30,4 +30,3 @@ assert.sameValue(Math.log10(100.00), 2,
"Math.log10 produces incorrect output for 100.00"); "Math.log10 produces incorrect output for 100.00");
assert.sameValue(Math.log10(1000.00), 3, assert.sameValue(Math.log10(1000.00), 3,
"Math.log10 produces incorrect output for 1000.00"); "Math.log10 produces incorrect output for 1000.00");