mirror of https://github.com/tc39/test262.git
built-ins/Number/*: make all indentation consistent (depth & character) (#1436)
This commit is contained in:
parent
4fd36e7f1d
commit
9a211b1c9f
|
@ -8,6 +8,6 @@ description: >
|
|||
object (using getPrototypeOf)
|
||||
---*/
|
||||
|
||||
var p = Object.getPrototypeOf(Number);
|
||||
var p = Object.getPrototypeOf(Number);
|
||||
|
||||
assert.sameValue(p, Function.prototype, 'p');
|
||||
|
|
|
@ -6,7 +6,7 @@ es5id: 15.7.4-1
|
|||
description: "Number prototype object: its [[Class]] must be 'Number'"
|
||||
---*/
|
||||
|
||||
var numProto = Object.getPrototypeOf(new Number(42));
|
||||
var s = Object.prototype.toString.call(numProto );
|
||||
var numProto = Object.getPrototypeOf(new Number(42));
|
||||
var s = Object.prototype.toString.call(numProto);
|
||||
|
||||
assert.sameValue(s, '[object Number]', 's');
|
||||
|
|
|
@ -8,8 +8,8 @@ description: Checking if enumerating Number.MAX_VALUE fails
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
for(var x in Number) {
|
||||
if(x === "MAX_VALUE") {
|
||||
for (var x in Number) {
|
||||
if (x === "MAX_VALUE") {
|
||||
$ERROR('#1: Number.MAX_VALUE has the attribute DontEnum');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ description: Checking if enumerating Number.MIN_VALUE fails
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
for(var x in Number) {
|
||||
if(x === "MIN_VALUE") {
|
||||
for (var x in Number) {
|
||||
if (x === "MIN_VALUE") {
|
||||
$ERROR('#1: Number.MIN_VALUE has the attribute DontEnum');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ includes: [propertyHelper.js]
|
|||
verifyNotWritable(Number, "NEGATIVE_INFINITY", null, 1);
|
||||
if (isFinite(Number.NEGATIVE_INFINITY)) {
|
||||
$ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity');
|
||||
} else {
|
||||
} else {
|
||||
if (Number.NEGATIVE_INFINITY >= 0) {
|
||||
$ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity');
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ includes: [propertyHelper.js]
|
|||
verifyNotWritable(Number, "POSITIVE_INFINITY", null, 1);
|
||||
if (isFinite(Number.POSITIVE_INFINITY)) {
|
||||
$ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity');
|
||||
} else {
|
||||
} else {
|
||||
if (Number.POSITIVE_INFINITY <= 0) {
|
||||
$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"
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if( typeof Number("10") !== "number" ) {
|
||||
$ERROR('#1: typeof Number("10") should be "number", actual is "'+typeof Number("10")+'"');
|
||||
if (typeof Number("10") !== "number") {
|
||||
$ERROR('#1: typeof Number("10") should be "number", actual is "' + typeof Number("10") + '"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if( typeof Number(10) !== "number" ) {
|
||||
$ERROR('#2: typeof Number(10) should be "number", actual is "'+typeof Number(10)+'"');
|
||||
if (typeof Number(10) !== "number") {
|
||||
$ERROR('#2: typeof Number(10) should be "number", actual is "' + typeof Number(10) + '"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if( typeof Number(new String("10")) !== "number" ) {
|
||||
$ERROR('#3: typeof Number(new String("10")) should be "number", actual is "'+typeof Number(new String("10"))+'"');
|
||||
if (typeof Number(new String("10")) !== "number") {
|
||||
$ERROR('#3: typeof Number(new String("10")) should be "number", actual is "' + typeof Number(new String("10")) + '"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if( typeof Number(new Object(10)) !== "number" ) {
|
||||
$ERROR('#4: typeof Number(new Object(10)) should be "number", actual is "'+typeof Number(new Object(10))+'"');
|
||||
if (typeof Number(new Object(10)) !== "number") {
|
||||
$ERROR('#4: typeof Number(new Object(10)) should be "number", actual is "' + typeof Number(new Object(10)) + '"');
|
||||
}
|
||||
|
||||
//CHECK #5
|
||||
|
|
|
@ -8,13 +8,13 @@ description: Call Number() and check result
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if( typeof Number() !== "number" ) {
|
||||
$ERROR('#1: typeof Number() should be "number", actual is "'+typeof Number()+'"');
|
||||
if (typeof Number() !== "number") {
|
||||
$ERROR('#1: typeof Number() should be "number", actual is "' + typeof Number() + '"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if( Number() !== 0 ) {
|
||||
$ERROR('#2: Number() === 0, actual is '+Number());
|
||||
} else if( 1/Number() !== Number.POSITIVE_INFINITY ) {
|
||||
$ERROR('#2: Number() === +0, actual is '+Number());
|
||||
if (Number() !== 0) {
|
||||
$ERROR('#2: Number() === 0, actual is ' + Number());
|
||||
} else if (1 / Number() !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#2: Number() === +0, actual is ' + Number());
|
||||
}
|
||||
|
|
|
@ -21,13 +21,13 @@ if (new Number() === undefined) {
|
|||
|
||||
//CHECK#3
|
||||
var x3 = new Number();
|
||||
if(typeof x3 !== "object"){
|
||||
if (typeof x3 !== "object") {
|
||||
$ERROR("#3: typeof new Number() === 'object'");
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
var x4 = new Number();
|
||||
if(x4 === undefined){
|
||||
if (x4 === undefined) {
|
||||
$ERROR("#4: new Number() should not be undefined");
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,12 @@ if (new Number(10) === undefined) {
|
|||
|
||||
//CHECK#7
|
||||
var x7 = new Number(10);
|
||||
if(typeof x7 !== "object"){
|
||||
if (typeof x7 !== "object") {
|
||||
$ERROR("#7: typeof new Number(10) === 'object'");
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
var x8 = new Number(10);
|
||||
if(x8 === undefined){
|
||||
if (x8 === undefined) {
|
||||
$ERROR("#8: new Number(10) should not be undefined");
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ if (x1.valueOf() !== 1) {
|
|||
var x2 = new Number();
|
||||
if (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');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A1
|
|||
description: Checking existence of the property "prototype"
|
||||
---*/
|
||||
|
||||
if(!Number.hasOwnProperty("prototype")){
|
||||
if (!Number.hasOwnProperty("prototype")) {
|
||||
$ERROR('#1: The Number constructor has the property "prototype"');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A2
|
|||
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"');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A3
|
|||
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"');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A4
|
|||
description: Checking existence of the property "NaN"
|
||||
---*/
|
||||
|
||||
if(!Number.hasOwnProperty("NaN")){
|
||||
if (!Number.hasOwnProperty("NaN")) {
|
||||
$ERROR('#1: The Number constructor has the property "NaN"');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A5
|
|||
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"');
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ es5id: 15.7.3_A6
|
|||
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"');
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ description: Checking Number.length property
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if (!Number.hasOwnProperty("length")){
|
||||
if (!Number.hasOwnProperty("length")) {
|
||||
$ERROR('#1: Number constructor has length property');
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property constructor
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("constructor") !== false){
|
||||
if ((new Number()).hasOwnProperty("constructor") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "constructor"');
|
||||
}
|
||||
|
||||
//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');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property toString
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("toString") !== false){
|
||||
if ((new Number()).hasOwnProperty("toString") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "toString"');
|
||||
}
|
||||
|
||||
//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');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property toLocaleString
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("toLocaleString") !== false){
|
||||
if ((new Number()).hasOwnProperty("toLocaleString") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "toLocaleString"');
|
||||
}
|
||||
|
||||
//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');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property valueOf
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("valueOf") !== false){
|
||||
if ((new Number()).hasOwnProperty("valueOf") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "valueOf"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).valueOf !== Number.prototype.valueOf){
|
||||
if ((new Number()).valueOf !== Number.prototype.valueOf) {
|
||||
$ERROR('#2: Number instance property "valueOf" must be inherited from Number prototype object');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property toFixed
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("toFixed") !== false){
|
||||
if ((new Number()).hasOwnProperty("toFixed") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "toFixed"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toFixed !== Number.prototype.toFixed){
|
||||
if ((new Number()).toFixed !== Number.prototype.toFixed) {
|
||||
$ERROR('#2: Number instance property "toFixed" must be inherited from Number prototype object');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property toExponential
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("toExponential") !== false){
|
||||
if ((new Number()).hasOwnProperty("toExponential") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "toExponential"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toExponential !== Number.prototype.toExponential){
|
||||
if ((new Number()).toExponential !== Number.prototype.toExponential) {
|
||||
$ERROR('#2: Number instance property "toExponential" must be inherited from Number prototype object');
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ description: Checking property toPrecision
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number()).hasOwnProperty("toPrecision") !== false){
|
||||
if ((new Number()).hasOwnProperty("toPrecision") !== false) {
|
||||
$ERROR('#1: Number instance must have no special property "toPrecision"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toPrecision !== Number.prototype.toPrecision){
|
||||
if ((new Number()).toPrecision !== Number.prototype.toPrecision) {
|
||||
$ERROR('#2: Number instance property "toPrecision" must be inherited from Number prototype object');
|
||||
}
|
||||
|
|
|
@ -13,12 +13,19 @@ description: >
|
|||
|
||||
try
|
||||
{
|
||||
var __obj = {toString: function() {return "1"}, valueOf: function() {return new Object();}}
|
||||
var __obj = {
|
||||
toString: function() {
|
||||
return "1"
|
||||
},
|
||||
valueOf: function() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
if (Number(__obj) !== 1) {
|
||||
$ERROR('#1.1: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (Number(__obj)));
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
catch (e)
|
||||
{
|
||||
$ERROR('#1.2: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (e));
|
||||
}
|
||||
|
|
|
@ -13,11 +13,18 @@ description: >
|
|||
|
||||
try
|
||||
{
|
||||
var __obj = {valueOf:function(){return new Object;},toString: function() {return new Object();}}
|
||||
var __obj = {
|
||||
valueOf: function() {
|
||||
return new Object;
|
||||
},
|
||||
toString: function() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
Number(__obj);
|
||||
$ERROR('#1.1: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (Number(__obj)));
|
||||
}
|
||||
catch(e)
|
||||
catch (e)
|
||||
{
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
$ERROR('#1.2: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (e));
|
||||
|
|
|
@ -12,13 +12,27 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
var object = {valueOf: function() {return "1"}, toString: function() {return 0}};
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return "1"
|
||||
},
|
||||
toString: function() {
|
||||
return 0
|
||||
}
|
||||
};
|
||||
if (Number(object) !== 1) {
|
||||
$ERROR('#1: var object = {valueOf: function() {return "1"}, toString: function() {return 0}}; Number(object) === 1. Actual: ' + (Number(object)));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
var object = {valueOf: function() {return {}}, toString: function() {return "0"}};
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
return "0"
|
||||
}
|
||||
};
|
||||
if (Number(object) !== 0) {
|
||||
$ERROR('#2: var object = {valueOf: function() {return {}}, toString: function() {return "0"}}; Number(object) === 0. Actual: ' + (Number(object)));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ description: Number('') convert to Number by explicit transformation
|
|||
if (Number("") !== 0) {
|
||||
$ERROR('#1.1: Number("") === 0. Actual: ' + (Number("")));
|
||||
} else {
|
||||
if (1/Number("") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#1.2: Number("") == +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@ description: Compare Number('.12345') with +('12345')*1e-5
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number(".12345") !== +("12345")*1e-5) {
|
||||
if (Number(".12345") !== +("12345") * 1e-5) {
|
||||
$ERROR('#1: Number(".12345") === +("12345")*1e-5');
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number(".12345e6") !== +("12345")*1e1) {
|
||||
if (Number(".12345e6") !== +("12345") * 1e1) {
|
||||
$ERROR('#1: Number(".12345e6") === +("12345")*1e1');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number(".12345e-3") !== Number("12345")*1e-8) {
|
||||
if (Number(".12345e-3") !== Number("12345") * 1e-8) {
|
||||
$ERROR('#2: Number(".12345e-3") === Number("12345")*1e-8');
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("12345e6") !== +("12345")*1e6) {
|
||||
if (Number("12345e6") !== +("12345") * 1e6) {
|
||||
$ERROR('#1: Number("12345e6") === +("12345")*1e6');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("12345e-6") !== Number("12345")*1e-6) {
|
||||
if (Number("12345e-6") !== Number("12345") * 1e-6) {
|
||||
$ERROR('#2: Number("12345e-6") === Number("12345")*1e-6');
|
||||
}
|
||||
|
|
|
@ -10,16 +10,16 @@ description: Compare '12' with Number("1")*10+Number("2") and analogous
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("12") !== Number("1")*10+Number("2")) {
|
||||
if (+("12") !== Number("1") * 10 + Number("2")) {
|
||||
$ERROR('#1: +("12") === Number("1")*10+Number("2")');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("123") !== Number("12")*10+Number("3")) {
|
||||
if (Number("123") !== Number("12") * 10 + Number("3")) {
|
||||
$ERROR('#2: Number("123") === Number("12")*10+Number("3")');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("1234") !== Number("123")*10+Number("4")) {
|
||||
if (Number("1234") !== Number("123") * 10 + Number("4")) {
|
||||
$ERROR('#2: Number("1234") === Number("123")*10+Number("4")');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: Compare Number('+1234567890') with +('1234567890')
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("+1234567890") !== +("1234567890")) {
|
||||
if (Number("+1234567890") !== +("1234567890")) {
|
||||
$ERROR('#1: Number("+1234567890") === +("1234567890")');
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@ description: Compare -Number('1234567890') with ('-1234567890')
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("-1234567890") !== -Number("1234567890")) {
|
||||
if (+("-1234567890") !== -Number("1234567890")) {
|
||||
$ERROR('#1: +("-1234567890") === -Number("1234567890")');
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x1') and Number('0X1') with 1
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("1") !== 1) {
|
||||
if (Number("1") !== 1) {
|
||||
$ERROR('#1: Number("1") === 1. Actual: ' + (Number("1")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x1") !== 1) {
|
||||
if (Number("0x1") !== 1) {
|
||||
$ERROR('#2: Number("0x1") === 1. Actual: ' + (Number("0x1")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (+("0X1") !== 1) {
|
||||
if (+("0X1") !== 1) {
|
||||
$ERROR('#3: +("0X1") === 1. Actual: ' + (+("0X1")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x2') and Number('0X2') with 2
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("2") !== 2) {
|
||||
if (+("2") !== 2) {
|
||||
$ERROR('#1: +("2") === 2. Actual: ' + (+("2")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x2") !== 2) {
|
||||
if (Number("0x2") !== 2) {
|
||||
$ERROR('#2: Number("0x2") === 2. Actual: ' + (Number("0x2")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X2") !== 2) {
|
||||
if (Number("0X2") !== 2) {
|
||||
$ERROR('#3: Number("0X2") === 2. Actual: ' + (Number("0X2")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x3') and Number('0X3') with 3
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("3") !== 3) {
|
||||
if (Number("3") !== 3) {
|
||||
$ERROR('#1: Number("3") === 3. Actual: ' + (Number("3")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (+("0x3") !== 3) {
|
||||
if (+("0x3") !== 3) {
|
||||
$ERROR('#2: +("0x3") === 3. Actual: ' + (+("0x3")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X3") !== 3) {
|
||||
if (Number("0X3") !== 3) {
|
||||
$ERROR('#3: Number("0X3") === 3. Actual: ' + (Number("0X3")));
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ description: >
|
|||
if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== 0) {
|
||||
$ERROR('#1.1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === 0. Actual: ' + (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")));
|
||||
} else {
|
||||
if (1/Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#1.2: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u
|
|||
if (Number(" ") !== 0) {
|
||||
$ERROR('#2.1: Number(" ") === 0. Actual: ' + (Number(" ")));
|
||||
} else {
|
||||
if (1/Number(" ") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(" ") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#2.2: Number(" ") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ if (Number(" ") !== 0) {
|
|||
if (Number("\t") !== 0) {
|
||||
$ERROR('#3.1: Number("\\t") === 0. Actual: ' + (Number("\t")));
|
||||
} else {
|
||||
if (1/Number("\t") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\t") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#3.2: Number("\\t") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ if (Number("\t") !== 0) {
|
|||
if (Number("\r") !== 0) {
|
||||
$ERROR('#4.1: Number("\\r") === 0. Actual: ' + (Number("\r")));
|
||||
} else {
|
||||
if (1/Number("\r") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\r") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#4.2: Number("\\r") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ if (Number("\r") !== 0) {
|
|||
if (Number("\n") !== 0) {
|
||||
$ERROR('#5.1: Number("\\n") === 0. Actual: ' + (Number("\n")));
|
||||
} else {
|
||||
if (1/Number("\n") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\n") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#5.2: Number("\\n") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ if (Number("\n") !== 0) {
|
|||
if (Number("\f") !== 0) {
|
||||
$ERROR('#6.1: Number("\\f") === 0. Actual: ' + (Number("\f")));
|
||||
} else {
|
||||
if (1/Number("\f") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\f") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#6.2: Number("\\f") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ if (Number("\f") !== 0) {
|
|||
if (Number("\u0009") !== 0) {
|
||||
$ERROR('#7.1: Number("\\u0009") === 0. Actual: ' + (Number("\u0009")));
|
||||
} else {
|
||||
if (1/Number("\u0009") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u0009") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#7.2: Number("\\u0009") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ if (Number("\u0009") !== 0) {
|
|||
if (Number("\u000A") !== 0) {
|
||||
$ERROR('#8.1: Number("\\u000A") === 0. Actual: ' + (Number("\u000A")));
|
||||
} else {
|
||||
if (1/Number("\u000A") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u000A") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#8.2: Number("\\u000A") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ if (Number("\u000A") !== 0) {
|
|||
if (Number("\u000B") !== 0) {
|
||||
$ERROR('#9.1: Number("\\u000B") === 0. Actual: ' + (Number("\u000B")));
|
||||
} else {
|
||||
if (1/Number("\u000B") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u000B") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#9.1.2: Number("\\u000B") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ if (Number("\u000B") !== 0) {
|
|||
if (Number("\u000C") !== 0) {
|
||||
$ERROR('#10.1: Number("\\u000C") === 0. Actual: ' + (Number("\u000C")));
|
||||
} else {
|
||||
if (1/Number("\u000C") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u000C") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#10.2: Number("\\u000C") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ if (Number("\u000C") !== 0) {
|
|||
if (Number("\u000D") !== 0) {
|
||||
$ERROR('#11.1: Number("\\u000D") === 0. Actual: ' + (Number("\u000D")));
|
||||
} else {
|
||||
if (1/Number("\u000D") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u000D") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#11.2: Number("\\u000D") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ if (Number("\u000D") !== 0) {
|
|||
if (Number("\u00A0") !== 0) {
|
||||
$ERROR('#12.1: Number("\\u00A0") === 0. Actual: ' + (Number("\u00A0")));
|
||||
} else {
|
||||
if (1/Number("\u00A0") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u00A0") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#12.2: Number("\\u00A0") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ if (Number("\u00A0") !== 0) {
|
|||
if (Number("\u0020") !== 0) {
|
||||
$ERROR('#13.1: Number("\\u0020") === 0. Actual: ' + (Number("\u0020")));
|
||||
} else {
|
||||
if (1/Number("\u0020") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u0020") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#13.2: Number("\\u0020") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ if (Number("\u0020") !== 0) {
|
|||
if (Number("\u2028") !== 0) {
|
||||
$ERROR('#14.1: Number("\\u2028") === 0. Actual: ' + (Number("\u2028")));
|
||||
} else {
|
||||
if (1/Number("\u2028") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2028") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#14.2: Number("\\u2028") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ if (Number("\u2028") !== 0) {
|
|||
if (Number("\u2029") !== 0) {
|
||||
$ERROR('#15.1: Number("\\u2029") === 0. Actual: ' + (Number("\u2029")));
|
||||
} else {
|
||||
if (1/Number("\u2029") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2029") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#15.2: Number("\\u2029") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ if (Number("\u2029") !== 0) {
|
|||
if (Number("\u1680") !== 0) {
|
||||
$ERROR('#16.1: Number("\\u1680") === 0. Actual: ' + (Number("\u1680")));
|
||||
} else {
|
||||
if (1/Number("\u1680") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u1680") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#16.2: Number("\\u1680") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ if (Number("\u1680") !== 0) {
|
|||
if (Number("\u2000") !== 0) {
|
||||
$ERROR('#17.1: Number("\\u2000") === 0. Actual: ' + (Number("\u2000")));
|
||||
} else {
|
||||
if (1/Number("\u2000") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2000") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#17.2: Number("\\u2000") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ if (Number("\u2000") !== 0) {
|
|||
if (Number("\u2001") !== 0) {
|
||||
$ERROR('#18.1: Number("\\u2001") === 0. Actual: ' + (Number("\u2001")));
|
||||
} else {
|
||||
if (1/Number("\u2001") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2001") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#18.2: Number("\\u2001") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ if (Number("\u2001") !== 0) {
|
|||
if (Number("\u2002") !== 0) {
|
||||
$ERROR('#19.1: Number("\\u2002") === 0. Actual: ' + (Number("\u2002")));
|
||||
} else {
|
||||
if (1/Number("\u2002") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2002") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#19.2: Number("\\u2002") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ if (Number("\u2002") !== 0) {
|
|||
if (Number("\u2003") !== 0) {
|
||||
$ERROR('#20.1: Number("\\u2003") === 0. Actual: ' + (Number("\u2003")));
|
||||
} else {
|
||||
if (1/Number("\u2003") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2003") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#20.2: Number("\\u2003") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ if (Number("\u2003") !== 0) {
|
|||
if (Number("\u2004") !== 0) {
|
||||
$ERROR('#21.1: Number("\\u2004") === 0. Actual: ' + (Number("\u2004")));
|
||||
} else {
|
||||
if (1/Number("\u2004") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2004") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#21.2: Number("\\u2004") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ if (Number("\u2004") !== 0) {
|
|||
if (Number("\u2005") !== 0) {
|
||||
$ERROR('#22.1: Number("\\u2005") === 0. Actual: ' + (Number("\u2005")));
|
||||
} else {
|
||||
if (1/Number("\u2005") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2005") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#22.2: Number("\\u2005") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ if (Number("\u2005") !== 0) {
|
|||
if (Number("\u2006") !== 0) {
|
||||
$ERROR('#23.1: Number("\\u2006") === 0. Actual: ' + (Number("\u2006")));
|
||||
} else {
|
||||
if (1/Number("\u2006") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2006") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#23.2: Number("\\u2006") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ if (Number("\u2006") !== 0) {
|
|||
if (Number("\u2007") !== 0) {
|
||||
$ERROR('#24.1: Number("\\u2007") === 0. Actual: ' + (Number("\u2007")));
|
||||
} else {
|
||||
if (1/Number("\u2007") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2007") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#24.2: Number("\\u2007") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ if (Number("\u2007") !== 0) {
|
|||
if (Number("\u2008") !== 0) {
|
||||
$ERROR('#25.1: Number("\\u2008") === 0. Actual: ' + (Number("\u2008")));
|
||||
} else {
|
||||
if (1/Number("\u2008") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2008") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#25.2: Number("\\u2008") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ if (Number("\u2008") !== 0) {
|
|||
if (Number("\u2009") !== 0) {
|
||||
$ERROR('#26.1: Number("\\u2009") === 0. Actual: ' + (Number("\u2009")));
|
||||
} else {
|
||||
if (1/Number("\u2009") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u2009") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#26.2: Number("\\u2009") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ if (Number("\u2009") !== 0) {
|
|||
if (Number("\u200A") !== 0) {
|
||||
$ERROR('#27.1: Number("\\u200A") === 0. Actual: ' + (Number("\u200A")));
|
||||
} else {
|
||||
if (1/Number("\u200A") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u200A") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#27.2: Number("\\u200A") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ if (Number("\u200A") !== 0) {
|
|||
if (Number("\u202F") !== 0) {
|
||||
$ERROR('#28.1: Number("\\u202F") === 0. Actual: ' + (Number("\u202F")));
|
||||
} else {
|
||||
if (1/Number("\u202F") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u202F") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#28.2: Number("\\u202F") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ if (Number("\u202F") !== 0) {
|
|||
if (Number("\u205F") !== 0) {
|
||||
$ERROR('#29.1: Number("\\u205F") === 0. Actual: ' + (Number("\u205F")));
|
||||
} else {
|
||||
if (1/Number("\u205F") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u205F") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#29.2: Number("\\u205F") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ if (Number("\u205F") !== 0) {
|
|||
if (Number("\u3000") !== 0) {
|
||||
$ERROR('#30.1: Number("\\u3000") === 0. Actual: ' + (Number("\u3000")));
|
||||
} else {
|
||||
if (1/Number("\u3000") !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number("\u3000") !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#30.2: Number("\\u3000") === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x4') and Number('0X4') with 4
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("4") !== 4) {
|
||||
if (Number("4") !== 4) {
|
||||
$ERROR('#1: Number("4") === 4. Actual: ' + (Number("4")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x4") !== 4) {
|
||||
if (Number("0x4") !== 4) {
|
||||
$ERROR('#2: Number("0x4") === 4. Actual: ' + (Number("0x4")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (+("0X4") !== 4) {
|
||||
if (+("0X4") !== 4) {
|
||||
$ERROR('#3: +("0X4") === 4. Actual: ' + (+("0X4")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x5') and Number('0X5') with 5
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("5") !== 5) {
|
||||
if (+("5") !== 5) {
|
||||
$ERROR('#1: +("5") === 5. Actual: ' + (+("5")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x5") !== 5) {
|
||||
if (Number("0x5") !== 5) {
|
||||
$ERROR('#2: Number("0x5") === 5. Actual: ' + (Number("0x5")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X5") !== 5) {
|
||||
if (Number("0X5") !== 5) {
|
||||
$ERROR('#3: Number("0X5") === 5. Actual: ' + (Number("0X5")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x6') and Number('0X6') with 6
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("6") !== 6) {
|
||||
if (Number("6") !== 6) {
|
||||
$ERROR('#1: Number("6") === 6. Actual: ' + (Number("6")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (+("0x6") !== 6) {
|
||||
if (+("0x6") !== 6) {
|
||||
$ERROR('#2: +("0x6") === 6. Actual: ' + (+("0x6")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X6") !== 6) {
|
||||
if (Number("0X6") !== 6) {
|
||||
$ERROR('#3: Number("0X6") === 6. Actual: ' + (Number("0X6")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x7') and Number('0X7') with 7
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("7") !== 7) {
|
||||
if (Number("7") !== 7) {
|
||||
$ERROR('#1: Number("7") === 7. Actual: ' + (Number("7")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x7") !== 7) {
|
||||
if (Number("0x7") !== 7) {
|
||||
$ERROR('#2: Number("0x7") === 7. Actual: ' + (Number("0x7")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (+("0X7") !== 7) {
|
||||
if (+("0X7") !== 7) {
|
||||
$ERROR('#3: +("0X7") === 7. Actual: ' + (+("0X7")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x8') and Number('0X8') with 8
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("8") !== 8) {
|
||||
if (+("8") !== 8) {
|
||||
$ERROR('#1: +("8") === 8. Actual: ' + (+("8")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0x8") !== 8) {
|
||||
if (Number("0x8") !== 8) {
|
||||
$ERROR('#2: Number("0x8") === 8. Actual: ' + (Number("0x8")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X8") !== 8) {
|
||||
if (Number("0X8") !== 8) {
|
||||
$ERROR('#3: Number("0X8") === 8. Actual: ' + (Number("0X8")));
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ description: Compare Number('0x9') and Number('0X9') with 9
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("9") !== 9) {
|
||||
if (Number("9") !== 9) {
|
||||
$ERROR('#1: Number("9") === 9. Actual: ' + (Number("9")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (+("0x9") !== 9) {
|
||||
if (+("0x9") !== 9) {
|
||||
$ERROR('#2: +("0x9") === 9. Actual: ' + (+("0x9")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0X9") !== 9) {
|
||||
if (Number("0X9") !== 9) {
|
||||
$ERROR('#3: Number("0X9") === 9. Actual: ' + (Number("0X9")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("0xa") !== 10) {
|
||||
if (Number("0xa") !== 10) {
|
||||
$ERROR('#1: Number("0xa") === 10. Actual: ' + (Number("0xa")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0xA") !== 10) {
|
||||
if (Number("0xA") !== 10) {
|
||||
$ERROR('#2: Number("0xA") === 10. Actual: ' + (Number("0xA")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0Xa") !== 10) {
|
||||
if (Number("0Xa") !== 10) {
|
||||
$ERROR('#3: Number("0Xa") === 10. Actual: ' + (Number("0Xa")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (+("0XA") !== 10) {
|
||||
if (+("0XA") !== 10) {
|
||||
$ERROR('#4: +("0XA") === 10. Actual: ' + (+("0XA")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("0xb") !== 11) {
|
||||
if (Number("0xb") !== 11) {
|
||||
$ERROR('#1: Number("0xb") === 11. Actual: ' + (Number("0xb")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0xB") !== 11) {
|
||||
if (Number("0xB") !== 11) {
|
||||
$ERROR('#2: Number("0xB") === 11. Actual: ' + (Number("0xB")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (+("0Xb") !== 11) {
|
||||
if (+("0Xb") !== 11) {
|
||||
$ERROR('#3: +("0Xb") === 11. Actual: ' + (+("0Xb")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("0XB") !== 11) {
|
||||
if (Number("0XB") !== 11) {
|
||||
$ERROR('#4: Number("0XB") === 11. Actual: ' + (Number("0XB")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("0xc") !== 12) {
|
||||
if (Number("0xc") !== 12) {
|
||||
$ERROR('#1: Number("0xc") === 12. Actual: ' + (Number("0xc")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (+("0xC") !== 12) {
|
||||
if (+("0xC") !== 12) {
|
||||
$ERROR('#2: +("0xC") === 12. Actual: ' + (+("0xC")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0Xc") !== 12) {
|
||||
if (Number("0Xc") !== 12) {
|
||||
$ERROR('#3: Number("0Xc") === 12. Actual: ' + (Number("0Xc")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("0XC") !== 12) {
|
||||
if (Number("0XC") !== 12) {
|
||||
$ERROR('#4: Number("0XC") === 12. Actual: ' + (Number("0XC")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (+("0xd") !== 13) {
|
||||
if (+("0xd") !== 13) {
|
||||
$ERROR('#1: +("0xd") === 13. Actual: ' + (+("0xd")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0xD") !== 13) {
|
||||
if (Number("0xD") !== 13) {
|
||||
$ERROR('#2: Number("0xD") === 13. Actual: ' + (Number("0xD")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0Xd") !== 13) {
|
||||
if (Number("0Xd") !== 13) {
|
||||
$ERROR('#3: Number("0Xd") === 13. Actual: ' + (Number("0Xd")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("0XD") !== 13) {
|
||||
if (Number("0XD") !== 13) {
|
||||
$ERROR('#4: Number("0XD") === 13. Actual: ' + (Number("0XD")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("0xe") !== 14) {
|
||||
if (Number("0xe") !== 14) {
|
||||
$ERROR('#1: Number("0xe") === 14. Actual: ' + (Number("0xe")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0xE") !== 14) {
|
||||
if (Number("0xE") !== 14) {
|
||||
$ERROR('#2: Number("0xE") === 14. Actual: ' + (Number("0xE")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (Number("0Xe") !== 14) {
|
||||
if (Number("0Xe") !== 14) {
|
||||
$ERROR('#3: Number("0Xe") === 14. Actual: ' + (Number("0Xe")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (+("0XE") !== 14) {
|
||||
if (+("0XE") !== 14) {
|
||||
$ERROR('#4: +("0XE") === 14. Actual: ' + (+("0XE")));
|
||||
}
|
||||
|
|
|
@ -10,21 +10,21 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("0xf") !== 15) {
|
||||
if (Number("0xf") !== 15) {
|
||||
$ERROR('#1: Number("0xf") === 15. Actual: ' + (Number("0xf")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("0xF") !== 15) {
|
||||
if (Number("0xF") !== 15) {
|
||||
$ERROR('#2: Number("0xF") === 15. Actual: ' + (Number("0xF")));
|
||||
}
|
||||
|
||||
// CHECK#3
|
||||
if (+("0Xf") !== 15) {
|
||||
if (+("0Xf") !== 15) {
|
||||
$ERROR('#3: +("0Xf") === 15. Actual: ' + (+("0Xf")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("0XF") !== 15) {
|
||||
if (Number("0XF") !== 15) {
|
||||
$ERROR('#4: Number("0XF") === 15. Actual: ' + (Number("0XF")));
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ description: Use various long numbers, for example, 1234567890.1234567890
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("1234567890.1234567890") !== 1234567890.1234567890) {
|
||||
if (Number("1234567890.1234567890") !== 1234567890.1234567890) {
|
||||
$ERROR('#1: Number("1234567890.1234567890") === 1234567890.1234567890. Actual: ' + (Number("1234567890.1234567890")));
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("1234567890.1234567890") !== 1234567890.1234567000) {
|
||||
if (Number("1234567890.1234567890") !== 1234567890.1234567000) {
|
||||
$ERROR('#2: Number("1234567890.1234567890") === 1234567890.1234567000. Actual: ' + (Number("1234567890.1234567890")));
|
||||
}
|
||||
|
||||
|
@ -27,11 +27,11 @@ if (+("1234567890.1234567890") === 1234567890.123456) {
|
|||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("0.12345678901234567890") !== 0.123456789012345678) {
|
||||
if (Number("0.12345678901234567890") !== 0.123456789012345678) {
|
||||
$ERROR('#4: Number("0.12345678901234567890") === 0.123456789012345678. Actual: ' + (Number("0.12345678901234567890")));
|
||||
}
|
||||
|
||||
// CHECK#4
|
||||
if (Number("00.12345678901234567890") !== 0.123456789012345678) {
|
||||
if (Number("00.12345678901234567890") !== 0.123456789012345678) {
|
||||
$ERROR('#4: Number("00.12345678901234567890") === 0.123456789012345678. Actual: ' + (Number("00.12345678901234567890")));
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ es5id: 9.3.1_A3_T2
|
|||
description: dynamic string
|
||||
---*/
|
||||
|
||||
function dynaString(s1, s2){
|
||||
return String(s1)+String(s2);
|
||||
function dynaString(s1, s2) {
|
||||
return String(s1) + String(s2);
|
||||
}
|
||||
|
||||
// CHECK#1
|
||||
|
|
|
@ -31,7 +31,7 @@ info: |
|
|||
features: [u180e]
|
||||
---*/
|
||||
|
||||
function dynaString(s1, s2){
|
||||
function dynaString(s1, s2) {
|
||||
return String(s1) + String(s2);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ if (Number("+0") !== Number("0")) {
|
|||
$ERROR('#1.1: Number("+0") === Number("0")');
|
||||
} else {
|
||||
// CHECK#2
|
||||
if (1/Number("+0") !== 1/Number("0")) {
|
||||
if (1 / Number("+0") !== 1 / Number("0")) {
|
||||
$ERROR('#2.2: 1/Number("+0") === 1/Number("0")');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ es5id: 9.3.1_A4_T2
|
|||
description: Compare Number('+' + 'any_number') with Number('any_number')
|
||||
---*/
|
||||
|
||||
function dynaString(s1, s2){
|
||||
return String(s1)+String(s2);
|
||||
function dynaString(s1, s2) {
|
||||
return String(s1) + String(s2);
|
||||
}
|
||||
|
||||
// CHECK#1
|
||||
|
@ -18,7 +18,7 @@ if (Number(dynaString("+", "0")) !== Number("0")) {
|
|||
$ERROR('#1: Number("+"+"0") === Number("0")');
|
||||
} else {
|
||||
// CHECK#2
|
||||
if (1/Number(dynaString("+", "0")) !== 1/Number("0")) {
|
||||
if (1 / Number(dynaString("+", "0")) !== 1 / Number("0")) {
|
||||
$ERROR('#2: 1/Number("+"+"0") === 1/Number("0")');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ if (Number("-0") !== -Number("0")) {
|
|||
$ERROR('#1: Number("-0") === -Number("0")');
|
||||
} else {
|
||||
// CHECK#2
|
||||
if (1/Number("-0") !== -1/Number("0")) {
|
||||
if (1 / Number("-0") !== -1 / Number("0")) {
|
||||
$ERROR('#2: 1/Number("-0") === -1/Number("0")');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ es5id: 9.3.1_A5_T3
|
|||
description: Compare Number('-' + 'any_number') with -Number('any_number')
|
||||
---*/
|
||||
|
||||
function dynaString(s1, s2){
|
||||
return String(s1)+String(s2);
|
||||
function dynaString(s1, s2) {
|
||||
return String(s1) + String(s2);
|
||||
}
|
||||
|
||||
// CHECK#1
|
||||
|
@ -18,7 +18,7 @@ if (Number(dynaString("-", "0")) !== -Number("0")) {
|
|||
$ERROR('#1: Number("-"+"0") === -Number("0")');
|
||||
} else {
|
||||
// CHECK#2
|
||||
if (1/Number(dynaString("-", "0")) !== -1/Number("0")) {
|
||||
if (1 / Number(dynaString("-", "0")) !== -1 / Number("0")) {
|
||||
$ERROR('#2: 1/Number("-"+"0") === -1/Number("0")');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ description: >
|
|||
10e10000, 10E10000 and Number("10e10000")
|
||||
---*/
|
||||
|
||||
function dynaString(s1, s2){
|
||||
return String(s1)+String(s2);
|
||||
function dynaString(s1, s2) {
|
||||
return String(s1) + String(s2);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,6 @@ description: Compare Number('1234.5678') with Number('1234')+(+('5678')*1e-4)
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("1234.5678") !== Number("1234")+(+("5678")*1e-4)) {
|
||||
if (Number("1234.5678") !== Number("1234") + (+("5678") * 1e-4)) {
|
||||
$ERROR('#1: Number("1234.5678") === Number("1234")+(+("5678")*1e-4)');
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("1234e5") !== Number("1234")*1e5) {
|
||||
if (Number("1234e5") !== Number("1234") * 1e5) {
|
||||
$ERROR('#1: Number("1234e5") === Number("1234")*1e5');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number("1234.e5") !== +("1234")*1e5) {
|
||||
if (Number("1234.e5") !== +("1234") * 1e5) {
|
||||
$ERROR('#2: Number("1234.e5") === +("1234")*1e5');
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ description: >
|
|||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Number("1234.5678e9") !== (Number("1234")+(Number("5678")*1e-4))*1e9) {
|
||||
if (Number("1234.5678e9") !== (Number("1234") + (Number("5678") * 1e-4)) * 1e9) {
|
||||
$ERROR('#1: Number("1234.5678e9") === (Number("1234")+(Number("5678")*1e-4))*1e9');
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (+("1234.5678e-9") !== (Number("1234")+(Number("5678")*1e-4))*1e-9) {
|
||||
if (+("1234.5678e-9") !== (Number("1234") + (Number("5678") * 1e-4)) * 1e-9) {
|
||||
$ERROR('#2: +("1234.5678e-9") === (Number("1234")+(Number("5678")*1e-4))*1e-9');
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ description: null convert to Number by explicit transformation
|
|||
|
||||
// CHECK #1
|
||||
if (Number(null) !== 0) {
|
||||
$ERROR('#1.1: Number(null) === 0. Actual: ' + (Number(null)));
|
||||
$ERROR('#1.1: Number(null) === 0. Actual: ' + (Number(null)));
|
||||
} else {
|
||||
if (1/Number(null) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(null) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#1.2: Number(null) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ description: False and true convert to Number by explicit transformation
|
|||
if (Number(false) !== +0) {
|
||||
$ERROR('#1.1: Number(false) === 0. Actual: ' + (Number(false)));
|
||||
} else {
|
||||
if (1/Number(false) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(false) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#1.2: Number(false) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number(true) !== 1) {
|
||||
$ERROR('#2: Number(true) === 1. Actual: ' + (Number(true)));
|
||||
$ERROR('#2: Number(true) === 1. Actual: ' + (Number(true)));
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ if (Number(13) !== 13) {
|
|||
}
|
||||
|
||||
// CHECK#2
|
||||
if (Number(-13) !== -13) {
|
||||
if (Number(-13) !== -13) {
|
||||
$ERROR('#2: Number(-13) === -13. Actual: ' + (Number(-13)));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ assert.sameValue(Number(NaN), NaN, "NaN");
|
|||
if (Number(+0) !== +0) {
|
||||
$ERROR('#2.1: Number(+0) === 0. Actual: ' + (Number(+0)));
|
||||
} else {
|
||||
if (1/Number(+0) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(+0) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#2.2: Number(+0) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ if (Number(+0) !== +0) {
|
|||
if (Number(-0) !== -0) {
|
||||
$ERROR('#3.1: Number(-0) === 0. Actual: ' + (Number(-0)));
|
||||
} else {
|
||||
if (1/Number(-0) !== Number.NEGATIVE_INFINITY) {
|
||||
if (1 / Number(-0) !== Number.NEGATIVE_INFINITY) {
|
||||
$ERROR('#3.2: Number(-0) === -0. Actual: +0');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ assert.sameValue(Number(new Number(NaN)), NaN, "Number(new Number(NaN)");
|
|||
if (Number(new Number(null)) !== 0) {
|
||||
$ERROR('#4.1: Number(new Number(null)) === 0. Actual: ' + (Number(new Number(null))));
|
||||
} else {
|
||||
if (1/Number(new Number(null)) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(new Number(null)) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#4.2: Number(new Number(null)) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ if (Number(new Number(true)) !== 1) {
|
|||
if (Number(new Number(false)) !== +0) {
|
||||
$ERROR('#7.1: Number(new Number(false)) === 0. Actual: ' + (Number(new Number(false))));
|
||||
} else {
|
||||
if (1/Number(new Number(false)) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(new Number(false)) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#7.2: Number(new Number(false)) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
@ -60,56 +60,78 @@ if (Number(new Boolean(true)) !== 1) {
|
|||
if (Number(new Boolean(false)) !== +0) {
|
||||
$ERROR('#9.1: Number(new Boolean(false)) === 0. Actual: ' + (Number(new Boolean(false))));
|
||||
} else {
|
||||
if (1/Number(new Boolean(false)) !== Number.POSITIVE_INFINITY) {
|
||||
if (1 / Number(new Boolean(false)) !== Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#9.2: Number(new Boolean(false)) === +0. Actual: -0');
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK#10
|
||||
assert.sameValue(Number(new Array(2,4,8,16,32)), NaN, "Number(new Array(2,4,8,16,32))");
|
||||
assert.sameValue(Number(new Array(2, 4, 8, 16, 32)), NaN, "Number(new Array(2,4,8,16,32))");
|
||||
|
||||
// CHECK#11
|
||||
var myobj1 = {
|
||||
ToNumber : function(){return 12345;},
|
||||
toString : function(){return "67890";},
|
||||
valueOf : function(){return "[object MyObj]";}
|
||||
};
|
||||
ToNumber: function() {
|
||||
return 12345;
|
||||
},
|
||||
toString: function() {
|
||||
return "67890";
|
||||
},
|
||||
valueOf: function() {
|
||||
return "[object MyObj]";
|
||||
}
|
||||
};
|
||||
|
||||
assert.sameValue(Number(myobj1), NaN, "Number(myobj1)");
|
||||
|
||||
// CHECK#12
|
||||
var myobj2 = {
|
||||
ToNumber : function(){return 12345;},
|
||||
toString : function(){return "67890";},
|
||||
valueOf : function(){return "9876543210";}
|
||||
};
|
||||
ToNumber: function() {
|
||||
return 12345;
|
||||
},
|
||||
toString: function() {
|
||||
return "67890";
|
||||
},
|
||||
valueOf: function() {
|
||||
return "9876543210";
|
||||
}
|
||||
};
|
||||
|
||||
if (Number(myobj2) !== 9876543210){
|
||||
if (Number(myobj2) !== 9876543210) {
|
||||
$ERROR("#12: Number(myobj2) calls ToPrimitive with hint Number. Exptected: 9876543210. Actual: " + (Number(myobj2)));
|
||||
}
|
||||
|
||||
|
||||
// CHECK#13
|
||||
var myobj3 = {
|
||||
ToNumber : function(){return 12345;},
|
||||
toString : function(){return "[object MyObj]";}
|
||||
};
|
||||
ToNumber: function() {
|
||||
return 12345;
|
||||
},
|
||||
toString: function() {
|
||||
return "[object MyObj]";
|
||||
}
|
||||
};
|
||||
|
||||
assert.sameValue(Number(myobj3), NaN, "Number(myobj3)");
|
||||
|
||||
// CHECK#14
|
||||
var myobj4 = {
|
||||
ToNumber : function(){return 12345;},
|
||||
toString : function(){return "67890";}
|
||||
};
|
||||
ToNumber: function() {
|
||||
return 12345;
|
||||
},
|
||||
toString: function() {
|
||||
return "67890";
|
||||
}
|
||||
};
|
||||
|
||||
if (Number(myobj4) !== 67890){
|
||||
if (Number(myobj4) !== 67890) {
|
||||
$ERROR("#14: Number(myobj4) calls ToPrimitive with hint Number. Exptected: 67890. Actual: " + (Number(myobj4)));
|
||||
}
|
||||
|
||||
// CHECK#15
|
||||
var myobj5 = {
|
||||
ToNumber : function(){return 12345;}
|
||||
};
|
||||
ToNumber: function() {
|
||||
return 12345;
|
||||
}
|
||||
};
|
||||
|
||||
assert.sameValue(Number(myobj5), NaN, "Number(myobj5)");
|
||||
|
|
|
@ -6,6 +6,6 @@ es5id: 15.7.3.1-2
|
|||
description: Number.prototype, initial value is the Number prototype object
|
||||
---*/
|
||||
|
||||
// assume that Number.prototype has not been modified.
|
||||
// assume that Number.prototype has not been modified.
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf(new Number(42)), Number.prototype, 'Object.getPrototypeOf(new Number(42))');
|
||||
|
|
|
@ -10,6 +10,6 @@ description: Checking value of Number.prototype property
|
|||
//CHECK#1
|
||||
if (Number.prototype != 0) {
|
||||
$ERROR('#2: Number.prototype == +0');
|
||||
} else if( 1/Number.prototype != Number.POSITIVE_INFINITY){
|
||||
} else if (1 / Number.prototype != Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#2: Number.prototype == +0');
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ if (typeof Number.prototype !== "object") {
|
|||
//CHECK#2
|
||||
if (Number.prototype != 0) {
|
||||
$ERROR('#2: Number.prototype == +0');
|
||||
} else if( 1/Number.prototype != Number.POSITIVE_INFINITY){
|
||||
} else if (1 / Number.prototype != Number.POSITIVE_INFINITY) {
|
||||
$ERROR('#2: Number.prototype == +0');
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("constructor") !== true){
|
||||
if (Number.prototype.hasOwnProperty("constructor") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property constructor');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("toString") !== true){
|
||||
if (Number.prototype.hasOwnProperty("toString") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property toString');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("toLocaleString") !== true){
|
||||
if (Number.prototype.hasOwnProperty("toLocaleString") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property toLocaleString');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("valueOf") !== true){
|
||||
if (Number.prototype.hasOwnProperty("valueOf") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property valueOf');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("toFixed") !== true){
|
||||
if (Number.prototype.hasOwnProperty("toFixed") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property toFixed');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("toExponential") !== true){
|
||||
if (Number.prototype.hasOwnProperty("toExponential") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property toExponential');
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ description: The test uses hasOwnProperty() method
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.hasOwnProperty("toPrecision") !== true){
|
||||
if (Number.prototype.hasOwnProperty("toPrecision") !== true) {
|
||||
$ERROR('#1: The Number prototype object has the property toPrecision');
|
||||
}
|
||||
|
|
|
@ -17,5 +17,3 @@ assert.throws(RangeError, () => (3).toExponential(-1));
|
|||
|
||||
assert.sameValue((3).toExponential(100), "3.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+0");
|
||||
assert.throws(RangeError, () => (3).toExponential(101));
|
||||
|
||||
|
||||
|
|
|
@ -10,62 +10,62 @@ description: calling on Number prototype object
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toFixed() !== "0"){
|
||||
if (Number.prototype.toFixed() !== "0") {
|
||||
$ERROR('#1: Number.prototype.toFixed() === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if(Number.prototype.toFixed(0) !== "0"){
|
||||
if (Number.prototype.toFixed(0) !== "0") {
|
||||
$ERROR('#2: Number.prototype.toFixed(0) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if(Number.prototype.toFixed(1) !== "0.0"){
|
||||
if (Number.prototype.toFixed(1) !== "0.0") {
|
||||
$ERROR('#3: Number.prototype.toFixed(1) === "0.0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if(Number.prototype.toFixed(1.1) !== "0.0"){
|
||||
if (Number.prototype.toFixed(1.1) !== "0.0") {
|
||||
$ERROR('#4: Number.prototype.toFixed(1.1) === "0.0"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if(Number.prototype.toFixed(0.9) !== "0"){
|
||||
if (Number.prototype.toFixed(0.9) !== "0") {
|
||||
$ERROR('#5: Number.prototype.toFixed(0.9) === "0"');
|
||||
}
|
||||
|
||||
|
||||
//CHECK#6
|
||||
if(Number.prototype.toFixed("1") !== "0.0"){
|
||||
if (Number.prototype.toFixed("1") !== "0.0") {
|
||||
$ERROR('#6: Number.prototype.toFixed("1") === "0.0"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if(Number.prototype.toFixed("1.1") !== "0.0"){
|
||||
if (Number.prototype.toFixed("1.1") !== "0.0") {
|
||||
$ERROR('#7: Number.prototype.toFixed("1.1") === "0.0"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if(Number.prototype.toFixed("0.9") !== "0"){
|
||||
if (Number.prototype.toFixed("0.9") !== "0") {
|
||||
$ERROR('#8: Number.prototype.toFixed("0.9") === "0"');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if(Number.prototype.toFixed(Number.NaN) !== "0"){
|
||||
if (Number.prototype.toFixed(Number.NaN) !== "0") {
|
||||
$ERROR('#9: Number.prototype.toFixed(Number.NaN) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if(Number.prototype.toFixed("some string") !== "0"){
|
||||
if (Number.prototype.toFixed("some string") !== "0") {
|
||||
$ERROR('#9: Number.prototype.toFixed("some string") === "0"');
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
try{
|
||||
if(Number.prototype.toFixed(-0.1) !== "0"){
|
||||
try {
|
||||
if (Number.prototype.toFixed(-0.1) !== "0") {
|
||||
$ERROR('#10: Number.prototype.toFixed(-0.1) === "0"');
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
$ERROR('#10: Number.prototype.toFixed(-0.1) should not throw '+e);
|
||||
catch (e) {
|
||||
$ERROR('#10: Number.prototype.toFixed(-0.1) should not throw ' + e);
|
||||
}
|
||||
|
|
|
@ -10,61 +10,61 @@ description: calling on Number object
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number(1)).toFixed() !== "1"){
|
||||
if ((new Number(1)).toFixed() !== "1") {
|
||||
$ERROR('#1: (new Number(1)).prototype.toFixed() === "1"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number(1)).toFixed(0) !== "1"){
|
||||
if ((new Number(1)).toFixed(0) !== "1") {
|
||||
$ERROR('#2: (new Number(1)).prototype.toFixed(0) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(1)).toFixed(1) !== "1.0"){
|
||||
if ((new Number(1)).toFixed(1) !== "1.0") {
|
||||
$ERROR('#3: (new Number(1)).prototype.toFixed(1) === "1.0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(1)).toFixed(1.1) !== "1.0"){
|
||||
if ((new Number(1)).toFixed(1.1) !== "1.0") {
|
||||
$ERROR('#4: (new Number(1)).toFixed(1.1) === "1.0"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toFixed(0.9) !== "1"){
|
||||
if ((new Number(1)).toFixed(0.9) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toFixed(0.9) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(1)).toFixed("1") !== "1.0"){
|
||||
if ((new Number(1)).toFixed("1") !== "1.0") {
|
||||
$ERROR('#6: (new Number(1)).toFixed("1") === "1.0"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(1)).toFixed("1.1") !== "1.0"){
|
||||
if ((new Number(1)).toFixed("1.1") !== "1.0") {
|
||||
$ERROR('#7: (new Number(1)).toFixed("1.1") === "1.0"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(1)).toFixed("0.9") !== "1"){
|
||||
if ((new Number(1)).toFixed("0.9") !== "1") {
|
||||
$ERROR('#8: (new Number(1)).toFixed("0.9") === "1"');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if((new Number(1)).toFixed(Number.NaN) !== "1"){
|
||||
if ((new Number(1)).toFixed(Number.NaN) !== "1") {
|
||||
$ERROR('#9: (new Number(1)).toFixed(Number.NaN) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if((new Number(1)).toFixed("some string") !== "1"){
|
||||
if ((new Number(1)).toFixed("some string") !== "1") {
|
||||
$ERROR('#9: (new Number(1)).toFixed("some string") === "1"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
try{
|
||||
if((new Number(1)).toFixed(-0.1) !== "1"){
|
||||
try {
|
||||
if ((new Number(1)).toFixed(-0.1) !== "1") {
|
||||
$ERROR('#10: (new Number(1)).toFixed(-0.1) === "1"');
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
$ERROR('#10: (new Number(1)).toFixed(-0.1) should not throw '+e);
|
||||
catch (e) {
|
||||
$ERROR('#10: (new Number(1)).toFixed(-0.1) should not throw ' + e);
|
||||
}
|
||||
|
|
|
@ -8,62 +8,62 @@ description: NaN is computed by new Number("string")
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number("a")).toFixed() !== "NaN"){
|
||||
if ((new Number("a")).toFixed() !== "NaN") {
|
||||
$ERROR('#1: (new Number("a")).prototype.toFixed() === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number("a")).toFixed(0) !== "NaN"){
|
||||
if ((new Number("a")).toFixed(0) !== "NaN") {
|
||||
$ERROR('#2: (new Number("a")).prototype.toFixed(0) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number("a")).toFixed(1) !== "NaN"){
|
||||
if ((new Number("a")).toFixed(1) !== "NaN") {
|
||||
$ERROR('#3: (new Number("a")).prototype.toFixed(1) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number("a")).toFixed(1.1) !== "NaN"){
|
||||
if ((new Number("a")).toFixed(1.1) !== "NaN") {
|
||||
$ERROR('#4: (new Number("a")).toFixed(1.1) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number("a")).toFixed(0.9) !== "NaN"){
|
||||
if ((new Number("a")).toFixed(0.9) !== "NaN") {
|
||||
$ERROR('#5: (new Number("a")).toFixed(0.9) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number("a")).toFixed("1") !== "NaN"){
|
||||
if ((new Number("a")).toFixed("1") !== "NaN") {
|
||||
$ERROR('#6: (new Number("a")).toFixed("1") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number("a")).toFixed("1.1") !== "NaN"){
|
||||
if ((new Number("a")).toFixed("1.1") !== "NaN") {
|
||||
$ERROR('#7: (new Number("a")).toFixed("1.1") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number("a")).toFixed("0.9") !== "NaN"){
|
||||
if ((new Number("a")).toFixed("0.9") !== "NaN") {
|
||||
$ERROR('#8: (new Number("a")).toFixed("0.9") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if((new Number("a")).toFixed(Number.NaN) !== "NaN"){
|
||||
if ((new Number("a")).toFixed(Number.NaN) !== "NaN") {
|
||||
$ERROR('#9: (new Number("a")).toFixed(Number.NaN) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if((new Number("a")).toFixed("some string") !== "NaN"){
|
||||
if ((new Number("a")).toFixed("some string") !== "NaN") {
|
||||
$ERROR('#9: (new Number("a")).toFixed("some string") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
try{
|
||||
try {
|
||||
s = (new Number("a")).toFixed(Number.POSITIVE_INFINITY);
|
||||
$ERROR('#10: (new Number("a")).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN');
|
||||
}
|
||||
catch(e){
|
||||
if(!(e instanceof RangeError)){
|
||||
$ERROR('#10: (new Number("a")).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e);
|
||||
catch (e) {
|
||||
if (!(e instanceof RangeError)) {
|
||||
$ERROR('#10: (new Number("a")).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not ' + e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,62 +8,62 @@ description: direct usage of NaN
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.NaN.toFixed() !== "NaN"){
|
||||
if (Number.NaN.toFixed() !== "NaN") {
|
||||
$ERROR('#1: Number.NaN.prototype.toFixed() === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if(Number.NaN.toFixed(0) !== "NaN"){
|
||||
if (Number.NaN.toFixed(0) !== "NaN") {
|
||||
$ERROR('#2: Number.NaN.prototype.toFixed(0) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if(Number.NaN.toFixed(1) !== "NaN"){
|
||||
if (Number.NaN.toFixed(1) !== "NaN") {
|
||||
$ERROR('#3: Number.NaN.prototype.toFixed(1) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if(Number.NaN.toFixed(1.1) !== "NaN"){
|
||||
if (Number.NaN.toFixed(1.1) !== "NaN") {
|
||||
$ERROR('#4: Number.NaN.toFixed(1.1) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if(Number.NaN.toFixed(0.9) !== "NaN"){
|
||||
if (Number.NaN.toFixed(0.9) !== "NaN") {
|
||||
$ERROR('#5: Number.NaN.toFixed(0.9) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if(Number.NaN.toFixed("1") !== "NaN"){
|
||||
if (Number.NaN.toFixed("1") !== "NaN") {
|
||||
$ERROR('#6: Number.NaN.toFixed("1") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if(Number.NaN.toFixed("1.1") !== "NaN"){
|
||||
if (Number.NaN.toFixed("1.1") !== "NaN") {
|
||||
$ERROR('#7: Number.NaN.toFixed("1.1") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if(Number.NaN.toFixed("0.9") !== "NaN"){
|
||||
if (Number.NaN.toFixed("0.9") !== "NaN") {
|
||||
$ERROR('#8: Number.NaN.toFixed("0.9") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if(Number.NaN.toFixed(Number.NaN) !== "NaN"){
|
||||
if (Number.NaN.toFixed(Number.NaN) !== "NaN") {
|
||||
$ERROR('#9: Number.NaN.toFixed(Number.NaN) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if(Number.NaN.toFixed("some string") !== "NaN"){
|
||||
if (Number.NaN.toFixed("some string") !== "NaN") {
|
||||
$ERROR('#9: Number.NaN.toFixed("some string") === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
try{
|
||||
try {
|
||||
s = Number.NaN.toFixed(Number.POSITIVE_INFINITY);
|
||||
$ERROR('#10: Number.NaN.toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN');
|
||||
}
|
||||
catch(e){
|
||||
if(!(e instanceof RangeError)){
|
||||
$ERROR('#10: Number.NaN.toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e);
|
||||
catch (e) {
|
||||
if (!(e instanceof RangeError)) {
|
||||
$ERROR('#10: Number.NaN.toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not ' + e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,62 +8,62 @@ description: x is 10^21
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if((new Number(1e21)).toFixed() !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed() !== String(1e21)) {
|
||||
$ERROR('#1: (new Number(1e21)).prototype.toFixed() === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number(1e21)).toFixed(0) !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed(0) !== String(1e21)) {
|
||||
$ERROR('#2: (new Number(1e21)).prototype.toFixed(0) === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(1e21)).toFixed(1) !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed(1) !== String(1e21)) {
|
||||
$ERROR('#3: (new Number(1e21)).prototype.toFixed(1) === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(1e21)).toFixed(1.1) !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed(1.1) !== String(1e21)) {
|
||||
$ERROR('#4: (new Number(1e21)).toFixed(1.1) === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1e21)).toFixed(0.9) !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed(0.9) !== String(1e21)) {
|
||||
$ERROR('#5: (new Number(1e21)).toFixed(0.9) === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(1e21)).toFixed("1") !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed("1") !== String(1e21)) {
|
||||
$ERROR('#6: (new Number(1e21)).toFixed("1") === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(1e21)).toFixed("1.1") !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed("1.1") !== String(1e21)) {
|
||||
$ERROR('#7: (new Number(1e21)).toFixed("1.1") === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(1e21)).toFixed("0.9") !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed("0.9") !== String(1e21)) {
|
||||
$ERROR('#8: (new Number(1e21)).toFixed("0.9") === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if((new Number(1e21)).toFixed(Number.NaN) !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed(Number.NaN) !== String(1e21)) {
|
||||
$ERROR('#9: (new Number(1e21)).toFixed(Number.NaN) === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if((new Number(1e21)).toFixed("some string") !== String(1e21)){
|
||||
if ((new Number(1e21)).toFixed("some string") !== String(1e21)) {
|
||||
$ERROR('#9: (new Number(1e21)).toFixed("some string") === String(1e21)');
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
try{
|
||||
try {
|
||||
s = (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY);
|
||||
$ERROR('#10: (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN');
|
||||
}
|
||||
catch(e){
|
||||
if(!(e instanceof RangeError)){
|
||||
$ERROR('#10: (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e);
|
||||
catch (e) {
|
||||
if (!(e instanceof RangeError)) {
|
||||
$ERROR('#10: (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not ' + e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@ description: Checking Number prototype itself
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toFixed.hasOwnProperty("length") !== true){
|
||||
if (Number.prototype.toFixed.hasOwnProperty("length") !== true) {
|
||||
$ERROR('#1: The length property of the toFixed method is 1');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if(Number.prototype.toFixed.length !== 1){
|
||||
if (Number.prototype.toFixed.length !== 1) {
|
||||
$ERROR('#2: The length property of the toFixed method is 1');
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ description: >
|
|||
Number.prototype.toFixed returns a string value
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof (123.456).toFixed(), "string");
|
||||
assert.sameValue(typeof(123.456).toFixed(), "string");
|
||||
|
|
|
@ -18,4 +18,3 @@ assert.throws(RangeError, () => (3).toPrecision(-10));
|
|||
|
||||
assert.sameValue((3).toPrecision(100), "3.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||
assert.throws(RangeError, () => (3).toPrecision(101));
|
||||
|
||||
|
|
|
@ -11,41 +11,41 @@ description: undefined radix
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString() !== "0"){
|
||||
if (Number.prototype.toString() !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString() === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString() !== "0"){
|
||||
if ((new Number()).toString() !== "0") {
|
||||
$ERROR('#2: (new Number()).toString() === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString() !== "0"){
|
||||
if ((new Number(0)).toString() !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString() === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString() !== "-1"){
|
||||
if ((new Number(-1)).toString() !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString() === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString() !== "1"){
|
||||
if ((new Number(1)).toString() !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString() === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString() !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString() !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString() === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString() !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString() !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString() === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString() !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString() !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString() === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -11,41 +11,41 @@ description: radix is 10
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(10) !== "0"){
|
||||
if (Number.prototype.toString(10) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(10) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(10) !== "0"){
|
||||
if ((new Number()).toString(10) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(10) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(10) !== "0"){
|
||||
if ((new Number(0)).toString(10) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(10) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(10) !== "-1"){
|
||||
if ((new Number(-1)).toString(10) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(10) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(10) !== "1"){
|
||||
if ((new Number(1)).toString(10) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(10) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(10) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(10) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(10) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(10) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(10) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(10) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(10) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(10) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(10) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -11,41 +11,41 @@ description: radix is undefined value
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(undefined) !== "0"){
|
||||
if (Number.prototype.toString(undefined) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(undefined) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(undefined) !== "0"){
|
||||
if ((new Number()).toString(undefined) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(undefined) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(undefined) !== "0"){
|
||||
if ((new Number(0)).toString(undefined) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(undefined) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(undefined) !== "-1"){
|
||||
if ((new Number(-1)).toString(undefined) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(undefined) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(undefined) !== "1"){
|
||||
if ((new Number(1)).toString(undefined) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(undefined) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(undefined) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(undefined) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(undefined) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(undefined) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(undefined) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(undefined) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(undefined) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(undefined) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(undefined) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 2
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(2) !== "0"){
|
||||
if (Number.prototype.toString(2) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(2) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(2) !== "0"){
|
||||
if ((new Number()).toString(2) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(2) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(2) !== "0"){
|
||||
if ((new Number(0)).toString(2) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(2) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(2) !== "-1"){
|
||||
if ((new Number(-1)).toString(2) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(2) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(2) !== "1"){
|
||||
if ((new Number(1)).toString(2) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(2) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(2) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(2) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(2) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(2) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(2) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(2) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(2) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(2) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(2) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 3
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(3) !== "0"){
|
||||
if (Number.prototype.toString(3) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(3) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(3) !== "0"){
|
||||
if ((new Number()).toString(3) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(3) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(3) !== "0"){
|
||||
if ((new Number(0)).toString(3) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(3) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(3) !== "-1"){
|
||||
if ((new Number(-1)).toString(3) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(3) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(3) !== "1"){
|
||||
if ((new Number(1)).toString(3) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(3) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(3) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(3) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(3) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(3) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(3) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(3) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(3) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(3) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(3) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 4
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(4) !== "0"){
|
||||
if (Number.prototype.toString(4) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(4) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(4) !== "0"){
|
||||
if ((new Number()).toString(4) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(4) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(4) !== "0"){
|
||||
if ((new Number(0)).toString(4) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(4) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(4) !== "-1"){
|
||||
if ((new Number(-1)).toString(4) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(4) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(4) !== "1"){
|
||||
if ((new Number(1)).toString(4) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(4) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(4) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(4) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(4) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(4) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(4) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(4) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(4) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(4) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(4) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 5
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(5) !== "0"){
|
||||
if (Number.prototype.toString(5) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(5) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(5) !== "0"){
|
||||
if ((new Number()).toString(5) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(5) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(5) !== "0"){
|
||||
if ((new Number(0)).toString(5) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(5) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(5) !== "-1"){
|
||||
if ((new Number(-1)).toString(5) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(5) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(5) !== "1"){
|
||||
if ((new Number(1)).toString(5) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(5) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(5) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(5) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(5) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(5) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(5) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(5) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(5) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(5) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(5) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 6
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(6) !== "0"){
|
||||
if (Number.prototype.toString(6) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(6) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(6) !== "0"){
|
||||
if ((new Number()).toString(6) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(6) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(6) !== "0"){
|
||||
if ((new Number(0)).toString(6) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(6) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(6) !== "-1"){
|
||||
if ((new Number(-1)).toString(6) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(6) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(6) !== "1"){
|
||||
if ((new Number(1)).toString(6) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(6) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(6) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(6) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(6) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(6) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(6) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(6) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(6) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(6) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(6) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 7
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(7) !== "0"){
|
||||
if (Number.prototype.toString(7) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(7) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(7) !== "0"){
|
||||
if ((new Number()).toString(7) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(7) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(7) !== "0"){
|
||||
if ((new Number(0)).toString(7) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(7) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(7) !== "-1"){
|
||||
if ((new Number(-1)).toString(7) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(7) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(7) !== "1"){
|
||||
if ((new Number(1)).toString(7) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(7) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(7) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(7) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(7) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(7) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(7) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(7) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(7) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(7) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(7) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 8
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(8) !== "0"){
|
||||
if (Number.prototype.toString(8) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(8) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(8) !== "0"){
|
||||
if ((new Number()).toString(8) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(8) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(8) !== "0"){
|
||||
if ((new Number(0)).toString(8) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(8) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(8) !== "-1"){
|
||||
if ((new Number(-1)).toString(8) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(8) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(8) !== "1"){
|
||||
if ((new Number(1)).toString(8) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(8) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(8) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(8) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(8) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(8) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(8) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(8) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(8) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(8) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(8) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 9
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(9) !== "0"){
|
||||
if (Number.prototype.toString(9) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(9) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(9) !== "0"){
|
||||
if ((new Number()).toString(9) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(9) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(9) !== "0"){
|
||||
if ((new Number(0)).toString(9) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(9) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(9) !== "-1"){
|
||||
if ((new Number(-1)).toString(9) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(9) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(9) !== "1"){
|
||||
if ((new Number(1)).toString(9) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(9) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(9) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(9) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(9) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(9) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(9) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(9) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(9) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(9) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(9) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 11
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(11) !== "0"){
|
||||
if (Number.prototype.toString(11) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(11) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(11) !== "0"){
|
||||
if ((new Number()).toString(11) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(11) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(11) !== "0"){
|
||||
if ((new Number(0)).toString(11) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(11) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(11) !== "-1"){
|
||||
if ((new Number(-1)).toString(11) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(11) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(11) !== "1"){
|
||||
if ((new Number(1)).toString(11) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(11) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(11) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(11) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(11) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(11) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(11) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(11) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(11) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(11) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(11) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 12
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(12) !== "0"){
|
||||
if (Number.prototype.toString(12) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(12) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(12) !== "0"){
|
||||
if ((new Number()).toString(12) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(12) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(12) !== "0"){
|
||||
if ((new Number(0)).toString(12) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(12) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(12) !== "-1"){
|
||||
if ((new Number(-1)).toString(12) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(12) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(12) !== "1"){
|
||||
if ((new Number(1)).toString(12) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(12) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(12) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(12) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(12) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(12) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(12) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(12) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(12) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(12) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(12) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 13
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(13) !== "0"){
|
||||
if (Number.prototype.toString(13) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(13) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(13) !== "0"){
|
||||
if ((new Number()).toString(13) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(13) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(13) !== "0"){
|
||||
if ((new Number(0)).toString(13) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(13) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(13) !== "-1"){
|
||||
if ((new Number(-1)).toString(13) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(13) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(13) !== "1"){
|
||||
if ((new Number(1)).toString(13) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(13) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(13) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(13) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(13) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(13) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(13) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(13) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(13) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(13) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(13) === "-Infinity"');
|
||||
}
|
||||
|
|
|
@ -10,41 +10,41 @@ description: radix is 14
|
|||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if(Number.prototype.toString(14) !== "0"){
|
||||
if (Number.prototype.toString(14) !== "0") {
|
||||
$ERROR('#1: Number.prototype.toString(14) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if((new Number()).toString(14) !== "0"){
|
||||
if ((new Number()).toString(14) !== "0") {
|
||||
$ERROR('#2: (new Number()).toString(14) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if((new Number(0)).toString(14) !== "0"){
|
||||
if ((new Number(0)).toString(14) !== "0") {
|
||||
$ERROR('#3: (new Number(0)).toString(14) === "0"');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if((new Number(-1)).toString(14) !== "-1"){
|
||||
if ((new Number(-1)).toString(14) !== "-1") {
|
||||
$ERROR('#4: (new Number(-1)).toString(14) === "-1"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if((new Number(1)).toString(14) !== "1"){
|
||||
if ((new Number(1)).toString(14) !== "1") {
|
||||
$ERROR('#5: (new Number(1)).toString(14) === "1"');
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if((new Number(Number.NaN)).toString(14) !== "NaN"){
|
||||
if ((new Number(Number.NaN)).toString(14) !== "NaN") {
|
||||
$ERROR('#6: (new Number(Number.NaN)).toString(14) === "NaN"');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if((new Number(Number.POSITIVE_INFINITY)).toString(14) !== "Infinity"){
|
||||
if ((new Number(Number.POSITIVE_INFINITY)).toString(14) !== "Infinity") {
|
||||
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(14) === "Infinity"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if((new Number(Number.NEGATIVE_INFINITY)).toString(14) !== "-Infinity"){
|
||||
if ((new Number(Number.NEGATIVE_INFINITY)).toString(14) !== "-Infinity") {
|
||||
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(14) === "-Infinity"');
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue