Skip to content
Snippets Groups Projects
Commit 9a211b1c authored by Rick Waldron's avatar Rick Waldron Committed by Leo Balter
Browse files

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

parent 4fd36e7f
No related branches found
No related tags found
No related merge requests found
Showing
with 41 additions and 41 deletions
...@@ -8,6 +8,6 @@ description: > ...@@ -8,6 +8,6 @@ description: >
object (using getPrototypeOf) object (using getPrototypeOf)
---*/ ---*/
var p = Object.getPrototypeOf(Number); var p = Object.getPrototypeOf(Number);
assert.sameValue(p, Function.prototype, 'p'); assert.sameValue(p, Function.prototype, 'p');
...@@ -6,7 +6,7 @@ es5id: 15.7.4-1 ...@@ -6,7 +6,7 @@ es5id: 15.7.4-1
description: "Number prototype object: its [[Class]] must be 'Number'" description: "Number prototype object: its [[Class]] must be 'Number'"
---*/ ---*/
var numProto = Object.getPrototypeOf(new Number(42)); var numProto = Object.getPrototypeOf(new Number(42));
var s = Object.prototype.toString.call(numProto ); var s = Object.prototype.toString.call(numProto);
assert.sameValue(s, '[object Number]', 's'); assert.sameValue(s, '[object Number]', 's');
...@@ -8,8 +8,8 @@ description: Checking if enumerating Number.MAX_VALUE fails ...@@ -8,8 +8,8 @@ description: Checking if enumerating Number.MAX_VALUE fails
---*/ ---*/
//CHECK#1 //CHECK#1
for(var x in Number) { for (var x in Number) {
if(x === "MAX_VALUE") { if (x === "MAX_VALUE") {
$ERROR('#1: Number.MAX_VALUE has the attribute DontEnum'); $ERROR('#1: Number.MAX_VALUE has the attribute DontEnum');
} }
} }
......
...@@ -8,8 +8,8 @@ description: Checking if enumerating Number.MIN_VALUE fails ...@@ -8,8 +8,8 @@ description: Checking if enumerating Number.MIN_VALUE fails
---*/ ---*/
//CHECK#1 //CHECK#1
for(var x in Number) { for (var x in Number) {
if(x === "MIN_VALUE") { if (x === "MIN_VALUE") {
$ERROR('#1: Number.MIN_VALUE has the attribute DontEnum'); $ERROR('#1: Number.MIN_VALUE has the attribute DontEnum');
} }
} }
......
...@@ -12,7 +12,7 @@ includes: [propertyHelper.js] ...@@ -12,7 +12,7 @@ includes: [propertyHelper.js]
verifyNotWritable(Number, "NEGATIVE_INFINITY", null, 1); verifyNotWritable(Number, "NEGATIVE_INFINITY", null, 1);
if (isFinite(Number.NEGATIVE_INFINITY)) { if (isFinite(Number.NEGATIVE_INFINITY)) {
$ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity'); $ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity');
} else { } else {
if (Number.NEGATIVE_INFINITY >= 0) { if (Number.NEGATIVE_INFINITY >= 0) {
$ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity'); $ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity');
} }
......
...@@ -12,7 +12,7 @@ includes: [propertyHelper.js] ...@@ -12,7 +12,7 @@ includes: [propertyHelper.js]
verifyNotWritable(Number, "POSITIVE_INFINITY", null, 1); verifyNotWritable(Number, "POSITIVE_INFINITY", null, 1);
if (isFinite(Number.POSITIVE_INFINITY)) { if (isFinite(Number.POSITIVE_INFINITY)) {
$ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity'); $ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity');
} else { } else {
if (Number.POSITIVE_INFINITY <= 0) { if (Number.POSITIVE_INFINITY <= 0) {
$ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity'); $ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity');
} }
......
...@@ -10,23 +10,23 @@ description: Used values "10", 10, new String("10"), new Object(10) and "abc" ...@@ -10,23 +10,23 @@ description: Used values "10", 10, new String("10"), new Object(10) and "abc"
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Number("10") !== "number" ) { if (typeof Number("10") !== "number") {
$ERROR('#1: typeof Number("10") should be "number", actual is "'+typeof Number("10")+'"'); $ERROR('#1: typeof Number("10") should be "number", actual is "' + typeof Number("10") + '"');
} }
//CHECK#2 //CHECK#2
if( typeof Number(10) !== "number" ) { if (typeof Number(10) !== "number") {
$ERROR('#2: typeof Number(10) should be "number", actual is "'+typeof Number(10)+'"'); $ERROR('#2: typeof Number(10) should be "number", actual is "' + typeof Number(10) + '"');
} }
//CHECK#3 //CHECK#3
if( typeof Number(new String("10")) !== "number" ) { if (typeof Number(new String("10")) !== "number") {
$ERROR('#3: typeof Number(new String("10")) should be "number", actual is "'+typeof Number(new String("10"))+'"'); $ERROR('#3: typeof Number(new String("10")) should be "number", actual is "' + typeof Number(new String("10")) + '"');
} }
//CHECK#4 //CHECK#4
if( typeof Number(new Object(10)) !== "number" ) { if (typeof Number(new Object(10)) !== "number") {
$ERROR('#4: typeof Number(new Object(10)) should be "number", actual is "'+typeof Number(new Object(10))+'"'); $ERROR('#4: typeof Number(new Object(10)) should be "number", actual is "' + typeof Number(new Object(10)) + '"');
} }
//CHECK #5 //CHECK #5
......
...@@ -8,13 +8,13 @@ description: Call Number() and check result ...@@ -8,13 +8,13 @@ description: Call Number() and check result
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Number() !== "number" ) { if (typeof Number() !== "number") {
$ERROR('#1: typeof Number() should be "number", actual is "'+typeof Number()+'"'); $ERROR('#1: typeof Number() should be "number", actual is "' + typeof Number() + '"');
} }
//CHECK#2 //CHECK#2
if( Number() !== 0 ) { if (Number() !== 0) {
$ERROR('#2: Number() === 0, actual is '+Number()); $ERROR('#2: Number() === 0, actual is ' + Number());
} else if( 1/Number() !== Number.POSITIVE_INFINITY ) { } else if (1 / Number() !== Number.POSITIVE_INFINITY) {
$ERROR('#2: Number() === +0, actual is '+Number()); $ERROR('#2: Number() === +0, actual is ' + Number());
} }
...@@ -21,13 +21,13 @@ if (new Number() === undefined) { ...@@ -21,13 +21,13 @@ if (new Number() === undefined) {
//CHECK#3 //CHECK#3
var x3 = new Number(); var x3 = new Number();
if(typeof x3 !== "object"){ if (typeof x3 !== "object") {
$ERROR("#3: typeof new Number() === 'object'"); $ERROR("#3: typeof new Number() === 'object'");
} }
//CHECK#4 //CHECK#4
var x4 = new Number(); var x4 = new Number();
if(x4 === undefined){ if (x4 === undefined) {
$ERROR("#4: new Number() should not be undefined"); $ERROR("#4: new Number() should not be undefined");
} }
...@@ -43,12 +43,12 @@ if (new Number(10) === undefined) { ...@@ -43,12 +43,12 @@ if (new Number(10) === undefined) {
//CHECK#7 //CHECK#7
var x7 = new Number(10); var x7 = new Number(10);
if(typeof x7 !== "object"){ if (typeof x7 !== "object") {
$ERROR("#7: typeof new Number(10) === 'object'"); $ERROR("#7: typeof new Number(10) === 'object'");
} }
//CHECK#8 //CHECK#8
var x8 = new Number(10); var x8 = new Number(10);
if(x8 === undefined){ if (x8 === undefined) {
$ERROR("#8: new Number(10) should not be undefined"); $ERROR("#8: new Number(10) should not be undefined");
} }
...@@ -19,6 +19,6 @@ if (x1.valueOf() !== 1) { ...@@ -19,6 +19,6 @@ if (x1.valueOf() !== 1) {
var x2 = new Number(); var x2 = new Number();
if (x2.valueOf() !== 0) { if (x2.valueOf() !== 0) {
$ERROR('#2.1: var x2 = new Number(); x2.valueOf() === 0'); $ERROR('#2.1: var x2 = new Number(); x2.valueOf() === 0');
} else if( 1/x2.valueOf() !== Number.POSITIVE_INFINITY ) { } else if (1 / x2.valueOf() !== Number.POSITIVE_INFINITY) {
$ERROR('#2.2: var x2 = new Number(); x2.valueOf() === +0'); $ERROR('#2.2: var x2 = new Number(); x2.valueOf() === +0');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A1 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A1
description: Checking existence of the property "prototype" description: Checking existence of the property "prototype"
---*/ ---*/
if(!Number.hasOwnProperty("prototype")){ if (!Number.hasOwnProperty("prototype")) {
$ERROR('#1: The Number constructor has the property "prototype"'); $ERROR('#1: The Number constructor has the property "prototype"');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A2 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A2
description: Checking existence of the property "MAX_VALUE" description: Checking existence of the property "MAX_VALUE"
---*/ ---*/
if(!Number.hasOwnProperty("MAX_VALUE")){ if (!Number.hasOwnProperty("MAX_VALUE")) {
$ERROR('#1: The Number constructor has the property "MAX_VALUE"'); $ERROR('#1: The Number constructor has the property "MAX_VALUE"');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A3 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A3
description: Checking existence of the property "MIN_VALUE" description: Checking existence of the property "MIN_VALUE"
---*/ ---*/
if(!Number.hasOwnProperty("MIN_VALUE")){ if (!Number.hasOwnProperty("MIN_VALUE")) {
$ERROR('#1: The Number constructor has the property "MIN_VALUE"'); $ERROR('#1: The Number constructor has the property "MIN_VALUE"');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A4 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A4
description: Checking existence of the property "NaN" description: Checking existence of the property "NaN"
---*/ ---*/
if(!Number.hasOwnProperty("NaN")){ if (!Number.hasOwnProperty("NaN")) {
$ERROR('#1: The Number constructor has the property "NaN"'); $ERROR('#1: The Number constructor has the property "NaN"');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A5 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A5
description: Checking existence of the property "NEGATIVE_INFINITY" description: Checking existence of the property "NEGATIVE_INFINITY"
---*/ ---*/
if(!Number.hasOwnProperty("NEGATIVE_INFINITY")){ if (!Number.hasOwnProperty("NEGATIVE_INFINITY")) {
$ERROR('#1: The Number constructor has the property "NEGATIVE_INFINITY"'); $ERROR('#1: The Number constructor has the property "NEGATIVE_INFINITY"');
} }
...@@ -7,6 +7,6 @@ es5id: 15.7.3_A6 ...@@ -7,6 +7,6 @@ es5id: 15.7.3_A6
description: Checking existence of the property "POSITIVE_INFINITY" description: Checking existence of the property "POSITIVE_INFINITY"
---*/ ---*/
if(!Number.hasOwnProperty("POSITIVE_INFINITY")){ if (!Number.hasOwnProperty("POSITIVE_INFINITY")) {
$ERROR('#1: The Number constructor has the property "POSITIVE_INFINITY"'); $ERROR('#1: The Number constructor has the property "POSITIVE_INFINITY"');
} }
...@@ -8,7 +8,7 @@ description: Checking Number.length property ...@@ -8,7 +8,7 @@ description: Checking Number.length property
---*/ ---*/
//CHECK#1 //CHECK#1
if (!Number.hasOwnProperty("length")){ if (!Number.hasOwnProperty("length")) {
$ERROR('#1: Number constructor has length property'); $ERROR('#1: Number constructor has length property');
} }
......
...@@ -10,11 +10,11 @@ description: Checking property constructor ...@@ -10,11 +10,11 @@ description: Checking property constructor
---*/ ---*/
//CHECK#1 //CHECK#1
if((new Number()).hasOwnProperty("constructor") !== false){ if ((new Number()).hasOwnProperty("constructor") !== false) {
$ERROR('#1: Number instance must have no special property "constructor"'); $ERROR('#1: Number instance must have no special property "constructor"');
} }
//CHECK#2 //CHECK#2
if((new Number()).constructor !== Number.prototype.constructor){ if ((new Number()).constructor !== Number.prototype.constructor) {
$ERROR('#2: Number instance property "constructor" must be inherited from Number prototype object'); $ERROR('#2: Number instance property "constructor" must be inherited from Number prototype object');
} }
...@@ -10,11 +10,11 @@ description: Checking property toString ...@@ -10,11 +10,11 @@ description: Checking property toString
---*/ ---*/
//CHECK#1 //CHECK#1
if((new Number()).hasOwnProperty("toString") !== false){ if ((new Number()).hasOwnProperty("toString") !== false) {
$ERROR('#1: Number instance must have no special property "toString"'); $ERROR('#1: Number instance must have no special property "toString"');
} }
//CHECK#2 //CHECK#2
if((new Number()).toString !== Number.prototype.toString){ if ((new Number()).toString !== Number.prototype.toString) {
$ERROR('#2: Number instance property "toString" must be inherited from Number prototype object'); $ERROR('#2: Number instance property "toString" must be inherited from Number prototype object');
} }
...@@ -10,11 +10,11 @@ description: Checking property toLocaleString ...@@ -10,11 +10,11 @@ description: Checking property toLocaleString
---*/ ---*/
//CHECK#1 //CHECK#1
if((new Number()).hasOwnProperty("toLocaleString") !== false){ if ((new Number()).hasOwnProperty("toLocaleString") !== false) {
$ERROR('#1: Number instance must have no special property "toLocaleString"'); $ERROR('#1: Number instance must have no special property "toLocaleString"');
} }
//CHECK#2 //CHECK#2
if((new Number()).toLocaleString !== Number.prototype.toLocaleString){ if ((new Number()).toLocaleString !== Number.prototype.toLocaleString) {
$ERROR('#2: Number instance property "toLocaleString" must be inherited from Number prototype object'); $ERROR('#2: Number instance property "toLocaleString" must be inherited from Number prototype object');
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment