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

This commit is contained in:
Rick Waldron 2018-02-15 15:54:27 -05:00 committed by Leo Balter
parent 93d0256d87
commit a7ab6b4fd5
25 changed files with 199 additions and 191 deletions

View File

@ -13,21 +13,21 @@ description: >
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Boolean() !== "boolean" ) { if (typeof Boolean() !== "boolean") {
$ERROR('#1: typeof Boolean() should be "boolean", actual is "'+typeof Boolean()+'"'); $ERROR('#1: typeof Boolean() should be "boolean", actual is "' + typeof Boolean() + '"');
} }
//CHECK#2 //CHECK#2
if( typeof Boolean(1) !== "boolean" ) { if (typeof Boolean(1) !== "boolean") {
$ERROR('#2: typeof Boolean(1) should be "boolean", actual is "'+typeof Boolean(1)+'"'); $ERROR('#2: typeof Boolean(1) should be "boolean", actual is "' + typeof Boolean(1) + '"');
} }
//CHECK#3 //CHECK#3
if( typeof Boolean(new String("1")) !== "boolean" ) { if (typeof Boolean(new String("1")) !== "boolean") {
$ERROR('#3: typeof Boolean(new String("1")) should be "boolean", actual is "'+typeof Boolean(new String("1"))+'"'); $ERROR('#3: typeof Boolean(new String("1")) should be "boolean", actual is "' + typeof Boolean(new String("1")) + '"');
} }
//CHECK#4 //CHECK#4
if( typeof Boolean(new Object(1)) !== "boolean" ) { if (typeof Boolean(new Object(1)) !== "boolean") {
$ERROR('#4: typeof Boolean(new Object(1)) should be "boolean", actual is "'+typeof Boolean(new Object(1))+'"'); $ERROR('#4: typeof Boolean(new Object(1)) should be "boolean", actual is "' + typeof Boolean(new Object(1)) + '"');
} }

View File

@ -11,33 +11,33 @@ description: Used various number values as argument
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Boolean(0) !== "boolean" ) { if (typeof Boolean(0) !== "boolean") {
$ERROR('#1.1: typeof Boolean(0) should be "boolean", actual is "'+typeof Boolean(0)+'"'); $ERROR('#1.1: typeof Boolean(0) should be "boolean", actual is "' + typeof Boolean(0) + '"');
} }
if( Boolean(0) !== false ) { if (Boolean(0) !== false) {
$ERROR('#1.2: Boolean(0) should be false, actual is '+Boolean(0)); $ERROR('#1.2: Boolean(0) should be false, actual is ' + Boolean(0));
} }
//CHECK#2 //CHECK#2
if( typeof Boolean(-1) !== "boolean" ) { if (typeof Boolean(-1) !== "boolean") {
$ERROR('#2.1: typeof Boolean(-1) should be "boolean", actual is "'+typeof Boolean(-1)+'"'); $ERROR('#2.1: typeof Boolean(-1) should be "boolean", actual is "' + typeof Boolean(-1) + '"');
} }
if( Boolean(-1) !== true ) { if (Boolean(-1) !== true) {
$ERROR('#2.2: Boolean(-1) should be true, actual is '+Boolean(-1)); $ERROR('#2.2: Boolean(-1) should be true, actual is ' + Boolean(-1));
} }
//CHECK#3 //CHECK#3
if( typeof Boolean(-Infinity) !== "boolean" ) { if (typeof Boolean(-Infinity) !== "boolean") {
$ERROR('#3.1: typeof Boolean(-Infinity) should be "boolean", actual is "'+typeof Boolean(-Infinity)+'"'); $ERROR('#3.1: typeof Boolean(-Infinity) should be "boolean", actual is "' + typeof Boolean(-Infinity) + '"');
} }
if( Boolean(-Infinity) !== true ) { if (Boolean(-Infinity) !== true) {
$ERROR('#3.2: Boolean(-Infinity) should be true, actual is '+Boolean(-Infinity)); $ERROR('#3.2: Boolean(-Infinity) should be true, actual is ' + Boolean(-Infinity));
} }
//CHECK#4 //CHECK#4
if( typeof Boolean(NaN) !== "boolean" ) { if (typeof Boolean(NaN) !== "boolean") {
$ERROR('#4.1: typeof Boolean(NaN) should be "boolean", actual is "'+typeof Boolean(NaN)+'"'); $ERROR('#4.1: typeof Boolean(NaN) should be "boolean", actual is "' + typeof Boolean(NaN) + '"');
} }
if( Boolean(NaN) !== false ) { if (Boolean(NaN) !== false) {
$ERROR('#4.2: Boolean(NaN) should be false, actual is '+Boolean(NaN)); $ERROR('#4.2: Boolean(NaN) should be false, actual is ' + Boolean(NaN));
} }

View File

@ -11,41 +11,41 @@ description: Used various string values as argument
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Boolean("0") !== "boolean" ) { if (typeof Boolean("0") !== "boolean") {
$ERROR('#1.1: typeof Boolean("0") should be "boolean", actual is "'+typeof Boolean("0")+'"'); $ERROR('#1.1: typeof Boolean("0") should be "boolean", actual is "' + typeof Boolean("0") + '"');
} }
if( Boolean("0") !== true ) { if (Boolean("0") !== true) {
$ERROR('#1.2: Boolean("0") should be true'); $ERROR('#1.2: Boolean("0") should be true');
} }
//CHECK#2 //CHECK#2
if( typeof Boolean("-1") !== "boolean" ) { if (typeof Boolean("-1") !== "boolean") {
$ERROR('#2.1: typeof Boolean("-1") should be "boolean", actual is "'+typeof Boolean("-1")+'"'); $ERROR('#2.1: typeof Boolean("-1") should be "boolean", actual is "' + typeof Boolean("-1") + '"');
} }
if( Boolean("-1") !== true ) { if (Boolean("-1") !== true) {
$ERROR('#2.2: Boolean("-1") should be true'); $ERROR('#2.2: Boolean("-1") should be true');
} }
//CHECK#3 //CHECK#3
if( typeof Boolean("1") !== "boolean" ) { if (typeof Boolean("1") !== "boolean") {
$ERROR('#3.1: typeof Boolean("1") should be "boolean", actual is "'+typeof Boolean("1")+'"'); $ERROR('#3.1: typeof Boolean("1") should be "boolean", actual is "' + typeof Boolean("1") + '"');
} }
if( Boolean("1") !== true ) { if (Boolean("1") !== true) {
$ERROR('#3.2: Boolean("1") should be true'); $ERROR('#3.2: Boolean("1") should be true');
} }
//CHECK#4 //CHECK#4
if( typeof Boolean("false") !== "boolean" ) { if (typeof Boolean("false") !== "boolean") {
$ERROR('#4.1: typeof Boolean("false") should be "boolean", actual is "'+typeof Boolean("false")+'"'); $ERROR('#4.1: typeof Boolean("false") should be "boolean", actual is "' + typeof Boolean("false") + '"');
} }
if( Boolean("false") !== true ) { if (Boolean("false") !== true) {
$ERROR('#4.2: Boolean("false") should be true'); $ERROR('#4.2: Boolean("false") should be true');
} }
//CHECK#5 //CHECK#5
if( typeof Boolean("true") !== "boolean" ) { if (typeof Boolean("true") !== "boolean") {
$ERROR('#5.1: typeof Boolean("true") should be "boolean", actual is "'+typeof Boolean("true")+'"'); $ERROR('#5.1: typeof Boolean("true") should be "boolean", actual is "' + typeof Boolean("true") + '"');
} }
if( Boolean("true") !== true ) { if (Boolean("true") !== true) {
$ERROR('#5.2: Boolean("true") should be true'); $ERROR('#5.2: Boolean("true") should be true');
} }

View File

@ -11,42 +11,42 @@ description: Used various undefined values and null as argument
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Boolean(undefined) !== "boolean" ) { if (typeof Boolean(undefined) !== "boolean") {
$ERROR('#1.1: typeof Boolean(undefined) should be "boolean", actual is "'+typeof Boolean(undefined)+'"'); $ERROR('#1.1: typeof Boolean(undefined) should be "boolean", actual is "' + typeof Boolean(undefined) + '"');
} }
if( Boolean(undefined) !== false ) { if (Boolean(undefined) !== false) {
$ERROR('#1.2: Boolean(undefined) should be false'); $ERROR('#1.2: Boolean(undefined) should be false');
} }
//CHECK#2 //CHECK#2
if( typeof Boolean(void 0) !== "boolean" ) { if (typeof Boolean(void 0) !== "boolean") {
$ERROR('#2.1: typeof Boolean(void 0) should be "boolean", actual is "'+typeof Boolean(void 0)+'"'); $ERROR('#2.1: typeof Boolean(void 0) should be "boolean", actual is "' + typeof Boolean(void 0) + '"');
} }
if( Boolean(void 0) !== false ) { if (Boolean(void 0) !== false) {
$ERROR('#2.2: Boolean(void 0) should be false'); $ERROR('#2.2: Boolean(void 0) should be false');
} }
//CHECK#3 //CHECK#3
if( typeof Boolean(function(){}()) !== "boolean" ) { if (typeof Boolean(function() {}()) !== "boolean") {
$ERROR('#3.1: typeof Boolean(function(){}()) should be "boolean", actual is "'+typeof Boolean(function(){}())+'"'); $ERROR('#3.1: typeof Boolean(function(){}()) should be "boolean", actual is "' + typeof Boolean(function() {}()) + '"');
} }
if( Boolean(function(){}()) !== false ) { if (Boolean(function() {}()) !== false) {
$ERROR('#3.2: Boolean(function(){}()) should be false'); $ERROR('#3.2: Boolean(function(){}()) should be false');
} }
//CHECK#4 //CHECK#4
if( typeof Boolean(null) !== "boolean" ) { if (typeof Boolean(null) !== "boolean") {
$ERROR('#4.1: typeof Boolean(null) should be "boolean", actual is "'+typeof Boolean(null)+'"'); $ERROR('#4.1: typeof Boolean(null) should be "boolean", actual is "' + typeof Boolean(null) + '"');
} }
if( Boolean(null) !== false ) { if (Boolean(null) !== false) {
$ERROR('#4.2: Boolean(null) should be false'); $ERROR('#4.2: Boolean(null) should be false');
} }
//CHECK#5 //CHECK#5
if( typeof Boolean(x) !== "boolean" ) { if (typeof Boolean(x) !== "boolean") {
$ERROR('#5.1: var x; typeof Boolean(x) should be "boolean", actual is "'+typeof Boolean(x)+'"'); $ERROR('#5.1: var x; typeof Boolean(x) should be "boolean", actual is "' + typeof Boolean(x) + '"');
} }
if( Boolean(x) !== false ) { if (Boolean(x) !== false) {
$ERROR('#5.2: var x; Boolean(x) should be false'); $ERROR('#5.2: var x; Boolean(x) should be false');
} }
var x; var x;

View File

@ -13,41 +13,41 @@ description: Used various assigning values to any variable as argument
var x; var x;
//CHECK#1 //CHECK#1
if( typeof Boolean(x=0) !== "boolean" ) { if (typeof Boolean(x = 0) !== "boolean") {
$ERROR('#1.1: typeof Boolean(x=0) should be "boolean", actual is "'+typeof Boolean(x=0)+'"'); $ERROR('#1.1: typeof Boolean(x=0) should be "boolean", actual is "' + typeof Boolean(x = 0) + '"');
} }
if( Boolean(x=0) !== false ) { if (Boolean(x = 0) !== false) {
$ERROR('#1.2: Boolean(x=0) should be false'); $ERROR('#1.2: Boolean(x=0) should be false');
} }
//CHECK#2 //CHECK#2
if( typeof Boolean(x=1) !== "boolean" ) { if (typeof Boolean(x = 1) !== "boolean") {
$ERROR('#2.1: typeof Boolean(x=1) should be "boolean", actual is "'+typeof Boolean(x=1)+'"'); $ERROR('#2.1: typeof Boolean(x=1) should be "boolean", actual is "' + typeof Boolean(x = 1) + '"');
} }
if( Boolean(x=1) !== true ) { if (Boolean(x = 1) !== true) {
$ERROR('#2.2: Boolean(x=1) should be true'); $ERROR('#2.2: Boolean(x=1) should be true');
} }
//CHECK#3 //CHECK#3
if( typeof Boolean(x=false) !== "boolean" ) { if (typeof Boolean(x = false) !== "boolean") {
$ERROR('#3.1: typeof Boolean(x=false) should be "boolean", actual is "'+typeof Boolean(x=false)+'"'); $ERROR('#3.1: typeof Boolean(x=false) should be "boolean", actual is "' + typeof Boolean(x = false) + '"');
} }
if( Boolean(x=false) !== false ) { if (Boolean(x = false) !== false) {
$ERROR('#3.2: Boolean(x=false) should be false'); $ERROR('#3.2: Boolean(x=false) should be false');
} }
//CHECK#4 //CHECK#4
if( typeof Boolean(x=true) !== "boolean" ) { if (typeof Boolean(x = true) !== "boolean") {
$ERROR('#4.1: typeof Boolean(x=true) should be "boolean", actual is "'+typeof Boolean(x=true)+'"'); $ERROR('#4.1: typeof Boolean(x=true) should be "boolean", actual is "' + typeof Boolean(x = true) + '"');
} }
if( Boolean(x=true) !== true ) { if (Boolean(x = true) !== true) {
$ERROR('#4.2: Boolean(x=true) should be true'); $ERROR('#4.2: Boolean(x=true) should be true');
} }
//CHECK#5 //CHECK#5
if( typeof Boolean(x=null) !== "boolean" ) { if (typeof Boolean(x = null) !== "boolean") {
$ERROR('#5.1: typeof Boolean(x=null) should be "boolean", actual is "'+typeof Boolean(x=null)+'"'); $ERROR('#5.1: typeof Boolean(x=null) should be "boolean", actual is "' + typeof Boolean(x = null) + '"');
} }
if( Boolean(x=null) !== false ) { if (Boolean(x = null) !== false) {
$ERROR('#5.2: Boolean(x=null) should be false'); $ERROR('#5.2: Boolean(x=null) should be false');
} }

View File

@ -9,11 +9,11 @@ description: Call Boolean() and check result
---*/ ---*/
//CHECK#1 //CHECK#1
if( typeof Boolean() !== "boolean" ) { if (typeof Boolean() !== "boolean") {
$ERROR('#1: typeof Boolean() should be "boolean", actual is "'+typeof Boolean()+'"'); $ERROR('#1: typeof Boolean() should be "boolean", actual is "' + typeof Boolean() + '"');
} }
//CHECK#2 //CHECK#2
if( Boolean() !== false ) { if (Boolean() !== false) {
$ERROR('#2: Boolean() should be false'); $ERROR('#2: Boolean() should be false');
} }

View File

@ -22,13 +22,13 @@ if (new Boolean() === undefined) {
//CHECK#3 //CHECK#3
var x3 = new Boolean(); var x3 = new Boolean();
if(typeof x3 !== "object"){ if (typeof x3 !== "object") {
$ERROR("#3: typeof new Boolean() !== 'object'"); $ERROR("#3: typeof new Boolean() !== 'object'");
} }
//CHECK#4 //CHECK#4
var x4 = new Boolean(); var x4 = new Boolean();
if(x4 === undefined){ if (x4 === undefined) {
$ERROR("#4: new Boolean() should not be undefined"); $ERROR("#4: new Boolean() should not be undefined");
} }
@ -44,12 +44,12 @@ if (new Boolean(1) === undefined) {
//CHECK#7 //CHECK#7
var x7 = new Boolean(1); var x7 = new Boolean(1);
if(typeof x7 !== "object"){ if (typeof x7 !== "object") {
$ERROR("#7: typeof new Boolean(1) !== 'object'"); $ERROR("#7: typeof new Boolean(1) !== 'object'");
} }
//CHECK#8 //CHECK#8
var x8 = new Boolean(1); var x8 = new Boolean(1);
if(x8 === undefined){ if (x8 === undefined) {
$ERROR("#8: new Boolean(1) should not be undefined"); $ERROR("#8: new Boolean(1) should not be undefined");
} }

View File

@ -8,6 +8,6 @@ es5id: 15.6.3_A1
description: Checking existence of the property "prototype" description: Checking existence of the property "prototype"
---*/ ---*/
if(!Boolean.hasOwnProperty("prototype")){ if (!Boolean.hasOwnProperty("prototype")) {
$ERROR('#1: The Boolean constructor has the property "prototype"'); $ERROR('#1: The Boolean constructor has the property "prototype"');
} }

View File

@ -9,7 +9,7 @@ description: Checking Boolean.length property
---*/ ---*/
//CHECK#1 //CHECK#1
if (!Boolean.hasOwnProperty("length")){ if (!Boolean.hasOwnProperty("length")) {
$ERROR('#1: Boolean constructor has length property'); $ERROR('#1: Boolean constructor has length property');
} }

View File

@ -9,8 +9,8 @@ description: Checking if enumerating the Boolean.prototype property fails
---*/ ---*/
//CHECK#1 //CHECK#1
for(x in Boolean) { for (x in Boolean) {
if(x === "prototype") { if (x === "prototype") {
$ERROR('#1: Boolean.prototype has the attribute DontEnum'); $ERROR('#1: Boolean.prototype has the attribute DontEnum');
} }
} }

View File

@ -11,6 +11,6 @@ description: Compare Boolean.prototype.constructor with Boolean
---*/ ---*/
//CHECK#1 //CHECK#1
if(Boolean.prototype.constructor !== Boolean){ if (Boolean.prototype.constructor !== Boolean) {
$ERROR('#1: Boolean.prototype.constructor === Boolean'); $ERROR('#1: Boolean.prototype.constructor === Boolean');
} }

View File

@ -12,36 +12,36 @@ description: no arguments
---*/ ---*/
//CHECK#1 //CHECK#1
if(Boolean.prototype.toString() !== "false"){ if (Boolean.prototype.toString() !== "false") {
$ERROR('#1: Boolean.prototype.toString() === "false"'); $ERROR('#1: Boolean.prototype.toString() === "false"');
} }
//CHECK#2 //CHECK#2
if((new Boolean()).toString() !== "false"){ if ((new Boolean()).toString() !== "false") {
$ERROR('#2: (new Boolean()).toString() === "false"'); $ERROR('#2: (new Boolean()).toString() === "false"');
} }
//CHECK#3 //CHECK#3
if((new Boolean(false)).toString() !== "false"){ if ((new Boolean(false)).toString() !== "false") {
$ERROR('#3: (new Boolean(false)).toString() === "false"'); $ERROR('#3: (new Boolean(false)).toString() === "false"');
} }
//CHECK#4 //CHECK#4
if((new Boolean(true)).toString() !== "true"){ if ((new Boolean(true)).toString() !== "true") {
$ERROR('#4: (new Boolean(true)).toString() === "true"'); $ERROR('#4: (new Boolean(true)).toString() === "true"');
} }
//CHECK#5 //CHECK#5
if((new Boolean(1)).toString() !== "true"){ if ((new Boolean(1)).toString() !== "true") {
$ERROR('#5: (new Boolean(1)).toString() === "true"'); $ERROR('#5: (new Boolean(1)).toString() === "true"');
} }
//CHECK#6 //CHECK#6
if((new Boolean(0)).toString() !== "false"){ if ((new Boolean(0)).toString() !== "false") {
$ERROR('#6: (new Boolean(0)).toString() === "false"'); $ERROR('#6: (new Boolean(0)).toString() === "false"');
} }
//CHECK#7 //CHECK#7
if((new Boolean(new Object())).toString() !== "true"){ if ((new Boolean(new Object())).toString() !== "true") {
$ERROR('#7: (new Boolean(new Object())).toString() === "true"'); $ERROR('#7: (new Boolean(new Object())).toString() === "true"');
} }

View File

@ -12,36 +12,36 @@ description: with some argument
---*/ ---*/
//CHECK#1 //CHECK#1
if(Boolean.prototype.toString(true) !== "false"){ if (Boolean.prototype.toString(true) !== "false") {
$ERROR('#1: Boolean.prototype.toString(true) === "false"'); $ERROR('#1: Boolean.prototype.toString(true) === "false"');
} }
//CHECK#2 //CHECK#2
if((new Boolean()).toString(true) !== "false"){ if ((new Boolean()).toString(true) !== "false") {
$ERROR('#2: (new Boolean()).toString(true) === "false"'); $ERROR('#2: (new Boolean()).toString(true) === "false"');
} }
//CHECK#3 //CHECK#3
if((new Boolean(false)).toString(true) !== "false"){ if ((new Boolean(false)).toString(true) !== "false") {
$ERROR('#3: (new Boolean(false)).toString(true) === "false"'); $ERROR('#3: (new Boolean(false)).toString(true) === "false"');
} }
//CHECK#4 //CHECK#4
if((new Boolean(true)).toString(false) !== "true"){ if ((new Boolean(true)).toString(false) !== "true") {
$ERROR('#4: (new Boolean(true)).toString(false) === "true"'); $ERROR('#4: (new Boolean(true)).toString(false) === "true"');
} }
//CHECK#5 //CHECK#5
if((new Boolean(1)).toString(false) !== "true"){ if ((new Boolean(1)).toString(false) !== "true") {
$ERROR('#5: (new Boolean(1)).toString(false) === "true"'); $ERROR('#5: (new Boolean(1)).toString(false) === "true"');
} }
//CHECK#6 //CHECK#6
if((new Boolean(0)).toString(true) !== "false"){ if ((new Boolean(0)).toString(true) !== "false") {
$ERROR('#6: (new Boolean(0)).toString(true) === "false"'); $ERROR('#6: (new Boolean(0)).toString(true) === "false"');
} }
//CHECK#7 //CHECK#7
if((new Boolean(new Object())).toString(false) !== "true"){ if ((new Boolean(new Object())).toString(false) !== "true") {
$ERROR('#7: (new Boolean(new Object())).toString(false) === "true"'); $ERROR('#7: (new Boolean(new Object())).toString(false) === "true"');
} }

View File

@ -12,27 +12,27 @@ description: transferring to the String objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new String(); var s1 = new String();
s1.toString = Boolean.prototype.toString; s1.toString = Boolean.prototype.toString;
var v1 = s1.toString(); var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#2 //CHECK#2
try{ try {
var s2 = new String(); var s2 = new String();
s2.myToString = Boolean.prototype.toString; s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString(); var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Number objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Number(); var s1 = new Number();
s1.toString = Boolean.prototype.toString; s1.toString = Boolean.prototype.toString;
var v1 = s1.toString(); var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Number(); var s2 = new Number();
s2.myToString = Boolean.prototype.toString; s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString(); var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Date objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Date(); var s1 = new Date();
s1.toString = Boolean.prototype.toString; s1.toString = Boolean.prototype.toString;
var v1 = s1.toString(); var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Date(); var s2 = new Date();
s2.myToString = Boolean.prototype.toString; s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString(); var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Object objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Object(); var s1 = new Object();
s1.toString = Boolean.prototype.toString; s1.toString = Boolean.prototype.toString;
var v1 = s1.toString(); var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Object(); var s2 = new Object();
s2.myToString = Boolean.prototype.toString; s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString(); var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,31 @@ description: transferring to the other objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = {x: 1}; var s1 = {
x: 1
};
s1.toString = Boolean.prototype.toString; s1.toString = Boolean.prototype.toString;
var v1 = s1.toString(); var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = {x: 1}; var s2 = {
x: 1
};
s2.myToString = Boolean.prototype.toString; s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString(); var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -9,31 +9,31 @@ description: no arguments
---*/ ---*/
//CHECK#1 //CHECK#1
if(Boolean.prototype.valueOf() !== false){ if (Boolean.prototype.valueOf() !== false) {
$ERROR('#1: Boolean.prototype.valueOf() === false'); $ERROR('#1: Boolean.prototype.valueOf() === false');
} }
//CHECK#2 //CHECK#2
if((new Boolean()).valueOf() !== false){ if ((new Boolean()).valueOf() !== false) {
$ERROR('#2: (new Boolean()).valueOf() === false'); $ERROR('#2: (new Boolean()).valueOf() === false');
} }
//CHECK#3 //CHECK#3
if((new Boolean(0)).valueOf() !== false){ if ((new Boolean(0)).valueOf() !== false) {
$ERROR('#3: (new Boolean(0)).valueOf() === false'); $ERROR('#3: (new Boolean(0)).valueOf() === false');
} }
//CHECK#4 //CHECK#4
if((new Boolean(-1)).valueOf() !== true){ if ((new Boolean(-1)).valueOf() !== true) {
$ERROR('#4: (new Boolean(-1)).valueOf() === true'); $ERROR('#4: (new Boolean(-1)).valueOf() === true');
} }
//CHECK#5 //CHECK#5
if((new Boolean(1)).valueOf() !== true){ if ((new Boolean(1)).valueOf() !== true) {
$ERROR('#5: (new Boolean(1)).valueOf() === true'); $ERROR('#5: (new Boolean(1)).valueOf() === true');
} }
//CHECK#6 //CHECK#6
if((new Boolean(new Object())).valueOf() !== true){ if ((new Boolean(new Object())).valueOf() !== true) {
$ERROR('#6: (new Boolean(new Object())).valueOf() === true'); $ERROR('#6: (new Boolean(new Object())).valueOf() === true');
} }

View File

@ -9,31 +9,31 @@ description: calling with argument
---*/ ---*/
//CHECK#1 //CHECK#1
if(Boolean.prototype.valueOf(true) !== false){ if (Boolean.prototype.valueOf(true) !== false) {
$ERROR('#1: Boolean.prototype.valueOf(true) === false'); $ERROR('#1: Boolean.prototype.valueOf(true) === false');
} }
//CHECK#2 //CHECK#2
if((new Boolean()).valueOf(true) !== false){ if ((new Boolean()).valueOf(true) !== false) {
$ERROR('#2: (new Boolean()).valueOf(true) === false'); $ERROR('#2: (new Boolean()).valueOf(true) === false');
} }
//CHECK#3 //CHECK#3
if((new Boolean(0)).valueOf(true) !== false){ if ((new Boolean(0)).valueOf(true) !== false) {
$ERROR('#3: (new Boolean(0)).valueOf(true) === false'); $ERROR('#3: (new Boolean(0)).valueOf(true) === false');
} }
//CHECK#4 //CHECK#4
if((new Boolean(-1)).valueOf(false) !== true){ if ((new Boolean(-1)).valueOf(false) !== true) {
$ERROR('#4: (new Boolean(-1)).valueOf(false) === true'); $ERROR('#4: (new Boolean(-1)).valueOf(false) === true');
} }
//CHECK#5 //CHECK#5
if((new Boolean(1)).valueOf(false) !== true){ if ((new Boolean(1)).valueOf(false) !== true) {
$ERROR('#5: (new Boolean(1)).valueOf(false) === true'); $ERROR('#5: (new Boolean(1)).valueOf(false) === true');
} }
//CHECK#6 //CHECK#6
if((new Boolean(new Object())).valueOf(false) !== true){ if ((new Boolean(new Object())).valueOf(false) !== true) {
$ERROR('#6: (new Boolean(new Object())).valueOf(false) === true'); $ERROR('#6: (new Boolean(new Object())).valueOf(false) === true');
} }

View File

@ -12,27 +12,27 @@ description: transferring to the String objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new String(); var s1 = new String();
s1.valueOf = Boolean.prototype.valueOf; s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf(); var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new String(); var s2 = new String();
s2.myValueOf = Boolean.prototype.valueOf; s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf(); var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Number objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Number(); var s1 = new Number();
s1.valueOf = Boolean.prototype.valueOf; s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf(); var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Number(); var s2 = new Number();
s2.myValueOf = Boolean.prototype.valueOf; s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf(); var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Date objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Date(); var s1 = new Date();
s1.valueOf = Boolean.prototype.valueOf; s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf(); var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Date(); var s2 = new Date();
s2.myValueOf = Boolean.prototype.valueOf; s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf(); var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,27 @@ description: transferring to the Object objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = new Object(); var s1 = new Object();
s1.valueOf = Boolean.prototype.valueOf; s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf(); var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = new Object(); var s2 = new Object();
s2.myValueOf = Boolean.prototype.valueOf; s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf(); var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }

View File

@ -12,27 +12,31 @@ description: transferring to the other objects
---*/ ---*/
//CHECK#1 //CHECK#1
try{ try {
var s1 = {x: 1}; var s1 = {
x: 1
};
s1.valueOf = Boolean.prototype.valueOf; s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf(); var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }
//CHECK#1 //CHECK#1
try{ try {
var s2 = {x: 1}; var s2 = {
x: 1
};
s2.myValueOf = Boolean.prototype.valueOf; s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf(); var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError'); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
} }
catch(e){ catch (e) {
if(!(e instanceof TypeError)){ if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not '+e); $ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
} }
} }