chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Boolean (#3078)

This commit is contained in:
Rick Waldron 2021-07-21 14:55:36 -04:00 committed by GitHub
parent 1ec7056f38
commit a912ae03a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 182 additions and 182 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -13,40 +13,40 @@ var x;
//CHECK#1
if (typeof Boolean(x = 0) !== "boolean") {
$ERROR('#1.1: typeof Boolean(x=0) should be "boolean", actual is "' + typeof Boolean(x = 0) + '"');
throw new Test262Error('#1.1: typeof Boolean(x=0) should be "boolean", actual is "' + typeof Boolean(x = 0) + '"');
}
if (Boolean(x = 0) !== false) {
$ERROR('#1.2: Boolean(x=0) should be false');
throw new Test262Error('#1.2: Boolean(x=0) should be false');
}
//CHECK#2
if (typeof Boolean(x = 1) !== "boolean") {
$ERROR('#2.1: typeof Boolean(x=1) should be "boolean", actual is "' + typeof Boolean(x = 1) + '"');
throw new Test262Error('#2.1: typeof Boolean(x=1) should be "boolean", actual is "' + typeof Boolean(x = 1) + '"');
}
if (Boolean(x = 1) !== true) {
$ERROR('#2.2: Boolean(x=1) should be true');
throw new Test262Error('#2.2: Boolean(x=1) should be true');
}
//CHECK#3
if (typeof Boolean(x = false) !== "boolean") {
$ERROR('#3.1: typeof Boolean(x=false) should be "boolean", actual is "' + typeof Boolean(x = false) + '"');
throw new Test262Error('#3.1: typeof Boolean(x=false) should be "boolean", actual is "' + typeof Boolean(x = false) + '"');
}
if (Boolean(x = false) !== false) {
$ERROR('#3.2: Boolean(x=false) should be false');
throw new Test262Error('#3.2: Boolean(x=false) should be false');
}
//CHECK#4
if (typeof Boolean(x = true) !== "boolean") {
$ERROR('#4.1: typeof Boolean(x=true) should be "boolean", actual is "' + typeof Boolean(x = true) + '"');
throw new Test262Error('#4.1: typeof Boolean(x=true) should be "boolean", actual is "' + typeof Boolean(x = true) + '"');
}
if (Boolean(x = true) !== true) {
$ERROR('#4.2: Boolean(x=true) should be true');
throw new Test262Error('#4.2: Boolean(x=true) should be true');
}
//CHECK#5
if (typeof Boolean(x = null) !== "boolean") {
$ERROR('#5.1: typeof Boolean(x=null) should be "boolean", actual is "' + typeof Boolean(x = null) + '"');
throw new Test262Error('#5.1: typeof Boolean(x=null) should be "boolean", actual is "' + typeof Boolean(x = null) + '"');
}
if (Boolean(x = null) !== false) {
$ERROR('#5.2: Boolean(x=null) should be false');
throw new Test262Error('#5.2: Boolean(x=null) should be false');
}

View File

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

View File

@ -11,44 +11,44 @@ description: Checking type of the newly created object and it value
//CHECK#1
if (typeof new Boolean() !== "object") {
$ERROR("#1: typeof new Boolean() === 'object'");
throw new Test262Error("#1: typeof new Boolean() === 'object'");
}
//CHECK#2
if (new Boolean() === undefined) {
$ERROR("#2: new Boolean() should not be undefined");
throw new Test262Error("#2: new Boolean() should not be undefined");
}
//CHECK#3
var x3 = new Boolean();
if (typeof x3 !== "object") {
$ERROR("#3: typeof new Boolean() !== 'object'");
throw new Test262Error("#3: typeof new Boolean() !== 'object'");
}
//CHECK#4
var x4 = new Boolean();
if (x4 === undefined) {
$ERROR("#4: new Boolean() should not be undefined");
throw new Test262Error("#4: new Boolean() should not be undefined");
}
//CHECK#5
if (typeof new Boolean(1) !== "object") {
$ERROR("#5: typeof new Boolean(10) === 'object'");
throw new Test262Error("#5: typeof new Boolean(10) === 'object'");
}
//CHECK#6
if (new Boolean(1) === undefined) {
$ERROR("#6: new Boolean(1) should not be undefined");
throw new Test262Error("#6: new Boolean(1) should not be undefined");
}
//CHECK#7
var x7 = new Boolean(1);
if (typeof x7 !== "object") {
$ERROR("#7: typeof new Boolean(1) !== 'object'");
throw new Test262Error("#7: typeof new Boolean(1) !== 'object'");
}
//CHECK#8
var x8 = new Boolean(1);
if (x8 === undefined) {
$ERROR("#8: new Boolean(1) should not be undefined");
throw new Test262Error("#8: new Boolean(1) should not be undefined");
}

View File

@ -13,17 +13,17 @@ description: Checking prototype property of the newly created object
// CHECK#1
var x1 = new Boolean(1);
if (typeof x1.constructor.prototype !== "object") {
$ERROR('#1: typeof x1.constructor.prototype === "object"');
throw new Test262Error('#1: typeof x1.constructor.prototype === "object"');
}
//CHECK#2
var x2 = new Boolean(2);
if (!Boolean.prototype.isPrototypeOf(x2)) {
$ERROR('#2: Boolean.prototype.isPrototypeOf(x2)');
throw new Test262Error('#2: Boolean.prototype.isPrototypeOf(x2)');
}
//CHECK#3
var x3 = new Boolean(3);
if (Boolean.prototype !== x3.constructor.prototype) {
$ERROR('#3: Boolean.prototype === x3.constructor.prototype');
throw new Test262Error('#3: Boolean.prototype === x3.constructor.prototype');
}

View File

@ -12,23 +12,23 @@ description: Checking value of the newly created object
// CHECK#1
var x1 = new Boolean(1);
if (x1.valueOf() !== true) {
$ERROR('#1: var x1 = new Boolean(1); x1.valueOf() === true');
throw new Test262Error('#1: var x1 = new Boolean(1); x1.valueOf() === true');
}
//CHECK#2
var x2 = new Boolean();
if (x2.valueOf() !== false) {
$ERROR('#2: var x2 = new Boolean(); x2.valueOf() === false');
throw new Test262Error('#2: var x2 = new Boolean(); x2.valueOf() === false');
}
//CHECK#3
var x2 = new Boolean(0);
if (x2.valueOf() !== false) {
$ERROR('#3: var x2 = new Boolean(0); x2.valueOf() === false');
throw new Test262Error('#3: var x2 = new Boolean(0); x2.valueOf() === false');
}
//CHECK#4
var x2 = new Boolean(new Object());
if (x2.valueOf() !== true) {
$ERROR('#4: var x2 = new Boolean(new Object()); x2.valueOf() === true');
throw new Test262Error('#4: var x2 = new Boolean(new Object()); x2.valueOf() === true');
}

View File

@ -15,5 +15,5 @@ var obj = new Boolean();
//CHECK#1
if (obj.toString() !== "[object Boolean]") {
$ERROR('#1: The [[Class]] property of the newly constructed object is set to "Boolean"');
throw new Test262Error('#1: The [[Class]] property of the newly constructed object is set to "Boolean"');
}

View File

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

View File

@ -11,5 +11,5 @@ description: Checking prototype of the Boolean constructor
//CHECK#1
if (!(Function.prototype.isPrototypeOf(Boolean))) {
$ERROR('#1: the value of the internal [[Prototype]] property of the Boolean constructor is the Function prototype object.');
throw new Test262Error('#1: the value of the internal [[Prototype]] property of the Boolean constructor is the Function prototype object.');
}

View File

@ -9,10 +9,10 @@ description: Checking Boolean.length property
//CHECK#1
if (!Boolean.hasOwnProperty("length")) {
$ERROR('#1: Boolean constructor has length property');
throw new Test262Error('#1: Boolean constructor has length property');
}
//CHECK#2
if (Boolean.length !== 1) {
$ERROR('#2: Boolean constructor length property value is 1');
throw new Test262Error('#2: Boolean constructor length property value is 1');
}

View File

@ -11,20 +11,20 @@ description: >
// CHECK#1
if (Boolean(undefined) !== false) {
$ERROR('#1: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
throw new Test262Error('#1: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
}
// CHECK#2
if (Boolean(void 0) !== false) {
$ERROR('#2: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
throw new Test262Error('#2: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
}
// CHECK#3
if (Boolean(eval("var x")) !== false) {
$ERROR('#3: Boolean(eval("var x")) === false. Actual: ' + (Boolean(eval("var x"))));
throw new Test262Error('#3: Boolean(eval("var x")) === false. Actual: ' + (Boolean(eval("var x"))));
}
// CHECK#4
if (Boolean() !== false) {
$ERROR('#4: Boolean() === false. Actual: ' + (Boolean()));
throw new Test262Error('#4: Boolean() === false. Actual: ' + (Boolean()));
}

View File

@ -9,5 +9,5 @@ description: null convert to Boolean by explicit transformation
// CHECK#1
if (Boolean(null) !== false) {
$ERROR('#1: Boolean(null) === false. Actual: ' + (Boolean(null)));
throw new Test262Error('#1: Boolean(null) === false. Actual: ' + (Boolean(null)));
}

View File

@ -9,10 +9,10 @@ description: true and false convert to Boolean by explicit transformation
// CHECK#1
if (Boolean(true) !== true) {
$ERROR('#1: Boolean(true) === true. Actual: ' + (Boolean(true)));
throw new Test262Error('#1: Boolean(true) === true. Actual: ' + (Boolean(true)));
}
// CHECK#2
if (Boolean(false) !== false) {
$ERROR('#2: Boolean(false) === false. Actual: ' + (Boolean(false)));
throw new Test262Error('#2: Boolean(false) === false. Actual: ' + (Boolean(false)));
}

View File

@ -11,15 +11,15 @@ description: +0, -0 and NaN convert to Boolean by explicit transformation
// CHECK#1
if (Boolean(+0) !== false) {
$ERROR('#1: Boolean(+0) === false. Actual: ' + (Boolean(+0)));
throw new Test262Error('#1: Boolean(+0) === false. Actual: ' + (Boolean(+0)));
}
// CHECK#2
if (Boolean(-0) !== false) {
$ERROR('#2: Boolean(-0) === false. Actual: ' + (Boolean(-0)));
throw new Test262Error('#2: Boolean(-0) === false. Actual: ' + (Boolean(-0)));
}
// CHECK#3
if (Boolean(Number.NaN) !== false) {
$ERROR('#3: Boolean(Number.NaN) === false. Actual: ' + (Boolean(Number.NaN)));
throw new Test262Error('#3: Boolean(Number.NaN) === false. Actual: ' + (Boolean(Number.NaN)));
}

View File

@ -14,40 +14,40 @@ description: >
// CHECK#1
if (Boolean(Number.POSITIVE_INFINITY) !== true) {
$ERROR('#1: Boolean(+Infinity) === true. Actual: ' + (Boolean(+Infinity)));
throw new Test262Error('#1: Boolean(+Infinity) === true. Actual: ' + (Boolean(+Infinity)));
}
// CHECK#2;
if (Boolean(Number.NEGATIVE_INFINITY) !== true) {
$ERROR('#2: Boolean(-Infinity) === true. Actual: ' + (Boolean(-Infinity)));
throw new Test262Error('#2: Boolean(-Infinity) === true. Actual: ' + (Boolean(-Infinity)));
}
// CHECK#3
if (Boolean(Number.MAX_VALUE) !== true) {
$ERROR('#3: Boolean(Number.MAX_VALUE) === true. Actual: ' + (Boolean(Number.MAX_VALUE)));
throw new Test262Error('#3: Boolean(Number.MAX_VALUE) === true. Actual: ' + (Boolean(Number.MAX_VALUE)));
}
// CHECK#4
if (Boolean(Number.MIN_VALUE) !== true) {
$ERROR('#4: Boolean(Number.MIN_VALUE) === true. Actual: ' + (Boolean(Number.MIN_VALUE)));
throw new Test262Error('#4: Boolean(Number.MIN_VALUE) === true. Actual: ' + (Boolean(Number.MIN_VALUE)));
}
// CHECK#5
if (Boolean(13) !== true) {
$ERROR('#5: Boolean(13) === true. Actual: ' + (Boolean(13)));
throw new Test262Error('#5: Boolean(13) === true. Actual: ' + (Boolean(13)));
}
// CHECK#6
if (Boolean(-13) !== true) {
$ERROR('#6: Boolean(-13) === true. Actual: ' + (Boolean(-13)));
throw new Test262Error('#6: Boolean(-13) === true. Actual: ' + (Boolean(-13)));
}
// CHECK#7
if (Boolean(1.3) !== true) {
$ERROR('#7: Boolean(1.3) === true. Actual: ' + (Boolean(1.3)));
throw new Test262Error('#7: Boolean(1.3) === true. Actual: ' + (Boolean(1.3)));
}
// CHECK#8
if (Boolean(-1.3) !== true) {
$ERROR('#8: Boolean(-1.3) === true. Actual: ' + (Boolean(-1.3)));
throw new Test262Error('#8: Boolean(-1.3) === true. Actual: ' + (Boolean(-1.3)));
}

View File

@ -11,5 +11,5 @@ description: "\"\" is converted to Boolean by explicit transformation"
// CHECK#1
if (Boolean("") !== false) {
$ERROR('#1: Boolean("") === false. Actual: ' + (Boolean("")));
throw new Test262Error('#1: Boolean("") === false. Actual: ' + (Boolean("")));
}

View File

@ -11,10 +11,10 @@ description: Any nonempty string convert to Boolean by explicit transformation
// CHECK#1
if (Boolean(" ") !== true) {
$ERROR('#1: Boolean(" ") === true. Actual: ' + (Boolean(" ")));
throw new Test262Error('#1: Boolean(" ") === true. Actual: ' + (Boolean(" ")));
}
// CHECK#2
if (Boolean("Nonempty String") !== true) {
$ERROR('#2: Boolean("Nonempty String") === true. Actual: ' + (Boolean("Nonempty String")));
throw new Test262Error('#2: Boolean("Nonempty String") === true. Actual: ' + (Boolean("Nonempty String")));
}

View File

@ -9,95 +9,95 @@ description: Different objects convert to Boolean by explicit transformation
// CHECK#1
if (Boolean(new Object()) !== true) {
$ERROR('#1: Boolean(new Object()) === true. Actual: ' + (Boolean(new Object())));
throw new Test262Error('#1: Boolean(new Object()) === true. Actual: ' + (Boolean(new Object())));
}
// CHECK#2
if (Boolean(new String("")) !== true) {
$ERROR('#2: Boolean(new String("")) === true. Actual: ' + (Boolean(new String(""))));
throw new Test262Error('#2: Boolean(new String("")) === true. Actual: ' + (Boolean(new String(""))));
}
// CHECK#3
if (Boolean(new String()) !== true) {
$ERROR('#3: Boolean(new String()) === true. Actual: ' + (Boolean(new String())));
throw new Test262Error('#3: Boolean(new String()) === true. Actual: ' + (Boolean(new String())));
}
// CHECK#4
if (Boolean(new Boolean(true)) !== true) {
$ERROR('#4: Boolean(new Boolean(true)) === true. Actual: ' + (Boolean(new Boolean(true))));
throw new Test262Error('#4: Boolean(new Boolean(true)) === true. Actual: ' + (Boolean(new Boolean(true))));
}
// CHECK#5
if (Boolean(new Boolean(false)) !== true) {
$ERROR('#5: Boolean(new Boolean(false)) === true. Actual: ' + (Boolean(new Boolean(false))));
throw new Test262Error('#5: Boolean(new Boolean(false)) === true. Actual: ' + (Boolean(new Boolean(false))));
}
// CHECK#6
if (Boolean(new Boolean()) !== true) {
$ERROR('#6: Boolean(new Boolean()) === true. Actual: ' + (Boolean(new Boolean())));
throw new Test262Error('#6: Boolean(new Boolean()) === true. Actual: ' + (Boolean(new Boolean())));
}
// CHECK#7
if (Boolean(new Array()) !== true) {
$ERROR('#7: Boolean(new Array()) === true. Actual: ' + (Boolean(new Array())));
throw new Test262Error('#7: Boolean(new Array()) === true. Actual: ' + (Boolean(new Array())));
}
// CHECK#8
if (Boolean(new Number()) !== true) {
$ERROR('#8: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number())));
throw new Test262Error('#8: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number())));
}
// CHECK#9
if (Boolean(new Number(-0)) !== true) {
$ERROR('#9: Boolean(new Number(-0)) === true. Actual: ' + (Boolean(new Number(-0))));
throw new Test262Error('#9: Boolean(new Number(-0)) === true. Actual: ' + (Boolean(new Number(-0))));
}
// CHECK#10
if (Boolean(new Number(0)) !== true) {
$ERROR('#10: Boolean(new Number(0)) === true. Actual: ' + (Boolean(new Number(0))));
throw new Test262Error('#10: Boolean(new Number(0)) === true. Actual: ' + (Boolean(new Number(0))));
}
// CHECK#11
if (Boolean(new Number()) !== true) {
$ERROR('#11: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number())));
throw new Test262Error('#11: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number())));
}
// CHECK#12
if (Boolean(new Number(Number.NaN)) !== true) {
$ERROR('#12: Boolean(new Number(Number.NaN)) === true. Actual: ' + (Boolean(new Number(Number.NaN))));
throw new Test262Error('#12: Boolean(new Number(Number.NaN)) === true. Actual: ' + (Boolean(new Number(Number.NaN))));
}
// CHECK#13
if (Boolean(new Number(-1)) !== true) {
$ERROR('#13: Boolean(new Number(-1)) === true. Actual: ' + (Boolean(new Number(-1))));
throw new Test262Error('#13: Boolean(new Number(-1)) === true. Actual: ' + (Boolean(new Number(-1))));
}
// CHECK#14
if (Boolean(new Number(1)) !== true) {
$ERROR('#14: Boolean(new Number(1)) === true. Actual: ' + (Boolean(new Number(1))));
throw new Test262Error('#14: Boolean(new Number(1)) === true. Actual: ' + (Boolean(new Number(1))));
}
// CHECK#15
if (Boolean(new Number(Number.POSITIVE_INFINITY)) !== true) {
$ERROR('#15: Boolean(new Number(Number.POSITIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.POSITIVE_INFINITY))));
throw new Test262Error('#15: Boolean(new Number(Number.POSITIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.POSITIVE_INFINITY))));
}
// CHECK#16
if (Boolean(new Number(Number.NEGATIVE_INFINITY)) !== true) {
$ERROR('#16: Boolean(new Number(Number.NEGATIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.NEGATIVE_INFINITY))));
throw new Test262Error('#16: Boolean(new Number(Number.NEGATIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.NEGATIVE_INFINITY))));
}
// CHECK#17
if (Boolean(new Function()) !== true) {
$ERROR('#17: Boolean(new Function()) === true. Actual: ' + (Boolean(new Function())));
throw new Test262Error('#17: Boolean(new Function()) === true. Actual: ' + (Boolean(new Function())));
}
// CHECK#18
if (Boolean(new Date()) !== true) {
$ERROR('#18: Boolean(new Date()) === true. Actual: ' + (Boolean(new Date())));
throw new Test262Error('#18: Boolean(new Date()) === true. Actual: ' + (Boolean(new Date())));
}
// CHECK#19
if (Boolean(new Date(0)) !== true) {
$ERROR('#19: Boolean(new Date(0)) === true. Actual: ' + (Boolean(new Date(0))));
throw new Test262Error('#19: Boolean(new Date(0)) === true. Actual: ' + (Boolean(new Date(0))));
}

View File

@ -11,16 +11,16 @@ description: Checking Boolean.prototype property
//CHECK#1
if (typeof Boolean.prototype !== "object") {
$ERROR('#1: typeof Boolean.prototype === "object"');
throw new Test262Error('#1: typeof Boolean.prototype === "object"');
}
//CHECK#2
if (Boolean.prototype != false) {
$ERROR('#2: Boolean.prototype == false');
throw new Test262Error('#2: Boolean.prototype == false');
}
delete Boolean.prototype.toString;
if (Boolean.prototype.toString() !== "[object Boolean]") {
$ERROR('#3: The [[Class]] property of the Boolean prototype object is set to "Boolean"');
throw new Test262Error('#3: The [[Class]] property of the Boolean prototype object is set to "Boolean"');
}

View File

@ -12,5 +12,5 @@ includes: [propertyHelper.js]
var x = Boolean.prototype;
verifyNotWritable(Boolean, "prototype", null, 1);
if (Boolean.prototype !== x) {
$ERROR('#1: Boolean.prototype has the attribute ReadOnly');
throw new Test262Error('#1: Boolean.prototype has the attribute ReadOnly');
}

View File

@ -13,7 +13,7 @@ verifyNotConfigurable(Boolean, "prototype");
try {
if (delete Boolean.prototype !== false) {
$ERROR('#1: Boolean.prototype has the attribute DontDelete');
throw new Test262Error('#1: Boolean.prototype has the attribute DontDelete');
}
} catch (e) {
if (e instanceof Test262Error) throw e;

View File

@ -10,10 +10,10 @@ description: Checking if enumerating the Boolean.prototype property fails
//CHECK#1
for (x in Boolean) {
if (x === "prototype") {
$ERROR('#1: Boolean.prototype has the attribute DontEnum');
throw new Test262Error('#1: Boolean.prototype has the attribute DontEnum');
}
}
if (Boolean.propertyIsEnumerable('prototype')) {
$ERROR('#2: Boolean.prototype has the attribute DontEnum');
throw new Test262Error('#2: Boolean.prototype has the attribute DontEnum');
}

View File

@ -11,16 +11,16 @@ description: Checking type and value of Boolean.prototype
//CHECK#1
if (typeof Boolean.prototype !== "object") {
$ERROR('#1: typeof Boolean.prototype === "object"');
throw new Test262Error('#1: typeof Boolean.prototype === "object"');
}
//CHECK#2
if (Boolean.prototype != false) {
$ERROR('#2: Boolean.prototype == false');
throw new Test262Error('#2: Boolean.prototype == false');
}
delete Boolean.prototype.toString;
if (Boolean.prototype.toString() !== "[object Boolean]") {
$ERROR('#3: The [[Class]] property of the Boolean prototype object is set to "Boolean"');
throw new Test262Error('#3: The [[Class]] property of the Boolean prototype object is set to "Boolean"');
}

View File

@ -11,5 +11,5 @@ description: Checking Object.prototype.isPrototypeOf(Boolean.prototype)
//CHECK#1
if (!Object.prototype.isPrototypeOf(Boolean.prototype)) {
$ERROR('#1: Object prototype object is the prototype of Boolean prototype object');
throw new Test262Error('#1: Object prototype object is the prototype of Boolean prototype object');
}

View File

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

View File

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

View File

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

View File

@ -16,11 +16,11 @@ try {
var s1 = new String();
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -29,10 +29,10 @@ try {
var s2 = new String();
s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -16,11 +16,11 @@ try {
var s1 = new Number();
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -29,10 +29,10 @@ try {
var s2 = new Number();
s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -16,11 +16,11 @@ try {
var s1 = new Date();
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -29,10 +29,10 @@ try {
var s2 = new Date();
s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -16,11 +16,11 @@ try {
var s1 = new Object();
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -29,10 +29,10 @@ try {
var s2 = new Object();
s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -18,11 +18,11 @@ try {
};
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -33,10 +33,10 @@ try {
};
s2.myToString = Boolean.prototype.toString;
var v2 = s2.myToString();
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.toString on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

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

View File

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

View File

@ -15,11 +15,11 @@ try {
var s1 = new String();
s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -28,10 +28,10 @@ try {
var s2 = new String();
s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -15,11 +15,11 @@ try {
var s1 = new Number();
s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -28,10 +28,10 @@ try {
var s2 = new Number();
s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -15,11 +15,11 @@ try {
var s1 = new Date();
s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -28,10 +28,10 @@ try {
var s2 = new Date();
s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -15,11 +15,11 @@ try {
var s1 = new Object();
s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -28,10 +28,10 @@ try {
var s2 = new Object();
s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}

View File

@ -17,11 +17,11 @@ try {
};
s1.valueOf = Boolean.prototype.valueOf;
var v1 = s1.valueOf();
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#1: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}
@ -32,10 +32,10 @@ try {
};
s2.myValueOf = Boolean.prototype.valueOf;
var v2 = s2.myValueOf();
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError');
}
catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
throw new Test262Error('#2: Boolean.prototype.valueOf on not a Boolean object should throw TypeError, not ' + e);
}
}