chore: migrate $ERROR -> throw new Test262Error in test/language/e* (#3098)

This commit is contained in:
Rick Waldron 2021-07-28 16:48:39 -04:00 committed by GitHub
parent e5ab3a572e
commit 64a4b76c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1285 changed files with 12145 additions and 12141 deletions

View File

@ -11,5 +11,5 @@ description: Block statement
//CHECK#1
if (eval("{}") !== undefined) {
$ERROR('#1: eval("{}") === undefined. Actual: ' + (eval("{}")));
throw new Test262Error('#1: eval("{}") === undefined. Actual: ' + (eval("{}")));
}

View File

@ -11,5 +11,5 @@ description: do-while statement
//CHECK#1
if (eval("do ; while(false)") !== undefined) {
$ERROR('#1: eval("do ; while(false)") === undefined. Actual: ' + (eval("do ; while(false)")));
throw new Test262Error('#1: eval("do ; while(false)") === undefined. Actual: ' + (eval("do ; while(false)")));
}

View File

@ -11,5 +11,5 @@ description: Empty statement
//CHECK#1
if (eval(";") !== undefined) {
$ERROR('#1: eval(";") === undefined. Actual: ' + (eval(";")));
throw new Test262Error('#1: eval(";") === undefined. Actual: ' + (eval(";")));
}

View File

@ -11,5 +11,5 @@ description: for statement
//CHECK#1
if (eval("for(false;false;false);") !== undefined) {
$ERROR('#1: eval("for(false;false;false);") === undefined. Actual: ' + (eval("for(false;false;false);")));
throw new Test262Error('#1: eval("for(false;false;false);") === undefined. Actual: ' + (eval("for(false;false;false);")));
}

View File

@ -11,5 +11,5 @@ description: If statement
//CHECK#1
if (eval("if (false) ;") !== undefined) {
$ERROR('#1: eval("if (false) ;") === undefined. Actual: ' + eval("if (false) ;"));
throw new Test262Error('#1: eval("if (false) ;") === undefined. Actual: ' + eval("if (false) ;"));
}

View File

@ -11,5 +11,5 @@ description: Switch statement
//CHECK#1
if (eval("switch(1){}") !== undefined) {
$ERROR('#1: eval("switch(1){}") === undefined. Actual: ' + (eval("switch(1){}")));
throw new Test262Error('#1: eval("switch(1){}") === undefined. Actual: ' + (eval("switch(1){}")));
}

View File

@ -11,5 +11,5 @@ description: Var statement
//CHECK#1
if (eval("var x = 1") !== undefined) {
$ERROR('#1: eval("var x = 1") === undefined. Actual: ' + (eval("var x = 1")));
throw new Test262Error('#1: eval("var x = 1") === undefined. Actual: ' + (eval("var x = 1")));
}

View File

@ -11,5 +11,5 @@ description: do-while statement
//CHECK#1
if (eval("while(false);") !== undefined) {
$ERROR('#1: eval("while(false);") === undefined. Actual: ' + (eval("while(false);")));
throw new Test262Error('#1: eval("while(false);") === undefined. Actual: ' + (eval("while(false);")));
}

View File

@ -13,11 +13,11 @@ description: Expression statement. Eval return object value
var x = {};
var y;
if (eval("y = x") !== x) {
$ERROR('#1: var x = {}; eval("y = x") === x. Actual: ' + (eval("y = x")));
throw new Test262Error('#1: var x = {}; eval("y = x") === x. Actual: ' + (eval("y = x")));
}
//CHECK#2
if (eval("x") !== x) {
$ERROR('#2: var x = {}; eval("x") === x. Actual: ' + (eval("x")));
throw new Test262Error('#2: var x = {}; eval("x") === x. Actual: ' + (eval("x")));
}

View File

@ -12,21 +12,21 @@ description: Expression statement. Eval return primitive value
var x;
//CHECK#1
if (eval("x = 1") !== 1) {
$ERROR('#1: eval("x = 1") === 1. Actual: ' + (eval("x = 1")));
throw new Test262Error('#1: eval("x = 1") === 1. Actual: ' + (eval("x = 1")));
}
//CHECK#2
if (eval("1") !== 1) {
$ERROR('#2: eval("1") === 1. Actual: ' + (eval("1")));
throw new Test262Error('#2: eval("1") === 1. Actual: ' + (eval("1")));
}
//CHECK#3
if (eval("'1'") !== '1') {
$ERROR('#3: eval("\'1\'") === \'1\'. Actual: ' + (eval("'1'")));
throw new Test262Error('#3: eval("\'1\'") === \'1\'. Actual: ' + (eval("'1'")));
}
//CHECK#4
x = 1;
if (eval("++x") !== 2) {
$ERROR('#4: x = 1; eval("++x") === 2. Actual: ' + (x));
throw new Test262Error('#4: x = 1; eval("++x") === 2. Actual: ' + (x));
}

View File

@ -12,9 +12,9 @@ description: Throw statement
//CHECK#1
try {
eval("throw 1;");
$ERROR('#1.1: throw 1 must throw SyntaxError. Actual: ' + (eval("throw 1;")));
throw new Test262Error('#1.1: throw 1 must throw SyntaxError. Actual: ' + (eval("throw 1;")));
} catch(e) {
if (e !== 1) {
$ERROR('#1.2: throw 1 must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#1.2: throw 1 must throw SyntaxError. Actual: ' + (e));
}
}

View File

@ -10,23 +10,23 @@ description: Checking all object
//CHECK#1
var x = {};
if (eval(x) !== x) {
$ERROR('#1: x = {}; eval(x) === x. Actual: ' + (eval(x)));
throw new Test262Error('#1: x = {}; eval(x) === x. Actual: ' + (eval(x)));
}
//CHECK#2
x = new Number(1);
if (eval(x) !== x) {
$ERROR('#2: x = new Number(1); eval(x) === x. Actual: ' + (eval(x)));
throw new Test262Error('#2: x = new Number(1); eval(x) === x. Actual: ' + (eval(x)));
}
//CHECK#3
x = new Boolean(true);
if (eval(x) !== x) {
$ERROR('#3: x = new Boolean(true); eval(x) === x. Actual: ' + (eval(x)));
throw new Test262Error('#3: x = new Boolean(true); eval(x) === x. Actual: ' + (eval(x)));
}
//CHECK#4
x = new String("1+1");
if (eval(x) !== x) {
$ERROR('#4: x = new String("1"); eval(x) === x. Actual: ' + (eval(x)));
throw new Test262Error('#4: x = new String("1"); eval(x) === x. Actual: ' + (eval(x)));
}

View File

@ -10,25 +10,25 @@ description: Checking all primitive
//CHECK#1
var x = 1;
if (eval(x) !== x) {
$ERROR('#1: x = 1; eval(x) === x. Actual: ' + (eval(x)));
throw new Test262Error('#1: x = 1; eval(x) === x. Actual: ' + (eval(x)));
}
//CHECK#2
if (eval(1) !== 1) {
$ERROR('#2: eval(1) === 1. Actual: ' + (eval(1)));
throw new Test262Error('#2: eval(1) === 1. Actual: ' + (eval(1)));
}
//CHECK#3
if (eval(true) !== true) {
$ERROR('#3: eval(true) === true. Actual: ' + (eval(true)));
throw new Test262Error('#3: eval(true) === true. Actual: ' + (eval(true)));
}
//CHECK#4
if (eval(null) !== null) {
$ERROR('#4: eval(null) === null. Actual: ' + (eval(null)));
throw new Test262Error('#4: eval(null) === null. Actual: ' + (eval(null)));
}
//CHECK#5
if (eval(undefined) !== undefined) {
$ERROR('#5: eval(undefined) === undefined. Actual: ' + (eval(undefined)));
throw new Test262Error('#5: eval(undefined) === undefined. Actual: ' + (eval(undefined)));
}

View File

@ -13,9 +13,9 @@ description: >
var x;
try {
eval("x = 1; x\u000A++");
$ERROR('#1.1: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (eval("x = 1; x\u000A++")));
throw new Test262Error('#1.1: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (eval("x = 1; x\u000A++")));
} catch (e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (e));
throw new Test262Error('#1.2: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (e));
}
}

View File

@ -12,10 +12,10 @@ description: Continue statement
//CHECK#1
try {
eval("continue;");
$ERROR('#1.1: continue must throw SyntaxError. Actual: ' + (eval("continue;")));
throw new Test262Error('#1.1: continue must throw SyntaxError. Actual: ' + (eval("continue;")));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: continue must throw SyntaxError. Actual ' + (e));
throw new Test262Error('#1.2: continue must throw SyntaxError. Actual ' + (e));
}
}
@ -26,9 +26,9 @@ try {
eval("continue;");
}
}
$ERROR('#2.1: continue must throw SyntaxError. Actual: ' + (eval("continue;")));
throw new Test262Error('#2.1: continue must throw SyntaxError. Actual: ' + (eval("continue;")));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#2.2: continue must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#2.2: continue must throw SyntaxError. Actual: ' + (e));
}
}

View File

@ -12,10 +12,10 @@ description: Break statement
//CHECK#1
try {
eval("break;");
$ERROR('#1.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
throw new Test262Error('#1.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: break must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#1.2: break must throw SyntaxError. Actual: ' + (e));
}
}
@ -26,9 +26,9 @@ try {
eval("break;");
}
}
$ERROR('#2.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
throw new Test262Error('#2.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#2.2: break must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#2.2: break must throw SyntaxError. Actual: ' + (e));
}
}

View File

@ -12,10 +12,10 @@ description: Return statement
//CHECK#1
try {
eval("return;");
$ERROR('#1.1: return must throw SyntaxError. Actual: ' + (eval("return;")));
throw new Test262Error('#1.1: return must throw SyntaxError. Actual: ' + (eval("return;")));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: return must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#1.2: return must throw SyntaxError. Actual: ' + (e));
}
}
@ -25,9 +25,9 @@ function f() { eval("return;"); };
try {
f();
$ERROR('#2.1: return must throw SyntaxError. Actual: ' + (f()));
throw new Test262Error('#2.1: return must throw SyntaxError. Actual: ' + (f()));
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#2.2: return must throw SyntaxError. Actual: ' + (e));
throw new Test262Error('#2.2: return must throw SyntaxError. Actual: ' + (e));
}
}

View File

@ -16,7 +16,7 @@ assert.throws(SyntaxError, function() {
assert.throws(SyntaxError, function() {
for (var i = 0; i <= 1; i++) {
(0,eval)("continue;");
$ERROR("First iteration should not complete");
throw new Test262Error("First iteration should not complete");
}
$ERROR("Iteration should not complete");
throw new Test262Error("Iteration should not complete");
});

View File

@ -16,7 +16,7 @@ assert.throws(SyntaxError, function() {
assert.throws(SyntaxError, function() {
for (var i = 0; i <= 1; i++) {
(0,eval)("break;");
$ERROR("First iteration should not complete");
throw new Test262Error("First iteration should not complete");
}
$ERROR("Iteration should not complete");
throw new Test262Error("Iteration should not complete");
});

View File

@ -13,10 +13,10 @@ var value;
try {
value = (0,eval)("return;");
$ERROR('#1.1: return must throw SyntaxError. Actual: ' + value);
throw new Test262Error('#1.1: return must throw SyntaxError. Actual: ' + value);
} catch(e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: return must throw SyntaxError. Actual: ' + e);
throw new Test262Error('#1.2: return must throw SyntaxError. Actual: ' + e);
}
}

View File

@ -11,6 +11,6 @@ description: >
if (!('foo' in this)) {
(1,eval)('"use strict"; var foo = 88;');
if ('foo' in this) {
$ERROR("Strict indirect eval leaked a top level declaration");
throw new Test262Error("Strict indirect eval leaked a top level declaration");
}
}

View File

@ -11,50 +11,50 @@ description: Checking by using eval
//CHECK#1
if (eval("1\u0009+\u00091") !== 2) {
$ERROR('#1: 1\\u0009+\\u00091 === 2');
throw new Test262Error('#1: 1\\u0009+\\u00091 === 2');
}
//CHECK#2
if (eval("1\u000B+\u000B1") !== 2) {
$ERROR('#2: 1\\u000B+\\u000B1 === 2');
throw new Test262Error('#2: 1\\u000B+\\u000B1 === 2');
}
//CHECK#3
if (eval("1\u000C+\u000C1") !== 2) {
$ERROR('#3: 1\\u000C+\\u000C1 === 2');
throw new Test262Error('#3: 1\\u000C+\\u000C1 === 2');
}
//CHECK#4
if (eval("1\u0020+\u00201") !== 2) {
$ERROR('#4: 1\\u0020+\\u00201 === 2');
throw new Test262Error('#4: 1\\u0020+\\u00201 === 2');
}
//CHECK#5
if (eval("1\u00A0+\u00A01") !== 2) {
$ERROR('#5: 1\\u00A0+\\u00A01 === 2');
throw new Test262Error('#5: 1\\u00A0+\\u00A01 === 2');
}
//CHECK#6
if (eval("1\u000A+\u000A1") !== 2) {
$ERROR('#6: 1\\u000A+\\u000A1 === 2');
throw new Test262Error('#6: 1\\u000A+\\u000A1 === 2');
}
//CHECK#7
if (eval("1\u000D+\u000D1") !== 2) {
$ERROR('#7: 1\\u000D+\\u000D1 === 2');
throw new Test262Error('#7: 1\\u000D+\\u000D1 === 2');
}
//CHECK#8
if (eval("1\u2028+\u20281") !== 2) {
$ERROR('#8: 1\\u2028+\\u20281 === 2');
throw new Test262Error('#8: 1\\u2028+\\u20281 === 2');
}
//CHECK#9
if (eval("1\u2029+\u20291") !== 2) {
$ERROR('#9: 1\\u2029+\\u20291 === 2');
throw new Test262Error('#9: 1\\u2029+\\u20291 === 2');
}
//CHECK#10
if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029+\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== 2) {
$ERROR('#10: 1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029+\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291 === 2');
throw new Test262Error('#10: 1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029+\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291 === 2');
}

View File

@ -9,26 +9,26 @@ description: Either Type is not Reference or GetBase is not null
//CHECK#1
if (1 + 1 !== 2) {
$ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
throw new Test262Error('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
}
//CHECK#2
var x = 1;
if (x + 1 !== 2) {
$ERROR('#2: var x = 1; x + 1 === 2. Actual: ' + (x + 1));
throw new Test262Error('#2: var x = 1; x + 1 === 2. Actual: ' + (x + 1));
}
//CHECK#3
var y = 1;
if (1 + y !== 2) {
$ERROR('#3: var y = 1; 1 + y === 2. Actual: ' + (1 + y));
throw new Test262Error('#3: var y = 1; 1 + y === 2. Actual: ' + (1 + y));
}
//CHECK#4
var x = 1;
var y = 1;
if (x + y !== 2) {
$ERROR('#4: var x = 1; var y = 1; x + y === 2. Actual: ' + (x + y));
throw new Test262Error('#4: var x = 1; var y = 1; x + y === 2. Actual: ' + (x + y));
}
//CHECK#5
@ -37,5 +37,5 @@ var objecty = new Object();
objectx.prop = 1;
objecty.prop = 1;
if (objectx.prop + objecty.prop !== 2) {
$ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop + objecty.prop === 2. Actual: ' + (objectx.prop + objecty.prop));
throw new Test262Error('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop + objecty.prop === 2. Actual: ' + (objectx.prop + objecty.prop));
}

View File

@ -10,10 +10,10 @@ description: If GetBase(x) is null, throw ReferenceError
//CHECK#1
try {
x + 1;
$ERROR('#1.1: x + 1 throw ReferenceError. Actual: ' + (x + 1));
throw new Test262Error('#1.1: x + 1 throw ReferenceError. Actual: ' + (x + 1));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x + 1 throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x + 1 throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -10,10 +10,10 @@ description: If GetBase(y) is null, throw ReferenceError
//CHECK#1
try {
1 + y;
$ERROR('#1.1: 1 + y throw ReferenceError. Actual: ' + (1 + y));
throw new Test262Error('#1.1: 1 + y throw ReferenceError. Actual: ' + (1 + y));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: 1 + y throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: 1 + y throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -9,61 +9,61 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
//CHECK#1
if ({valueOf: function() {return 1}} + 1 !== 2) {
$ERROR('#1: {valueOf: function() {return 1}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}} + 1));
throw new Test262Error('#1: {valueOf: function() {return 1}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}} + 1));
}
//CHECK#2
if ({valueOf: function() {return 1}, toString: function() {return 0}} + 1 !== 2) {
$ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} + 1));
throw new Test262Error('#2: {valueOf: function() {return 1}, toString: function() {return 0}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} + 1));
}
//CHECK#3
if ({valueOf: function() {return 1}, toString: function() {return {}}} + 1 !== 2) {
$ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} + 1));
throw new Test262Error('#3: {valueOf: function() {return 1}, toString: function() {return {}}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} + 1));
}
//CHECK#4
try {
if ({valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 !== 2) {
$ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} + 1));
throw new Test262Error('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} + 1));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw "error"');
throw new Test262Error('#4.2: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw "error"');
} else {
$ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw Error. Actual: ' + (e));
}
}
//CHECK#5
if (1 + {toString: function() {return 1}} !== 2) {
$ERROR('#5: 1 + {toString: function() {return 1}} === 2. Actual: ' + (1 + {toString: function() {return 1}}));
throw new Test262Error('#5: 1 + {toString: function() {return 1}} === 2. Actual: ' + (1 + {toString: function() {return 1}}));
}
//CHECK#6
if (1 + {valueOf: function() {return {}}, toString: function() {return 1}} !== 2) {
$ERROR('#6: 1 + {valueOf: function() {return {}}, toString: function() {return 1}} === 2. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return 1}}));
throw new Test262Error('#6: 1 + {valueOf: function() {return {}}, toString: function() {return 1}} === 2. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return 1}}));
}
//CHECK#7
try {
1 + {valueOf: function() {throw "error"}, toString: function() {return 1}};
$ERROR('#7.1: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 + {valueOf: function() {throw "error"}, toString: function() {return 1}}));
throw new Test262Error('#7.1: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 + {valueOf: function() {throw "error"}, toString: function() {return 1}}));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e));
}
}
//CHECK#8
try {
1 + {valueOf: function() {return {}}, toString: function() {return {}}};
$ERROR('#8.1: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return {}}}));
throw new Test262Error('#8.1: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return {}}}));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));
}
}

View File

@ -10,23 +10,23 @@ description: If Type(value) is Date object, evaluate ToPrimitive(value, String)
//CHECK#1
var date = new Date();
if (date + date !== date.toString() + date.toString()) {
$ERROR('#1: var date = new Date(); date + date === date.toString() + date.toString(). Actual: ' + (date + date));
throw new Test262Error('#1: var date = new Date(); date + date === date.toString() + date.toString(). Actual: ' + (date + date));
}
//CHECK#2
var date = new Date();
if (date + 0 !== date.toString() + "0") {
$ERROR('#2: var date = new Date(); date + 0 === date.toString() + "0". Actual: ' + (date + 0));
throw new Test262Error('#2: var date = new Date(); date + 0 === date.toString() + "0". Actual: ' + (date + 0));
}
//CHECK#3
var date = new Date();
if (date + true !== date.toString() + "true") {
$ERROR('#3: var date = new Date(); date + true === date.toString() + "true". Actual: ' + (date + true));
throw new Test262Error('#3: var date = new Date(); date + true === date.toString() + "true". Actual: ' + (date + true));
}
//CHECK#4
var date = new Date();
if (date + new Object() !== date.toString() + "[object Object]") {
$ERROR('#4: var date = new Date(); date + new Object() === date.toString() + "[object Object]". Actual: ' + (date + new Object()));
throw new Test262Error('#4: var date = new Date(); date + new Object() === date.toString() + "[object Object]". Actual: ' + (date + new Object()));
}

View File

@ -12,7 +12,7 @@ function f1(){
return 0;
}
if (f1 + 1 !== f1.toString() + 1) {
$ERROR('#1: function f1() {return 0;}; f1 + 1 === f1.toString() + 1');
throw new Test262Error('#1: function f1() {return 0;}; f1 + 1 === f1.toString() + 1');
}
//CHECK#2
@ -21,7 +21,7 @@ function f2(){
}
f2.valueOf = function() {return 1;};
if (1 + f2 !== 1 + 1) {
$ERROR('#2: f1unction f2() {return 0;} f2.valueOf = function() {return 1;}; 1 + f2 === 1 + 1. Actual: ' + (1 + f2));
throw new Test262Error('#2: f1unction f2() {return 0;} f2.valueOf = function() {return 1;}; 1 + f2 === 1 + 1. Actual: ' + (1 + f2));
}
//CHECK#3
@ -30,7 +30,7 @@ function f3(){
}
f3.toString = function() {return 1;};
if (1 + f3 !== 1 + 1) {
$ERROR('#3: f1unction f3() {return 0;} f3.toString() = function() {return 1;}; 1 + f3 === 1 + 1. Actual: ' + (1 + f3));
throw new Test262Error('#3: f1unction f3() {return 0;} f3.toString() = function() {return 1;}; 1 + f3 === 1 + 1. Actual: ' + (1 + f3));
}
//CHECK#4
@ -40,5 +40,5 @@ function f4(){
f4.valueOf = function() {return -1;};
f4.toString = function() {return 1;};
if (f4 + 1 !== 1 - 1) {
$ERROR('#4: f1unction f4() {return 0;}; f2.valueOf = function() {return -1;}; f4.toString() = function() {return 1;}; f4 + 1 === 1 - 1. Actual: ' + (f4 + 1));
throw new Test262Error('#4: f1unction f4() {return 0;}; f2.valueOf = function() {return -1;}; f4.toString() = function() {return 1;}; f4 + 1 === 1 - 1. Actual: ' + (f4 + 1));
}

View File

@ -14,13 +14,13 @@ var x = { valueOf: function () { throw "x"; } };
var y = { valueOf: function () { throw "y"; } };
try {
x + y;
$ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (x + y));
throw new Test262Error('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (x + y));
} catch (e) {
if (e === "y") {
$ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');
throw new Test262Error('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');
} else {
if (e !== "x") {
$ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (e));
throw new Test262Error('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (e));
}
}
}

View File

@ -10,11 +10,11 @@ description: Checking with "="
//CHECK#1
var x = 0;
if ((x = 1) + x !== 2) {
$ERROR('#1: var x = 0; (x = 1) + x === 2. Actual: ' + ((x = 1) + x));
throw new Test262Error('#1: var x = 0; (x = 1) + x === 2. Actual: ' + ((x = 1) + x));
}
//CHECK#2
var x = 0;
if (x + (x = 1) !== 1) {
$ERROR('#2: var x = 0; x + (x = 1) === 1. Actual: ' + (x + (x = 1)));
throw new Test262Error('#2: var x = 0; x + (x = 1) === 1. Actual: ' + (x + (x = 1)));
}

View File

@ -12,13 +12,13 @@ var x = function () { throw "x"; };
var y = function () { throw "y"; };
try {
x() + y();
$ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (x() + y()));
throw new Test262Error('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (x() + y()));
} catch (e) {
if (e === "y") {
$ERROR('#1.2: First expression is evaluated first, and then second expression');
throw new Test262Error('#1.2: First expression is evaluated first, and then second expression');
} else {
if (e !== "x") {
$ERROR('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (e));
throw new Test262Error('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (e));
}
}
}

View File

@ -10,10 +10,10 @@ description: Checking with undeclarated variables
//CHECK#1
try {
x + (x = 1);
$ERROR('#1.1: x + (x = 1) throw ReferenceError. Actual: ' + (x + (x = 1)));
throw new Test262Error('#1.1: x + (x = 1) throw ReferenceError. Actual: ' + (x + (x = 1)));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -10,5 +10,5 @@ flags: [noStrict]
//CHECK#1
if ((y = 1) + y !== 2) {
$ERROR('#1: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));
throw new Test262Error('#1: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (true + true !== 2) {
$ERROR('#1: true + true === 2. Actual: ' + (true + true));
throw new Test262Error('#1: true + true === 2. Actual: ' + (true + true));
}
//CHECK#2
if (new Boolean(true) + true !== 2) {
$ERROR('#2: new Boolean(true) + true === 2. Actual: ' + (new Boolean(true) + true));
throw new Test262Error('#2: new Boolean(true) + true === 2. Actual: ' + (new Boolean(true) + true));
}
//CHECK#3
if (true + new Boolean(true) !== 2) {
$ERROR('#3: true + new Boolean(true) === 2. Actual: ' + (true + new Boolean(true)));
throw new Test262Error('#3: true + new Boolean(true) === 2. Actual: ' + (true + new Boolean(true)));
}
//CHECK#4
if (new Boolean(true) + new Boolean(true) !== 2) {
$ERROR('#4: new Boolean(true) + new Boolean(true) === 2. Actual: ' + (new Boolean(true) + new Boolean(true)));
throw new Test262Error('#4: new Boolean(true) + new Boolean(true) === 2. Actual: ' + (new Boolean(true) + new Boolean(true)));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (1 + 1 !== 2) {
$ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
throw new Test262Error('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
}
//CHECK#2
if (new Number(1) + 1 !== 2) {
$ERROR('#2: new Number(1) + 1 === 2. Actual: ' + (new Number(1) + 1));
throw new Test262Error('#2: new Number(1) + 1 === 2. Actual: ' + (new Number(1) + 1));
}
//CHECK#3
if (1 + new Number(1) !== 2) {
$ERROR('#3: 1 + new Number(1) === 2. Actual: ' + (1 + new Number(1)));
throw new Test262Error('#3: 1 + new Number(1) === 2. Actual: ' + (1 + new Number(1)));
}
//CHECK#4
if (new Number(1) + new Number(1) !== 2) {
$ERROR('#4: new Number(1) + new Number(1) === 2. Actual: ' + (new Number(1) + new Number(1)));
throw new Test262Error('#4: new Number(1) + new Number(1) === 2. Actual: ' + (new Number(1) + new Number(1)));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (isNaN(null + undefined) !== true) {
$ERROR('#1: null + undefined === Not-a-Number. Actual: ' + (null + undefined));
throw new Test262Error('#1: null + undefined === Not-a-Number. Actual: ' + (null + undefined));
}
//CHECK#2
if (isNaN(undefined + null) !== true) {
$ERROR('#2: undefined + null === Not-a-Number. Actual: ' + (undefined + null));
throw new Test262Error('#2: undefined + null === Not-a-Number. Actual: ' + (undefined + null));
}
//CHECK#3
if (isNaN(undefined + undefined) !== true) {
$ERROR('#3: undefined + undefined === Not-a-Number. Actual: ' + (undefined + undefined));
throw new Test262Error('#3: undefined + undefined === Not-a-Number. Actual: ' + (undefined + undefined));
}
//CHECK#4
if (null + null !== 0) {
$ERROR('#4: null + null === 0. Actual: ' + (null + null));
throw new Test262Error('#4: null + null === 0. Actual: ' + (null + null));
}

View File

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

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (1 + null !== 1) {
$ERROR('#1: 1 + null === 1. Actual: ' + (1 + null));
throw new Test262Error('#1: 1 + null === 1. Actual: ' + (1 + null));
}
//CHECK#2
if (null + 1 !== 1) {
$ERROR('#2: null + 1 === 1. Actual: ' + (null + 1));
throw new Test262Error('#2: null + 1 === 1. Actual: ' + (null + 1));
}
//CHECK#3
if (new Number(1) + null !== 1) {
$ERROR('#3: new Number(1) + null === 1. Actual: ' + (new Number(1) + null));
throw new Test262Error('#3: new Number(1) + null === 1. Actual: ' + (new Number(1) + null));
}
//CHECK#4
if (null + new Number(1) !== 1) {
$ERROR('#4: null + new Number(1) === 1. Actual: ' + (null + new Number(1)));
throw new Test262Error('#4: null + new Number(1) === 1. Actual: ' + (null + new Number(1)));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (isNaN(1 + undefined) !== true) {
$ERROR('#1: 1 + undefined === Not-a-Number. Actual: ' + (1 + undefined));
throw new Test262Error('#1: 1 + undefined === Not-a-Number. Actual: ' + (1 + undefined));
}
//CHECK#2
if (isNaN(undefined + 1) !== true) {
$ERROR('#2: undefined + 1 === Not-a-Number. Actual: ' + (undefined + 1));
throw new Test262Error('#2: undefined + 1 === Not-a-Number. Actual: ' + (undefined + 1));
}
//CHECK#3
if (isNaN(new Number(1) + undefined) !== true) {
$ERROR('#3: new Number(1) + undefined === Not-a-Number. Actual: ' + (new Number(1) + undefined));
throw new Test262Error('#3: new Number(1) + undefined === Not-a-Number. Actual: ' + (new Number(1) + undefined));
}
//CHECK#4
if (isNaN(undefined + new Number(1)) !== true) {
$ERROR('#4: undefined + new Number(1) === Not-a-Number. Actual: ' + (undefined + new Number(1)));
throw new Test262Error('#4: undefined + new Number(1) === Not-a-Number. Actual: ' + (undefined + new Number(1)));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (isNaN(true + undefined) !== true) {
$ERROR('#1: true + undefined === Not-a-Number. Actual: ' + (true + undefined));
throw new Test262Error('#1: true + undefined === Not-a-Number. Actual: ' + (true + undefined));
}
//CHECK#2
if (isNaN(undefined + true) !== true) {
$ERROR('#2: undefined + true === Not-a-Number. Actual: ' + (undefined + true));
throw new Test262Error('#2: undefined + true === Not-a-Number. Actual: ' + (undefined + true));
}
//CHECK#3
if (isNaN(new Boolean(true) + undefined) !== true) {
$ERROR('#3: new Boolean(true) + undefined === Not-a-Number. Actual: ' + (new Boolean(true) + undefined));
throw new Test262Error('#3: new Boolean(true) + undefined === Not-a-Number. Actual: ' + (new Boolean(true) + undefined));
}
//CHECK#4
if (isNaN(undefined + new Boolean(true)) !== true) {
$ERROR('#4: undefined + new Boolean(true) === Not-a-Number. Actual: ' + (undefined + new Boolean(true)));
throw new Test262Error('#4: undefined + new Boolean(true) === Not-a-Number. Actual: ' + (undefined + new Boolean(true)));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (true + null !== 1) {
$ERROR('#1: true + null === 1. Actual: ' + (true + null));
throw new Test262Error('#1: true + null === 1. Actual: ' + (true + null));
}
//CHECK#2
if (null + true !== 1) {
$ERROR('#2: null + true === 1. Actual: ' + (null + true));
throw new Test262Error('#2: null + true === 1. Actual: ' + (null + true));
}
//CHECK#3
if (new Boolean(true) + null !== 1) {
$ERROR('#3: new Boolean(true) + null === 1. Actual: ' + (new Boolean(true) + null));
throw new Test262Error('#3: new Boolean(true) + null === 1. Actual: ' + (new Boolean(true) + null));
}
//CHECK#4
if (null + new Boolean(true) !== 1) {
$ERROR('#4: null + new Boolean(true) === 1. Actual: ' + (null + new Boolean(true)));
throw new Test262Error('#4: null + new Boolean(true) === 1. Actual: ' + (null + new Boolean(true)));
}

View File

@ -14,30 +14,30 @@ description: >
//CHECK#1
if ("1" + "1" !== "11") {
$ERROR('#1: "1" + "1" === "11". Actual: ' + ("1" + "1"));
throw new Test262Error('#1: "1" + "1" === "11". Actual: ' + ("1" + "1"));
}
//CHECK#2
if (new String("1") + "1" !== "11") {
$ERROR('#2: new String("1") + "1" === "11". Actual: ' + (new String("1") + "1"));
throw new Test262Error('#2: new String("1") + "1" === "11". Actual: ' + (new String("1") + "1"));
}
//CHECK#3
if ("1" + new String("1") !== "11") {
$ERROR('#3: "1" + new String("1") === "11". Actual: ' + ("1" + new String("1")));
throw new Test262Error('#3: "1" + new String("1") === "11". Actual: ' + ("1" + new String("1")));
}
//CHECK#4
if (new String("1") + new String("1") !== "11") {
$ERROR('#4: new String("1") + new String("1") === "11". Actual: ' + (new String("1") + new String("1")));
throw new Test262Error('#4: new String("1") + new String("1") === "11". Actual: ' + (new String("1") + new String("1")));
}
//CHECK#5
if ("x" + "1" !=="x1") {
$ERROR('#5: "x" + "1" === "x1". Actual: ' + ("x" + "1"));
throw new Test262Error('#5: "x" + "1" === "x1". Actual: ' + ("x" + "1"));
}
//CHECK#6
if ("1" + "x" !== "1x") {
$ERROR('#6: "1" + "x" === "1x". Actual: ' + ("1" + "x"));
throw new Test262Error('#6: "1" + "x" === "1x". Actual: ' + ("1" + "x"));
}

View File

@ -14,20 +14,20 @@ description: >
//CHECK#1
if (({} + function(){return 1}) !== ({}.toString() + function(){return 1}.toString())) {
$ERROR('#1: ({} + function(){return 1}) === ({}.toString() + function(){return 1}.toString()). Actual: ' + (({} + function(){return 1})));
throw new Test262Error('#1: ({} + function(){return 1}) === ({}.toString() + function(){return 1}.toString()). Actual: ' + (({} + function(){return 1})));
}
//CHECK#2
if ((function(){return 1} + {}) !== (function(){return 1}.toString() + {}.toString())) {
$ERROR('#2: (function(){return 1} + {}) === (function(){return 1}.toString() + {}.toString()). Actual: ' + ((function(){return 1} + {})));
throw new Test262Error('#2: (function(){return 1} + {}) === (function(){return 1}.toString() + {}.toString()). Actual: ' + ((function(){return 1} + {})));
}
//CHECK#3
if ((function(){return 1} + function(){return 1}) !== (function(){return 1}.toString() + function(){return 1}.toString())) {
$ERROR('#3: (function(){return 1} + function(){return 1}) === (function(){return 1}.toString() + function(){return 1}.toString()). Actual: ' + ((function(){return 1} + function(){return 1})));
throw new Test262Error('#3: (function(){return 1} + function(){return 1}) === (function(){return 1}.toString() + function(){return 1}.toString()). Actual: ' + ((function(){return 1} + function(){return 1})));
}
//CHECK#4
if (({} + {}) !== ({}.toString() + {}.toString())) {
$ERROR('#4: ({} + {}) === ({}.toString() + {}.toString()). Actual: ' + (({} + {})));
throw new Test262Error('#4: ({} + {}) === ({}.toString() + {}.toString()). Actual: ' + (({} + {})));
}

View File

@ -15,50 +15,50 @@ description: >
//CHECK#1
if ("1" + 1 !== "11") {
$ERROR('#1: "1" + 1 === "11". Actual: ' + ("1" + 1));
throw new Test262Error('#1: "1" + 1 === "11". Actual: ' + ("1" + 1));
}
//CHECK#2
if (1 + "1" !== "11") {
$ERROR('#2: 1 + "1" === "11". Actual: ' + (1 + "1"));
throw new Test262Error('#2: 1 + "1" === "11". Actual: ' + (1 + "1"));
}
//CHECK#3
if (new String("1") + 1 !== "11") {
$ERROR('#3: new String("1") + 1 === "11". Actual: ' + (new String("1") + 1));
throw new Test262Error('#3: new String("1") + 1 === "11". Actual: ' + (new String("1") + 1));
}
//CHECK#4
if (1 + new String("1") !== "11") {
$ERROR('#4: 1 + new String("1") === "11". Actual: ' + (1 + new String("1")));
throw new Test262Error('#4: 1 + new String("1") === "11". Actual: ' + (1 + new String("1")));
}
//CHECK#5
if ("1" + new Number(1) !== "11") {
$ERROR('#5: "1" + new Number(1) === "11". Actual: ' + ("1" + new Number(1)));
throw new Test262Error('#5: "1" + new Number(1) === "11". Actual: ' + ("1" + new Number(1)));
}
//CHECK#6
if (new Number(1) + "1" !== "11") {
$ERROR('#6: new Number(1) + "1" === "11". Actual: ' + (new Number(1) + "1"));
throw new Test262Error('#6: new Number(1) + "1" === "11". Actual: ' + (new Number(1) + "1"));
}
//CHECK#7
if (new String("1") + new Number(1) !== "11") {
$ERROR('#7: new String("1") + new Number(1) === "11". Actual: ' + (new String("1") + new Number(1)));
throw new Test262Error('#7: new String("1") + new Number(1) === "11". Actual: ' + (new String("1") + new Number(1)));
}
//CHECK#8
if (new Number(1) + new String("1") !== "11") {
$ERROR('#8: new Number(1) + new String("1") === "11". Actual: ' + (new Number(1) + new String("1")));
throw new Test262Error('#8: new Number(1) + new String("1") === "11". Actual: ' + (new Number(1) + new String("1")));
}
//CHECK#9
if ("x" + 1 !=="x1") {
$ERROR('#9: "x" + 1 === "x1". Actual: ' + ("x" + 1));
throw new Test262Error('#9: "x" + 1 === "x1". Actual: ' + ("x" + 1));
}
//CHECK#10
if (1 + "x" !== "1x") {
$ERROR('#10: 1 + "x" === "1x". Actual: ' + (1 + "x"));
throw new Test262Error('#10: 1 + "x" === "1x". Actual: ' + (1 + "x"));
}

View File

@ -15,40 +15,40 @@ description: >
//CHECK#1
if (true + "1" !== "true1") {
$ERROR('#1: true + "1" === "true1". Actual: ' + (true + "1"));
throw new Test262Error('#1: true + "1" === "true1". Actual: ' + (true + "1"));
}
//CHECK#2
if ("1" + true !== "1true") {
$ERROR('#2: "1" + true === "1true". Actual: ' + ("1" + true));
throw new Test262Error('#2: "1" + true === "1true". Actual: ' + ("1" + true));
}
//CHECK#3
if (new Boolean(true) + "1" !== "true1") {
$ERROR('#3: new Boolean(true) + "1" === "true1". Actual: ' + (new Boolean(true) + "1"));
throw new Test262Error('#3: new Boolean(true) + "1" === "true1". Actual: ' + (new Boolean(true) + "1"));
}
//CHECK#4
if ("1" + new Boolean(true) !== "1true") {
$ERROR('#4: "1" + new Boolean(true) === "1true". Actual: ' + ("1" + new Boolean(true)));
throw new Test262Error('#4: "1" + new Boolean(true) === "1true". Actual: ' + ("1" + new Boolean(true)));
}
//CHECK#5
if (true + new String("1") !== "true1") {
$ERROR('#5: true + new String("1") === "true1". Actual: ' + (true + new String("1")));
throw new Test262Error('#5: true + new String("1") === "true1". Actual: ' + (true + new String("1")));
}
//CHECK#6
if (new String("1") + true !== "1true") {
$ERROR('#6: new String("1") + true === "1true". Actual: ' + (new String("1") + true));
throw new Test262Error('#6: new String("1") + true === "1true". Actual: ' + (new String("1") + true));
}
//CHECK#7
if (new Boolean(true) + new String("1") !== "true1") {
$ERROR('#7: new Boolean(true) + new String("1") === "true1". Actual: ' + (new Boolean(true) + new String("1")));
throw new Test262Error('#7: new Boolean(true) + new String("1") === "true1". Actual: ' + (new Boolean(true) + new String("1")));
}
//CHECK#8
if (new String("1") + new Boolean(true) !== "1true") {
$ERROR('#8: new String("1") + new Boolean(true) === "1true". Actual: ' + (new String("1") + new Boolean(true)));
throw new Test262Error('#8: new String("1") + new Boolean(true) === "1true". Actual: ' + (new String("1") + new Boolean(true)));
}

View File

@ -14,20 +14,20 @@ description: >
//CHECK#1
if ("1" + undefined !== "1undefined") {
$ERROR('#1: "1" + undefined === "1undefined". Actual: ' + ("1" + undefined));
throw new Test262Error('#1: "1" + undefined === "1undefined". Actual: ' + ("1" + undefined));
}
//CHECK#2
if (undefined + "1" !== "undefined1") {
$ERROR('#2: undefined + "1" === "undefined1". Actual: ' + (undefined + "1"));
throw new Test262Error('#2: undefined + "1" === "undefined1". Actual: ' + (undefined + "1"));
}
//CHECK#3
if (new String("1") + undefined !== "1undefined") {
$ERROR('#3: new String("1") + undefined === "1undefined". Actual: ' + (new String("1") + undefined));
throw new Test262Error('#3: new String("1") + undefined === "1undefined". Actual: ' + (new String("1") + undefined));
}
//CHECK#4
if (undefined + new String("1") !== "undefined1") {
$ERROR('#4: undefined + new String("1") === "undefined1". Actual: ' + (undefined + new String("1")));
throw new Test262Error('#4: undefined + new String("1") === "undefined1". Actual: ' + (undefined + new String("1")));
}

View File

@ -14,20 +14,20 @@ description: >
//CHECK#1
if ("1" + null !== "1null") {
$ERROR('#1: "1" + null === "1null". Actual: ' + ("1" + null));
throw new Test262Error('#1: "1" + null === "1null". Actual: ' + ("1" + null));
}
//CHECK#2
if (null + "1" !== "null1") {
$ERROR('#2: null + "1" === "null1". Actual: ' + (null + "1"));
throw new Test262Error('#2: null + "1" === "null1". Actual: ' + (null + "1"));
}
//CHECK#3
if (new String("1") + null !== "1null") {
$ERROR('#3: new String("1") + null === "1null". Actual: ' + (new String("1") + null));
throw new Test262Error('#3: new String("1") + null === "1null". Actual: ' + (new String("1") + null));
}
//CHECK#4
if (null + new String("1") !== "null1") {
$ERROR('#4: null + new String("1") === "null1". Actual: ' + (null + new String("1")));
throw new Test262Error('#4: null + new String("1") === "null1". Actual: ' + (null + new String("1")));
}

View File

@ -11,30 +11,30 @@ description: If either operand is NaN, the result is NaN
//CHECK#1
if (isNaN(Number.NaN + 1) !== true ) {
$ERROR('#1: NaN + 1 === Not-a-Number. Actual: ' + (NaN + 1));
throw new Test262Error('#1: NaN + 1 === Not-a-Number. Actual: ' + (NaN + 1));
}
//CHECK#2
if (isNaN(1 + Number.NaN) !== true ) {
$ERROR('#2: 1 + NaN === Not-a-Number. Actual: ' + (1 + NaN));
throw new Test262Error('#2: 1 + NaN === Not-a-Number. Actual: ' + (1 + NaN));
}
//CHECK#3
if (isNaN(Number.NaN + Number.POSITIVE_INFINITY) !== true ) {
$ERROR('#3: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
throw new Test262Error('#3: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
}
//CHECK#4
if (isNaN(Number.POSITIVE_INFINITY + Number.NaN) !== true ) {
$ERROR('#4: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
throw new Test262Error('#4: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
}
//CHECK#5
if (isNaN(Number.NaN + Number.NEGATIVE_INFINITY) !== true ) {
$ERROR('#5: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
throw new Test262Error('#5: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
}
//CHECK#6
if (isNaN(Number.NEGATIVE_INFINITY + Number.NaN) !== true ) {
$ERROR('#6: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
throw new Test262Error('#6: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
}

View File

@ -11,10 +11,10 @@ description: The sum of two infinities of opposite sign is NaN
//CHECK#1
if (isNaN(Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY) !== true ) {
$ERROR('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity));
throw new Test262Error('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity));
}
//CHECK#2
if (isNaN(Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY) !== true ) {
$ERROR('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity));
throw new Test262Error('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity));
}

View File

@ -13,10 +13,10 @@ description: >
//CHECK#1
if (Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {
$ERROR('#1: Infinity + Infinity === Infinity. Actual: ' + (Infinity + Infinity));
throw new Test262Error('#1: Infinity + Infinity === Infinity. Actual: ' + (Infinity + Infinity));
}
//CHECK#2
if (Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {
$ERROR('#2: -Infinity + -Infinity === -Infinity. Actual: ' + (-Infinity + -Infinity));
throw new Test262Error('#2: -Infinity + -Infinity === -Infinity. Actual: ' + (-Infinity + -Infinity));
}

View File

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

View File

@ -13,36 +13,36 @@ description: >
//CHECK#1
if (-0 + -0 !== -0 ) {
$ERROR('#1.1: -0 + -0 === 0. Actual: ' + (-0 + -0));
throw new Test262Error('#1.1: -0 + -0 === 0. Actual: ' + (-0 + -0));
} else {
if (1 / (-0 + -0) !== Number.NEGATIVE_INFINITY) {
$ERROR('#1.1: -0 + -0 === - 0. Actual: +0');
throw new Test262Error('#1.1: -0 + -0 === - 0. Actual: +0');
}
}
//CHECK#2
if (0 + -0 !== 0 ) {
$ERROR('#2.1: 0 + -0 === 0. Actual: ' + (0 + -0));
throw new Test262Error('#2.1: 0 + -0 === 0. Actual: ' + (0 + -0));
} else {
if (1 / (0 + -0) !== Number.POSITIVE_INFINITY) {
$ERROR('#2.2: 0 + -0 === + 0. Actual: -0');
throw new Test262Error('#2.2: 0 + -0 === + 0. Actual: -0');
}
}
//CHECK#3
if (-0 + 0 !== 0 ) {
$ERROR('#3.1: -0 + 0 === 0. Actual: ' + (-0 + 0));
throw new Test262Error('#3.1: -0 + 0 === 0. Actual: ' + (-0 + 0));
} else {
if (1 / (-0 + 0) !== Number.POSITIVE_INFINITY) {
$ERROR('#3.2: -0 + 0 === + 0. Actual: -0');
throw new Test262Error('#3.2: -0 + 0 === + 0. Actual: -0');
}
}
//CHECK#4
if (0 + 0 !== 0 ) {
$ERROR('#4.1: 0 + 0 === 0. Actual: ' + (0 + 0));
throw new Test262Error('#4.1: 0 + 0 === 0. Actual: ' + (0 + 0));
} else {
if (1 / (0 + 0) !== Number.POSITIVE_INFINITY) {
$ERROR('#4.2: 0 + 0 === + 0. Actual: -0');
throw new Test262Error('#4.2: 0 + 0 === + 0. Actual: -0');
}
}

View File

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

View File

@ -13,27 +13,27 @@ description: >
//CHECK#1
if (-Number.MIN_VALUE + Number.MIN_VALUE !== +0) {
$ERROR('#1.1: -Number.MIN_VALUE + Number.MIN_VALUE === 0. Actual: ' + (-Number.MIN_VALUE + Number.MIN_VALUE));
throw new Test262Error('#1.1: -Number.MIN_VALUE + Number.MIN_VALUE === 0. Actual: ' + (-Number.MIN_VALUE + Number.MIN_VALUE));
} else {
if (1 / (-Number.MIN_VALUE + Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {
$ERROR('#1.2: -Number.MIN_VALUE + Number.MIN_VALUE === + 0. Actual: -0');
throw new Test262Error('#1.2: -Number.MIN_VALUE + Number.MIN_VALUE === + 0. Actual: -0');
}
}
//CHECK#2
if (-Number.MAX_VALUE + Number.MAX_VALUE !== +0) {
$ERROR('#2.1: -Number.MAX_VALUE + Number.MAX_VALUE === 0. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE));
throw new Test262Error('#2.1: -Number.MAX_VALUE + Number.MAX_VALUE === 0. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE));
} else {
if (1 / (-Number.MAX_VALUE + Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {
$ERROR('#2.2: -Number.MAX_VALUE + Number.MAX_VALUE === + 0. Actual: -0');
throw new Test262Error('#2.2: -Number.MAX_VALUE + Number.MAX_VALUE === + 0. Actual: -0');
}
}
//CHECK#3
if (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE !== +0) {
$ERROR('#3.1: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === 0. Actual: ' + (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE));
throw new Test262Error('#3.1: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === 0. Actual: ' + (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE));
} else {
if (1 / (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {
$ERROR('#3.2: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === + 0. Actual: -0');
throw new Test262Error('#3.2: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === + 0. Actual: -0');
}
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (Number.MAX_VALUE + Number.MAX_VALUE !== Number.POSITIVE_INFINITY) {
$ERROR('#1: Number.MAX_VALUE + Number.MAX_VALUE === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE + Number.MAX_VALUE));
throw new Test262Error('#1: Number.MAX_VALUE + Number.MAX_VALUE === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE + Number.MAX_VALUE));
}
//CHECK#2
if (-Number.MAX_VALUE - Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {
$ERROR('#2: -Number.MAX_VALUE - Number.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-Number.MAX_VALUE - Number.MAX_VALUE));
throw new Test262Error('#2: -Number.MAX_VALUE - Number.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-Number.MAX_VALUE - Number.MAX_VALUE));
}
//CHECK#3
if (1e+308 + 1e+308 !== Number.POSITIVE_INFINITY) {
$ERROR('#3: 1e+308 + 1e+308 === Number.POSITIVE_INFINITY. Actual: ' + (1e+308 + 1e+308));
throw new Test262Error('#3: 1e+308 + 1e+308 === Number.POSITIVE_INFINITY. Actual: ' + (1e+308 + 1e+308));
}
//CHECK#4
if (-8.99e+307 - 8.99e+307 !== Number.NEGATIVE_INFINITY) {
$ERROR('#4: -8.99e+307 - 8.99e+307 === Number.NEGATIVE_INFINITY. Actual: ' + (-8.99e+307 - 8.99e+307));
throw new Test262Error('#4: -8.99e+307 - 8.99e+307 === Number.NEGATIVE_INFINITY. Actual: ' + (-8.99e+307 - 8.99e+307));
}

View File

@ -13,20 +13,20 @@ description: >
//CHECK#1
if (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE !== (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE) {
$ERROR('#1: -Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE === (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE));
throw new Test262Error('#1: -Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE === (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE));
}
//CHECK#2
if ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE)) {
$ERROR('#2: (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE). Actual: ' + ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE));
throw new Test262Error('#2: (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE). Actual: ' + ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE));
}
//CHECK#3
if ("1" + 1 + 1 !== ("1" + 1) + 1) {
$ERROR('#3: "1" + 1 + 1 === ("1" + 1) + 1. Actual: ' + ("1" + 1 + 1));
throw new Test262Error('#3: "1" + 1 + 1 === ("1" + 1) + 1. Actual: ' + ("1" + 1 + 1));
}
//CHECK#4
if (("1" + 1) + 1 === "1" + (1 + 1)) {
$ERROR('#4: ("1" + 1) + 1 !== "1" + (1 + 1)');
throw new Test262Error('#4: ("1" + 1) + 1 !== "1" + (1 + 1)');
}

View File

@ -13,20 +13,20 @@ var array = [];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = []; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = []; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = []; array instanceof Array === true');
throw new Test262Error('#2: var array = []; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = []; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = []; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 0) {
$ERROR('#4: var array = []; array.length === 0. Actual: ' + (array.length));
throw new Test262Error('#4: var array = []; array.length === 0. Actual: ' + (array.length));
}

View File

@ -13,20 +13,20 @@ var array = [,,,,,];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [,,,,,]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [,,,,,]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [,,,,,]; array instanceof Array === true');
throw new Test262Error('#2: var array = [,,,,,]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [,,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [,,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [,,,,,]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [,,,,,]; array.length === 5. Actual: ' + (array.length));
}

View File

@ -13,45 +13,45 @@ var array = [1,2,3,4,5];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [1,2,3,4,5]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [1,2,3,4,5]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [1,2,3,4,5]; array instanceof Array === true');
throw new Test262Error('#2: var array = [1,2,3,4,5]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [1,2,3,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [1,2,3,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [1,2,3,4,5]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [1,2,3,4,5]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== 1) {
$ERROR('#5: var array = [1,2,3,4,5]; array[0] === 1. Actual: ' + (array[0]));
throw new Test262Error('#5: var array = [1,2,3,4,5]; array[0] === 1. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== 2) {
$ERROR('#6: var array = [1,2,3,4,5]; array[1] === 2. Actual: ' + (array[1]));
throw new Test262Error('#6: var array = [1,2,3,4,5]; array[1] === 2. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== 3) {
$ERROR('#7: var array = [1,2,3,4,5]; array[2] === 3. Actual: ' + (array[2]));
throw new Test262Error('#7: var array = [1,2,3,4,5]; array[2] === 3. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== 4) {
$ERROR('#8: var array = [1,2,3,4,5]; array[3] === 4. Actual: ' + (array[3]));
throw new Test262Error('#8: var array = [1,2,3,4,5]; array[3] === 4. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== 5) {
$ERROR('#9: var array = [1,2,3,4,5]; array[4] === 5. Actual: ' + (array[4]));
throw new Test262Error('#9: var array = [1,2,3,4,5]; array[4] === 5. Actual: ' + (array[4]));
}

View File

@ -13,45 +13,45 @@ var array = [,,,1,2];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [,,,1,2]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [,,,1,2]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [,,,1,2]; array instanceof Array === true');
throw new Test262Error('#2: var array = [,,,1,2]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [,,,1,2]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [,,,1,2]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [,,,1,2]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [,,,1,2]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== undefined) {
$ERROR('#5: var array = [,,,1,2]; array[0] === undefined. Actual: ' + (array[0]));
throw new Test262Error('#5: var array = [,,,1,2]; array[0] === undefined. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== undefined) {
$ERROR('#6: var array = [,,,1,2]; array[1] === undefined. Actual: ' + (array[1]));
throw new Test262Error('#6: var array = [,,,1,2]; array[1] === undefined. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== undefined) {
$ERROR('#7: var array = [,,,1,2]; array[2] === undefined. Actual: ' + (array[2]));
throw new Test262Error('#7: var array = [,,,1,2]; array[2] === undefined. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== 1) {
$ERROR('#8: var array = [,,,1,2]; array[3] === 1. Actual: ' + (array[3]));
throw new Test262Error('#8: var array = [,,,1,2]; array[3] === 1. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== 2) {
$ERROR('#9: var array = [,,,1,2]; array[4] === 2. Actual: ' + (array[4]));
throw new Test262Error('#9: var array = [,,,1,2]; array[4] === 2. Actual: ' + (array[4]));
}

View File

@ -13,45 +13,45 @@ var array = [4,5,,,,];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [4,5,,,,]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [4,5,,,,]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [4,5,,,,]; array instanceof Array === true');
throw new Test262Error('#2: var array = [4,5,,,,]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [4,5,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [4,5,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [4,5,,,,]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [4,5,,,,]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== 4) {
$ERROR('#5: var array = [4,5,,,,]; array[0] === 4. Actual: ' + (array[0]));
throw new Test262Error('#5: var array = [4,5,,,,]; array[0] === 4. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== 5) {
$ERROR('#6: var array = [4,5,,,,]; array[1] === 5. Actual: ' + (array[1]));
throw new Test262Error('#6: var array = [4,5,,,,]; array[1] === 5. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== undefined) {
$ERROR('#7: var array = [4,5,,,,]; array[2] === undefined. Actual: ' + (array[2]));
throw new Test262Error('#7: var array = [4,5,,,,]; array[2] === undefined. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== undefined) {
$ERROR('#8: var array = [4,5,,,,]; array[3] === undefined. Actual: ' + (array[3]));
throw new Test262Error('#8: var array = [4,5,,,,]; array[3] === undefined. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== undefined) {
$ERROR('#9: var array = [4,5,,,,]; array[4] === undefined. Actual: ' + (array[4]));
throw new Test262Error('#9: var array = [4,5,,,,]; array[4] === undefined. Actual: ' + (array[4]));
}

View File

@ -15,45 +15,45 @@ var array = [,,3,,,];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [,,3,,,]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [,,3,,,]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [,,3,,,]; array instanceof Array === true');
throw new Test262Error('#2: var array = [,,3,,,]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [,,3,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [,,3,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [,,3,,,]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [,,3,,,]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== undefined) {
$ERROR('#5: var array = [,,3,,,]; array[0] === undefined. Actual: ' + (array[0]));
throw new Test262Error('#5: var array = [,,3,,,]; array[0] === undefined. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== undefined) {
$ERROR('#6: var array = [,,3,,,]; array[1] === undefined. Actual: ' + (array[1]));
throw new Test262Error('#6: var array = [,,3,,,]; array[1] === undefined. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== 3) {
$ERROR('#7: var array = [,,3,,,]; array[2] === 3. Actual: ' + (array[2]));
throw new Test262Error('#7: var array = [,,3,,,]; array[2] === 3. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== undefined) {
$ERROR('#8: var array = [,,3,,,]; array[3] === undefined. Actual: ' + (array[3]));
throw new Test262Error('#8: var array = [,,3,,,]; array[3] === undefined. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== undefined) {
$ERROR('#9: var array = [,,3,,,]; array[4] === undefined. Actual: ' + (array[4]));
throw new Test262Error('#9: var array = [,,3,,,]; array[4] === undefined. Actual: ' + (array[4]));
}

View File

@ -15,45 +15,45 @@ var array = [1,2,,4,5];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [1,2,,4,5]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [1,2,,4,5]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [1,2,,4,5]; array instanceof Array === true');
throw new Test262Error('#2: var array = [1,2,,4,5]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [1,2,,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [1,2,,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [1,2,,4,5]; array.length === 5. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [1,2,,4,5]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== 1) {
$ERROR('#5: var array = [1,2,,4,5]; array[0] === 1. Actual: ' + (array[0]));
throw new Test262Error('#5: var array = [1,2,,4,5]; array[0] === 1. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== 2) {
$ERROR('#6: var array = [1,2,,4,5]; array[1] === 2. Actual: ' + (array[1]));
throw new Test262Error('#6: var array = [1,2,,4,5]; array[1] === 2. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== undefined) {
$ERROR('#7: var array = [1,2,,4,5]; array[2] === undefined. Actual: ' + (array[2]));
throw new Test262Error('#7: var array = [1,2,,4,5]; array[2] === undefined. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== 4) {
$ERROR('#8: var array = [1,2,,4,5]; array[3] === 4. Actual: ' + (array[3]));
throw new Test262Error('#8: var array = [1,2,,4,5]; array[3] === 4. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== 5) {
$ERROR('#9: var array = [1,2,,4,5]; array[4] === 5. Actual: ' + (array[4]));
throw new Test262Error('#9: var array = [1,2,,4,5]; array[4] === 5. Actual: ' + (array[4]));
}

View File

@ -13,116 +13,116 @@ var array = [[1,2], [3], []];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [[1,2], [3], []]; typeof array === "object". Actual: ' + (typeof array));
throw new Test262Error('#1: var array = [[1,2], [3], []]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [[1,2], [3], []]; array instanceof Array === true');
throw new Test262Error('#2: var array = [[1,2], [3], []]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [[1,2], [3], []]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
throw new Test262Error('#3: var array = [[1,2], [3], []]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 3) {
$ERROR('#4: var array = [[1,2], [3], []]; array.length === 3. Actual: ' + (array.length));
throw new Test262Error('#4: var array = [[1,2], [3], []]; array.length === 3. Actual: ' + (array.length));
}
var subarray = array[0];
//CHECK#5
if (typeof subarray !== "object") {
$ERROR('#5: var array = [[1,2], [3], []]; var subarray = array[0]; typeof subarray === "object". Actual: ' + (typeof subarray));
throw new Test262Error('#5: var array = [[1,2], [3], []]; var subarray = array[0]; typeof subarray === "object". Actual: ' + (typeof subarray));
}
//CHECK#6
if (subarray instanceof Array !== true) {
$ERROR('#6: var array = [[1,2], [3], []]; var subarray = array[0]; subarray instanceof Array === true');
throw new Test262Error('#6: var array = [[1,2], [3], []]; var subarray = array[0]; subarray instanceof Array === true');
}
//CHECK#7
if (subarray.toString !== Array.prototype.toString) {
$ERROR('#7: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
throw new Test262Error('#7: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
}
//CHECK#8
if (subarray.length !== 2) {
$ERROR('#8: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.length === 2. Actual: ' + (subarray.length));
throw new Test262Error('#8: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.length === 2. Actual: ' + (subarray.length));
}
//CHECK#9
if (subarray[0] !== 1) {
$ERROR('#9: var array = [[1,2], [3], []]; var subarray = array[0]; subarray[0] === 1. Actual: ' + (subarray[0]));
throw new Test262Error('#9: var array = [[1,2], [3], []]; var subarray = array[0]; subarray[0] === 1. Actual: ' + (subarray[0]));
}
//CHECK#10
if (subarray[1] !== 2) {
$ERROR('#10: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[1] === 2. Actual: ' + (subarray[1]));
throw new Test262Error('#10: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[1] === 2. Actual: ' + (subarray[1]));
}
var subarray = array[1];
//CHECK#11
if (typeof subarray !== "object") {
$ERROR('#11: var array = [[1,2], [3], []]; var subarray = array[1]; typeof subarray === "object". Actual: ' + (typeof subarray));
throw new Test262Error('#11: var array = [[1,2], [3], []]; var subarray = array[1]; typeof subarray === "object". Actual: ' + (typeof subarray));
}
//CHECK#12
if (subarray instanceof Array !== true) {
$ERROR('#12: var array = [[1,2], [3], []]; var subarray = array[1]; subarray instanceof Array === true');
throw new Test262Error('#12: var array = [[1,2], [3], []]; var subarray = array[1]; subarray instanceof Array === true');
}
//CHECK#13
if (subarray.toString !== Array.prototype.toString) {
$ERROR('#13: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
throw new Test262Error('#13: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
}
//CHECK#14
if (subarray.length !== 1) {
$ERROR('#14: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.length === 1. Actual: ' + (subarray.length));
throw new Test262Error('#14: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.length === 1. Actual: ' + (subarray.length));
}
//CHECK#15
if (subarray[0] !== 3) {
$ERROR('#15: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[0] === 3. Actual: ' + (subarray[0]));
throw new Test262Error('#15: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[0] === 3. Actual: ' + (subarray[0]));
}
var subarray = array[2];
//CHECK#16
if (typeof subarray !== "object") {
$ERROR('#16: var array = [[1,2], [3], []]; var subarray = array[2]; typeof subarray === "object". Actual: ' + (typeof subarray));
throw new Test262Error('#16: var array = [[1,2], [3], []]; var subarray = array[2]; typeof subarray === "object". Actual: ' + (typeof subarray));
}
//CHECK#17
if (subarray instanceof Array !== true) {
$ERROR('#17: var array = [[1,2], [3], []]; var subarray = array[2]; subarray instanceof Array === true');
throw new Test262Error('#17: var array = [[1,2], [3], []]; var subarray = array[2]; subarray instanceof Array === true');
}
//CHECK#18
if (subarray.toString !== Array.prototype.toString) {
$ERROR('#18: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
throw new Test262Error('#18: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));
}
//CHECK#19
if (subarray.length !== 0) {
$ERROR('#19: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.length === 0. Actual: ' + (subarray.length));
throw new Test262Error('#19: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.length === 0. Actual: ' + (subarray.length));
}
//CHECK#20
if (array[0][0] !== 1) {
$ERROR('#20: var array = [[1,2], [3], []]; array[0][0] === 1. Actual: ' + (array[0][0]));
throw new Test262Error('#20: var array = [[1,2], [3], []]; array[0][0] === 1. Actual: ' + (array[0][0]));
}
//CHECK#21
if (array[0][1] !== 2) {
$ERROR('#21: var array = [[1,2], [3], []]; array[0][1] === 2. Actual: ' + (array[0][1]));
throw new Test262Error('#21: var array = [[1,2], [3], []]; array[0][1] === 2. Actual: ' + (array[0][1]));
}
//CHECK#22
if (array[1][0] !== 3) {
$ERROR('#722: var array = [[1,2], [3], []]; array[1][0] === 3. Actual: ' + (array[1][0]));
throw new Test262Error('#722: var array = [[1,2], [3], []]; array[1][0] === 3. Actual: ' + (array[1][0]));
}

View File

@ -10,27 +10,27 @@ description: Either AssigmentExpression is not Reference or GetBase is not null
//CHECK#1
x = 1;
if (x !== 1) {
$ERROR('#1: x = 1; x === 1. Actual: ' + (x));
throw new Test262Error('#1: x = 1; x === 1. Actual: ' + (x));
}
//CHECK#2
var x = 1;
if (x !== 1) {
$ERROR('#2: var x = 1; x === 1. Actual: ' + (x));
throw new Test262Error('#2: var x = 1; x === 1. Actual: ' + (x));
}
//CHECK#3
y = 1;
x = y;
if (x !== 1) {
$ERROR('#3: y = 1; x = y; x === 1. Actual: ' + (x));
throw new Test262Error('#3: y = 1; x = y; x === 1. Actual: ' + (x));
}
//CHECK#4
var y = 1;
var x = y;
if (x !== 1) {
$ERROR('#4: var y = 1; var x = y; x === 1. Actual: ' + (x));
throw new Test262Error('#4: var y = 1; var x = y; x === 1. Actual: ' + (x));
}
//CHECK#5
@ -39,9 +39,9 @@ var objecty = new Object();
objecty.prop = 1.1;
objectx.prop = objecty.prop;
if (objectx.prop !== objecty.prop) {
$ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx.prop === objecty.prop. Actual: ' + (objectx.prop));
throw new Test262Error('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx.prop === objecty.prop. Actual: ' + (objectx.prop));
} else {
if (objectx === objecty) {
$ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx !== objecty');
throw new Test262Error('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx !== objecty');
}
}

View File

@ -10,10 +10,10 @@ description: If GetBase(AssigmentExpression) is null, throw ReferenceError
//CHECK#1
try {
x = y;
$ERROR('#1.1: x = y throw ReferenceError. Actual: ' + (x = y));
throw new Test262Error('#1.1: x = y throw ReferenceError. Actual: ' + (x = y));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x = y throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x = y throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -10,11 +10,11 @@ description: Checking Expression and Variable statements
//CHECK#1
var x = 1;
if (x !== 1) {
$ERROR('#1: var x = 1; x === 1. Actual: ' + (x));
throw new Test262Error('#1: var x = 1; x === 1. Actual: ' + (x));
}
//CHECK#2
x = 1;
if (x !== 1) {
$ERROR('#2: x = 1; x === 1. Actual: ' + (x));
throw new Test262Error('#2: x = 1; x === 1. Actual: ' + (x));
}

View File

@ -10,11 +10,11 @@ description: Checking Expression and Variable statements
//CHECK#1
var x = 0;
if ((x = 1) !== 1) {
$ERROR('#1: var x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));
throw new Test262Error('#1: var x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));
}
//CHECK#2
x = 0;
if ((x = 1) !== 1) {
$ERROR('#2: x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));
throw new Test262Error('#2: x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));
}

View File

@ -11,5 +11,5 @@ description: Syntax check
var x;
x = x = 1;
if (x !== 1) {
$ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));
throw new Test262Error('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));
}

View File

@ -10,9 +10,9 @@ description: Syntax check if "x = x" throws ReferenceError
//CHECK#1
try {
x = x;
$ERROR('#1.1: x = x throw ReferenceError. Actual: ' + (x = x));
throw new Test262Error('#1.1: x = x throw ReferenceError. Actual: ' + (x = x));
} catch(e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x = x throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x = x throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -22,10 +22,10 @@ function testFunction() {
}
if (scope.x !== 2) {
$ERROR('#1: scope.x === 2. Actual: ' + (scope.x));
throw new Test262Error('#1: scope.x === 2. Actual: ' + (scope.x));
}
if (x !== 0) {
$ERROR('#2: x === 0. Actual: ' + (x));
throw new Test262Error('#2: x === 0. Actual: ' + (x));
}
}
testFunction();

View File

@ -21,8 +21,8 @@ with (scope) {
}
if (scope.x !== 2) {
$ERROR('#1: scope.x === 2. Actual: ' + (scope.x));
throw new Test262Error('#1: scope.x === 2. Actual: ' + (scope.x));
}
if (x !== 0) {
$ERROR('#2: x === 0. Actual: ' + (x));
throw new Test262Error('#2: x === 0. Actual: ' + (x));
}

View File

@ -23,8 +23,8 @@ with (outerScope) {
}
if (innerScope.x !== 2) {
$ERROR('#1: innerScope.x === 2. Actual: ' + (innerScope.x));
throw new Test262Error('#1: innerScope.x === 2. Actual: ' + (innerScope.x));
}
if (outerScope.x !== 0) {
$ERROR('#2: outerScope.x === 0. Actual: ' + (outerScope.x));
throw new Test262Error('#2: outerScope.x === 0. Actual: ' + (outerScope.x));
}

View File

@ -20,10 +20,10 @@ function testAssignment() {
})();
if (innerX !== undefined) {
$ERROR('#1: innerX === undefined. Actual: ' + (innerX));
throw new Test262Error('#1: innerX === undefined. Actual: ' + (innerX));
}
if (x !== 1) {
$ERROR('#2: x === 1. Actual: ' + (x));
throw new Test262Error('#2: x === 1. Actual: ' + (x));
}
}
testAssignment();

View File

@ -20,10 +20,10 @@ function testAssignment() {
})();
if (innerX !== 2) {
$ERROR('#1: innerX === 2. Actual: ' + (innerX));
throw new Test262Error('#1: innerX === 2. Actual: ' + (innerX));
}
if (x !== 1) {
$ERROR('#2: x === 1. Actual: ' + (x));
throw new Test262Error('#2: x === 1. Actual: ' + (x));
}
}
testAssignment();

View File

@ -21,10 +21,10 @@ function testAssignment() {
}
if (scope.x !== 2) {
$ERROR('#1: scope.x === 2. Actual: ' + (scope.x));
throw new Test262Error('#1: scope.x === 2. Actual: ' + (scope.x));
}
if (x !== 1) {
$ERROR('#2: x === 1. Actual: ' + (x));
throw new Test262Error('#2: x === 1. Actual: ' + (x));
}
}
testAssignment();

View File

@ -19,7 +19,7 @@ assert.throws(DummyError, function() {
}
};
var expr = function() {
$ERROR("right-hand side expression evaluated");
throw new Test262Error("right-hand side expression evaluated");
};
base[prop] = expr();

View File

@ -11,5 +11,5 @@ flags: [noStrict]
var __e = Math.E;
Math.E = 1;
if (Math.E !== __e){
$ERROR('#1: __e = Math.E; Math.E = 1; Math.E === __e. Actual: ' + (Math.E));
throw new Test262Error('#1: __e = Math.E; Math.E = 1; Math.E === __e. Actual: ' + (Math.E));
}

View File

@ -15,7 +15,7 @@ var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__map[1] !== "one") {
$ERROR('#1: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map[1] === "one". Actual: ' + (__map[1]));
throw new Test262Error('#1: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map[1] === "one". Actual: ' + (__map[1]));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -23,7 +23,7 @@ if (__map[1] !== "one") {
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (__map["two"] !== 2) {
$ERROR('#2: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["two"] === 2. Actual: ' + (__map["two"]));
throw new Test262Error('#2: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["two"] === 2. Actual: ' + (__map["two"]));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -31,7 +31,7 @@ if (__map["two"] !== 2) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (__map["3"] !== "tre") {
$ERROR('#3: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["3"] === "tre". Actual: ' + (__map["3"]));
throw new Test262Error('#3: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["3"] === "tre". Actual: ' + (__map["3"]));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -15,7 +15,7 @@ var _map={1:"one",two:2};
//CHECK#1
_map[1]="uno";
if (_map[1] !== "uno") {
$ERROR('#1: var _map={1:"one",two:2}; _map[1]="uno"; _map[1] === "uno". Actual: ' + (_map[1]));
throw new Test262Error('#1: var _map={1:"one",two:2}; _map[1]="uno"; _map[1] === "uno". Actual: ' + (_map[1]));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ if (_map[1] !== "uno") {
//CHECK#2
_map["1"]=1;
if (_map[1] !== 1) {
$ERROR('#2: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map[1] === 1. Actual: ' + (_map[1]));
throw new Test262Error('#2: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map[1] === 1. Actual: ' + (_map[1]));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -33,7 +33,7 @@ if (_map[1] !== 1) {
//CHECK#3
_map["two"]="two";
if (_map["two"] !== "two") {
$ERROR('#3: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map["two"] === "two". Actual: ' + (_map["two"]));
throw new Test262Error('#3: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map["two"] === "two". Actual: ' + (_map["two"]));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -42,7 +42,7 @@ if (_map["two"] !== "two") {
//CHECK#4
_map.two="duo";
if (_map.two !== "duo") {
$ERROR('#4: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map.two="duo"; _map.two === "duo". Actual: ' + (_map.two));
throw new Test262Error('#4: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map.two="duo"; _map.two === "duo". Actual: ' + (_map.two));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -14,5 +14,5 @@ x
true;
if (x !== true) {
$ERROR('#6: (x\\u000A=\\u000Atrue) === true');
throw new Test262Error('#6: (x\\u000A=\\u000Atrue) === true');
}

View File

@ -29,7 +29,7 @@ assert.throws(DummyError, function() {
throw new DummyError();
};
var expr = function() {
$ERROR("right-hand side expression evaluated");
throw new Test262Error("right-hand side expression evaluated");
};
base[prop()] = expr();
@ -39,7 +39,7 @@ assert.throws(DummyError, function() {
var base = null;
var prop = {
toString: function() {
$ERROR("property key evaluated");
throw new Test262Error("property key evaluated");
}
};
var expr = function() {

View File

@ -29,7 +29,7 @@ assert.throws(DummyError, function() {
throw new DummyError();
};
var expr = function() {
$ERROR("right-hand side expression evaluated");
throw new Test262Error("right-hand side expression evaluated");
};
base[prop()] = expr();
@ -39,7 +39,7 @@ assert.throws(DummyError, function() {
var base = undefined;
var prop = {
toString: function() {
$ERROR("property key evaluated");
throw new Test262Error("property key evaluated");
}
};
var expr = function() {

View File

@ -11,45 +11,49 @@ var x;
x = 'U+0009';
if (x !== 'U+0009') {
$ERROR('#1: (x\\u0009=\\u0009true) === true');
throw new Test262Error('#1: (x\\u0009=\\u0009true) === true');
}
x = 'U+000B';
if (x !== 'U+000B') {
$ERROR('#2: (x\\u000B=\\u000Btrue) === true');
throw new Test262Error('#2: (x\\u000B=\\u000Btrue) === true');
}
x = 'U+000C';
if (x !== 'U+000C') {
$ERROR('#3: (x\\u000C=\\u000Ctrue) === true');
throw new Test262Error('#3: (x\\u000C=\\u000Ctrue) === true');
}
x = 'U+0020';
if (x !== 'U+0020') {
$ERROR('#4: (x\\u0020=\\u0020true) === true');
throw new Test262Error('#4: (x\\u0020=\\u0020true) === true');
}
x = 'U+00A0';
if (x !== 'U+00A0') {
$ERROR('#5: (x\\u00A0=\\u00A0true) === true');
throw new Test262Error('#5: (x\\u00A0=\\u00A0true) === true');
}
x = 'U+000D';
x
=
'Uthrow new Test262Error;
if (x !== 'U+000D') {
$ERROR('#7: (x\\u000D=\\u000Dtrue) === true');
}
x='U+2028';
xthrow new Test262Error028';
if (x !== 'U+2028') {
$ERROR('#8: (x\\u2028=\\u2028true) === true');
}
x='U+2029';
xthrow new Test262Error029';
if (x !== 'U+2029') {
$ERROR('#9: (x\\u2029=\\u2029true) === true');
}
x   =   'U+0009U+000BU+000CU+0020U+00A0U+000DU+2028U+2029';
x throw new Test262Error
=  
'U+0009U+000BU+000CU+0020U+00A0U+000DU+2028U+2029';
if (x !== 'U+0009U+000BU+000CU+0020U+00A0U+000DU+2028U+2029') {
$ERROR('#10: (x\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000D\\u2028\\u2029=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000D\\u2028\\u2029true) === true');
}

View File

@ -11,51 +11,51 @@ description: Checking uses eval
//CHECK#1
if ((eval("1\u0009&\u00091")) !== 1) {
$ERROR('#1: (1\\u0009&\\u00091) === 1');
throw new Test262Error('#1: (1\\u0009&\\u00091) === 1');
}
//CHECK#2
if ((eval("1\u000B&\u000B1")) !== 1) {
$ERROR('#2: (1\\u000B&\\u000B1) === 1');
throw new Test262Error('#2: (1\\u000B&\\u000B1) === 1');
}
//CHECK#3
if ((eval("1\u000C&\u000C1")) !== 1) {
$ERROR('#3: (1\\u000C&\\u000C1) === 1');
throw new Test262Error('#3: (1\\u000C&\\u000C1) === 1');
}
//CHECK#4
if ((eval("1\u0020&\u00201")) !== 1) {
$ERROR('#4: (1\\u0020&\\u00201) === 1');
throw new Test262Error('#4: (1\\u0020&\\u00201) === 1');
}
//CHECK#5
if ((eval("1\u00A0&\u00A01")) !== 1) {
$ERROR('#5: (1\\u00A0&\\u00A01) === 1');
throw new Test262Error('#5: (1\\u00A0&\\u00A01) === 1');
}
//CHECK#6
if ((eval("1\u000A&\u000A1")) !== 1) {
$ERROR('#6: (1\\u000A&\\u000A1) === 1');
throw new Test262Error('#6: (1\\u000A&\\u000A1) === 1');
}
//CHECK#7
if ((eval("1\u000D&\u000D1")) !== 1) {
$ERROR('#7: (1\\u000D&\\u000D1) === 1');
throw new Test262Error('#7: (1\\u000D&\\u000D1) === 1');
}
//CHECK#8
if ((eval("1\u2028&\u20281")) !== 1) {
$ERROR('#8: (1\\u2028&\\u20281) === 1');
throw new Test262Error('#8: (1\\u2028&\\u20281) === 1');
}
//CHECK#9
if ((eval("1\u2029&\u20291")) !== 1) {
$ERROR('#9: (1\\u2029&\\u20291) === 1');
throw new Test262Error('#9: (1\\u2029&\\u20291) === 1');
}
//CHECK#10
if ((eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029&\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291")) !== 1) {
$ERROR('#10: (1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029&\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291) === 1');
throw new Test262Error('#10: (1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029&\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291) === 1');
}

View File

@ -9,26 +9,26 @@ description: Either Type is not Reference or GetBase is not null
//CHECK#1
if ((1 & 1) !== 1) {
$ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));
throw new Test262Error('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));
}
//CHECK#2
var x = 1;
if ((x & 1) !== 1) {
$ERROR('#2: var x = 1; (x & 1) === 1. Actual: ' + ((x & 1)));
throw new Test262Error('#2: var x = 1; (x & 1) === 1. Actual: ' + ((x & 1)));
}
//CHECK#3
var y = 1;
if ((1 & y) !== 1) {
$ERROR('#3: var y = 1; (1 & y) === 1. Actual: ' + ((1 & y)));
throw new Test262Error('#3: var y = 1; (1 & y) === 1. Actual: ' + ((1 & y)));
}
//CHECK#4
var x = 1;
var y = 1;
if ((x & y) !== 1) {
$ERROR('#4: var x = 1; var y = 1; (x & y) === 1. Actual: ' + ((x & y)));
throw new Test262Error('#4: var x = 1; var y = 1; (x & y) === 1. Actual: ' + ((x & y)));
}
//CHECK#5
@ -37,5 +37,5 @@ var objecty = new Object();
objectx.prop = 1;
objecty.prop = 1;
if ((objectx.prop & objecty.prop) !== 1) {
$ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop & objecty.prop) === 1. Actual: ' + ((objectx.prop & objecty.prop)));
throw new Test262Error('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop & objecty.prop) === 1. Actual: ' + ((objectx.prop & objecty.prop)));
}

View File

@ -10,10 +10,10 @@ description: If GetBase(x) is null, throw ReferenceError
//CHECK#1
try {
x & 1;
$ERROR('#1.1: x & 1 throw ReferenceError. Actual: ' + (x & 1));
throw new Test262Error('#1.1: x & 1 throw ReferenceError. Actual: ' + (x & 1));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x & 1 throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x & 1 throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -10,10 +10,10 @@ description: If GetBase(y) is null, throw ReferenceError
//CHECK#1
try {
1 & y;
$ERROR('#1.1: 1 & y throw ReferenceError. Actual: ' + (1 & y));
throw new Test262Error('#1.1: 1 & y throw ReferenceError. Actual: ' + (1 & y));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: 1 & y throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: 1 & y throw ReferenceError. Actual: ' + (e));
}
}

View File

@ -9,61 +9,61 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
//CHECK#1
if (({valueOf: function() {return 1}} & 1) !== 1) {
$ERROR('#1: ({valueOf: function() {return 1}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}} & 1)));
throw new Test262Error('#1: ({valueOf: function() {return 1}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}} & 1)));
}
//CHECK#2
if (({valueOf: function() {return 1}, toString: function() {return 0}} & 1) !== 1) {
$ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} & 1)));
throw new Test262Error('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} & 1)));
}
//CHECK#3
if (({valueOf: function() {return 1}, toString: function() {return {}}} & 1) !== 1) {
$ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} & 1)));
throw new Test262Error('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} & 1)));
}
//CHECK#4
try {
if (({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) !== 1) {
$ERROR('#4.1: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1)));
throw new Test262Error('#4.1: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1)));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw "error"');
throw new Test262Error('#4.2: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw "error"');
} else {
$ERROR('#4.3: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw Error. Actual: ' + (e));
}
}
//CHECK#5
if ((1 & {toString: function() {return 1}}) !== 1) {
$ERROR('#5.1: (1 & {toString: function() {return 1}}) === 1. Actual: ' + ((1 & {toString: function() {return 1}})));
throw new Test262Error('#5.1: (1 & {toString: function() {return 1}}) === 1. Actual: ' + ((1 & {toString: function() {return 1}})));
}
//CHECK#6
if ((1 & {valueOf: function() {return {}}, toString: function() {return 1}}) !== 1) {
$ERROR('#6: (1 & {valueOf: function() {return {}}, toString: function() {return 1}}) === 1. Actual: ' + ((1 & {valueOf: function() {return {}}, toString: function() {return 1}})));
throw new Test262Error('#6: (1 & {valueOf: function() {return {}}, toString: function() {return 1}}) === 1. Actual: ' + ((1 & {valueOf: function() {return {}}, toString: function() {return 1}})));
}
//CHECK#7
try {
1 & {valueOf: function() {throw "error"}, toString: function() {return 1}};
$ERROR('#7.1: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 & {valueOf: function() {throw "error"}, toString: function() {return 1}}));
throw new Test262Error('#7.1: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 & {valueOf: function() {throw "error"}, toString: function() {return 1}}));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e));
}
}
//CHECK#8
try {
1 & {valueOf: function() {return {}}, toString: function() {return {}}};
$ERROR('#8.1: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 & {valueOf: function() {return {}}, toString: function() {return {}}}));
throw new Test262Error('#8.1: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 & {valueOf: function() {return {}}, toString: function() {return {}}}));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));
}
}

View File

@ -14,13 +14,13 @@ var x = { valueOf: function () { throw "x"; } };
var y = { valueOf: function () { throw "y"; } };
try {
x & y;
$ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (x & y));
throw new Test262Error('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (x & y));
} catch (e) {
if (e === "y") {
$ERROR('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)');
throw new Test262Error('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)');
} else {
if (e !== "x") {
$ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (e));
throw new Test262Error('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (e));
}
}
}

View File

@ -10,11 +10,11 @@ description: Checking with "="
//CHECK#1
var x = 0;
if (((x = 1) & x) !== 1) {
$ERROR('#1: var x = 0; ((x = 1) & x) === 1. Actual: ' + (((x = 1) & x)));
throw new Test262Error('#1: var x = 0; ((x = 1) & x) === 1. Actual: ' + (((x = 1) & x)));
}
//CHECK#2
var x = 0;
if ((x & (x = 1)) !== 0) {
$ERROR('#2: var x = 0; (x & (x = 1)) === 0. Actual: ' + ((x & (x = 1))));
throw new Test262Error('#2: var x = 0; (x & (x = 1)) === 0. Actual: ' + ((x & (x = 1))));
}

View File

@ -12,13 +12,13 @@ var x = function () { throw "x"; };
var y = function () { throw "y"; };
try {
x() & y();
$ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (x() & y()));
throw new Test262Error('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (x() & y()));
} catch (e) {
if (e === "y") {
$ERROR('#1.2: First expression is evaluated first, and then second expression');
throw new Test262Error('#1.2: First expression is evaluated first, and then second expression');
} else {
if (e !== "x") {
$ERROR('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (e));
throw new Test262Error('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (e));
}
}
}

View File

@ -11,15 +11,15 @@ flags: [noStrict]
//CHECK#1
try {
x & (x = 1);
$ERROR('#1.1: x & (x = 1) throw ReferenceError. Actual: ' + (x & (x = 1)));
throw new Test262Error('#1.1: x & (x = 1) throw ReferenceError. Actual: ' + (x & (x = 1)));
}
catch (e) {
if ((e instanceof ReferenceError) !== true) {
$ERROR('#1.2: x & (x = 1) throw ReferenceError. Actual: ' + (e));
throw new Test262Error('#1.2: x & (x = 1) throw ReferenceError. Actual: ' + (e));
}
}
//CHECK#2
if (((y = 1) & y) !== 1) {
$ERROR('#2: ((y = 1) & y) === 1. Actual: ' + (((y = 1) & y)));
throw new Test262Error('#2: ((y = 1) & y) === 1. Actual: ' + (((y = 1) & y)));
}

View File

@ -9,20 +9,20 @@ description: Type(x) and Type(y) are primitive boolean and Boolean object
//CHECK#1
if ((true & true) !== 1) {
$ERROR('#1: (true & true) === 1. Actual: ' + ((true & true)));
throw new Test262Error('#1: (true & true) === 1. Actual: ' + ((true & true)));
}
//CHECK#2
if ((new Boolean(true) & true) !== 1) {
$ERROR('#2: (new Boolean(true) & true) === 1. Actual: ' + ((new Boolean(true) & true)));
throw new Test262Error('#2: (new Boolean(true) & true) === 1. Actual: ' + ((new Boolean(true) & true)));
}
//CHECK#3
if ((true & new Boolean(true)) !== 1) {
$ERROR('#3: (true & new Boolean(true)) === 1. Actual: ' + ((true & new Boolean(true))));
throw new Test262Error('#3: (true & new Boolean(true)) === 1. Actual: ' + ((true & new Boolean(true))));
}
//CHECK#4
if ((new Boolean(true) & new Boolean(true)) !== 1) {
$ERROR('#4: (new Boolean(true) & new Boolean(true)) === 1. Actual: ' + ((new Boolean(true) & new Boolean(true))));
throw new Test262Error('#4: (new Boolean(true) & new Boolean(true)) === 1. Actual: ' + ((new Boolean(true) & new Boolean(true))));
}

View File

@ -9,20 +9,20 @@ description: Type(x) and Type(y) are primitive number and Number object
//CHECK#1
if ((1 & 1) !== 1) {
$ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));
throw new Test262Error('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));
}
//CHECK#2
if ((new Number(1) & 1) !== 1) {
$ERROR('#2: (new Number(1) & 1) === 1. Actual: ' + ((new Number(1) & 1)));
throw new Test262Error('#2: (new Number(1) & 1) === 1. Actual: ' + ((new Number(1) & 1)));
}
//CHECK#3
if ((1 & new Number(1)) !== 1) {
$ERROR('#3: (1 & new Number(1)) === 1. Actual: ' + ((1 & new Number(1))));
throw new Test262Error('#3: (1 & new Number(1)) === 1. Actual: ' + ((1 & new Number(1))));
}
//CHECK#4
if ((new Number(1) & new Number(1)) !== 1) {
$ERROR('#4: (new Number(1) & new Number(1)) === 1. Actual: ' + ((new Number(1) & new Number(1))));
throw new Test262Error('#4: (new Number(1) & new Number(1)) === 1. Actual: ' + ((new Number(1) & new Number(1))));
}

View File

@ -9,30 +9,30 @@ description: Type(x) and Type(y) are primitive string and String object
//CHECK#1
if (("1" & "1") !== 1) {
$ERROR('#1: ("1" & "1") === 1. Actual: ' + (("1" & "1")));
throw new Test262Error('#1: ("1" & "1") === 1. Actual: ' + (("1" & "1")));
}
//CHECK#2
if ((new String("1") & "1") !== 1) {
$ERROR('#2: (new String("1") & "1") === 1. Actual: ' + ((new String("1") & "1")));
throw new Test262Error('#2: (new String("1") & "1") === 1. Actual: ' + ((new String("1") & "1")));
}
//CHECK#3
if (("1" & new String("1")) !== 1) {
$ERROR('#3: ("1" & new String("1")) === 1. Actual: ' + (("1" & new String("1"))));
throw new Test262Error('#3: ("1" & new String("1")) === 1. Actual: ' + (("1" & new String("1"))));
}
//CHECK#4
if ((new String("1") & new String("1")) !== 1) {
$ERROR('#4: (new String("1") & new String("1")) === 1. Actual: ' + ((new String("1") & new String("1"))));
throw new Test262Error('#4: (new String("1") & new String("1")) === 1. Actual: ' + ((new String("1") & new String("1"))));
}
//CHECK#5
if (("x" & "1") !== 0) {
$ERROR('#5: ("x" & "1") === 0. Actual: ' + (("x" & "1")));
throw new Test262Error('#5: ("x" & "1") === 0. Actual: ' + (("x" & "1")));
}
//CHECK#6
if (("1" & "x") !== 0) {
$ERROR('#6: ("1" & "x") === 0. Actual: ' + (("1" & "x")));
throw new Test262Error('#6: ("1" & "x") === 0. Actual: ' + (("1" & "x")));
}

View File

@ -9,20 +9,20 @@ description: Type(x) and Type(y) are null and undefined
//CHECK#1
if ((null & undefined) !== 0) {
$ERROR('#1: (null & undefined) === 0. Actual: ' + ((null & undefined)));
throw new Test262Error('#1: (null & undefined) === 0. Actual: ' + ((null & undefined)));
}
//CHECK#2
if ((undefined & null) !== 0) {
$ERROR('#2: (undefined & null) === 0. Actual: ' + ((undefined & null)));
throw new Test262Error('#2: (undefined & null) === 0. Actual: ' + ((undefined & null)));
}
//CHECK#3
if ((undefined & undefined) !== 0) {
$ERROR('#3: (undefined & undefined) === 0. Actual: ' + ((undefined & undefined)));
throw new Test262Error('#3: (undefined & undefined) === 0. Actual: ' + ((undefined & undefined)));
}
//CHECK#4
if ((null & null) !== 0) {
$ERROR('#4: (null & null) === 0. Actual: ' + ((null & null)));
throw new Test262Error('#4: (null & null) === 0. Actual: ' + ((null & null)));
}

View File

@ -9,20 +9,20 @@ description: Type(x) and Type(y) are Object object and Function object
//CHECK#1
if (({} & function(){return 1}) !== 0) {
$ERROR('#1: ({} & function(){return 1}) === 0. Actual: ' + (({} & function(){return 1})));
throw new Test262Error('#1: ({} & function(){return 1}) === 0. Actual: ' + (({} & function(){return 1})));
}
//CHECK#2
if ((function(){return 1} & {}) !== 0) {
$ERROR('#2: (function(){return 1} & {}) === 0. Actual: ' + ((function(){return 1} & {})));
throw new Test262Error('#2: (function(){return 1} & {}) === 0. Actual: ' + ((function(){return 1} & {})));
}
//CHECK#3
if ((function(){return 1} & function(){return 1}) !== 0) {
$ERROR('#3: (function(){return 1} & function(){return 1}) === 0. Actual: ' + ((function(){return 1} & function(){return 1})));
throw new Test262Error('#3: (function(){return 1} & function(){return 1}) === 0. Actual: ' + ((function(){return 1} & function(){return 1})));
}
//CHECK#4
if (({} & {}) !== 0) {
$ERROR('#4: ({} & {}) === 0. Actual: ' + (({} & {})));
throw new Test262Error('#4: ({} & {}) === 0. Actual: ' + (({} & {})));
}

View File

@ -11,40 +11,40 @@ description: >
//CHECK#1
if ((true & 1) !== 1) {
$ERROR('#1: (true & 1) === 1. Actual: ' + ((true & 1)));
throw new Test262Error('#1: (true & 1) === 1. Actual: ' + ((true & 1)));
}
//CHECK#2
if ((1 & true) !== 1) {
$ERROR('#2: (1 & true) === 1. Actual: ' + ((1 & true)));
throw new Test262Error('#2: (1 & true) === 1. Actual: ' + ((1 & true)));
}
//CHECK#3
if ((new Boolean(true) & 1) !== 1) {
$ERROR('#3: (new Boolean(true) & 1) === 1. Actual: ' + ((new Boolean(true) & 1)));
throw new Test262Error('#3: (new Boolean(true) & 1) === 1. Actual: ' + ((new Boolean(true) & 1)));
}
//CHECK#4
if ((1 & new Boolean(true)) !== 1) {
$ERROR('#4: (1 & new Boolean(true)) === 1. Actual: ' + ((1 & new Boolean(true))));
throw new Test262Error('#4: (1 & new Boolean(true)) === 1. Actual: ' + ((1 & new Boolean(true))));
}
//CHECK#5
if ((true & new Number(1)) !== 1) {
$ERROR('#5: (true & new Number(1)) === 1. Actual: ' + ((true & new Number(1))));
throw new Test262Error('#5: (true & new Number(1)) === 1. Actual: ' + ((true & new Number(1))));
}
//CHECK#6
if ((new Number(1) & true) !== 1) {
$ERROR('#6: (new Number(1) & true) === 1. Actual: ' + ((new Number(1) & true)));
throw new Test262Error('#6: (new Number(1) & true) === 1. Actual: ' + ((new Number(1) & true)));
}
//CHECK#7
if ((new Boolean(true) & new Number(1)) !== 1) {
$ERROR('#7: (new Boolean(true) & new Number(1)) === 1. Actual: ' + ((new Boolean(true) & new Number(1))));
throw new Test262Error('#7: (new Boolean(true) & new Number(1)) === 1. Actual: ' + ((new Boolean(true) & new Number(1))));
}
//CHECK#8
if ((new Number(1) & new Boolean(true)) !== 1) {
$ERROR('#8: (new Number(1) & new Boolean(true)) === 1. Actual: ' + ((new Number(1) & new Boolean(true))));
throw new Test262Error('#8: (new Number(1) & new Boolean(true)) === 1. Actual: ' + ((new Number(1) & new Boolean(true))));
}

View File

@ -11,50 +11,50 @@ description: >
//CHECK#1
if (("1" & 1) !== 1) {
$ERROR('#1: ("1" & 1) === 1. Actual: ' + (("1" & 1)));
throw new Test262Error('#1: ("1" & 1) === 1. Actual: ' + (("1" & 1)));
}
//CHECK#2
if ((1 & "1") !== 1) {
$ERROR('#2: (1 & "1") === 1. Actual: ' + ((1 & "1")));
throw new Test262Error('#2: (1 & "1") === 1. Actual: ' + ((1 & "1")));
}
//CHECK#3
if ((new String("1") & 1) !== 1) {
$ERROR('#3: (new String("1") & 1) === 1. Actual: ' + ((new String("1") & 1)));
throw new Test262Error('#3: (new String("1") & 1) === 1. Actual: ' + ((new String("1") & 1)));
}
//CHECK#4
if ((1 & new String("1")) !== 1) {
$ERROR('#4: (1 & new String("1")) === 1. Actual: ' + ((1 & new String("1"))));
throw new Test262Error('#4: (1 & new String("1")) === 1. Actual: ' + ((1 & new String("1"))));
}
//CHECK#5
if (("1" & new Number(1)) !== 1) {
$ERROR('#5: ("1" & new Number(1)) === 1. Actual: ' + (("1" & new Number(1))));
throw new Test262Error('#5: ("1" & new Number(1)) === 1. Actual: ' + (("1" & new Number(1))));
}
//CHECK#6
if ((new Number(1) & "1") !== 1) {
$ERROR('#6: (new Number(1) & "1") === 1. Actual: ' + ((new Number(1) & "1")));
throw new Test262Error('#6: (new Number(1) & "1") === 1. Actual: ' + ((new Number(1) & "1")));
}
//CHECK#7
if ((new String("1") & new Number(1)) !== 1) {
$ERROR('#7: (new String("1") & new Number(1)) === 1. Actual: ' + ((new String("1") & new Number(1))));
throw new Test262Error('#7: (new String("1") & new Number(1)) === 1. Actual: ' + ((new String("1") & new Number(1))));
}
//CHECK#8
if ((new Number(1) & new String("1")) !== 1) {
$ERROR('#8: (new Number(1) & new String("1")) === 1. Actual: ' + ((new Number(1) & new String("1"))));
throw new Test262Error('#8: (new Number(1) & new String("1")) === 1. Actual: ' + ((new Number(1) & new String("1"))));
}
//CHECK#9
if (("x" & 1) !== 0) {
$ERROR('#9: ("x" & 1) === 0. Actual: ' + (("x" & 1)));
throw new Test262Error('#9: ("x" & 1) === 0. Actual: ' + (("x" & 1)));
}
//CHECK#10
if ((1 & "x") !== 0) {
$ERROR('#10: (1 & "x") === 0. Actual: ' + ((1 & "x")));
throw new Test262Error('#10: (1 & "x") === 0. Actual: ' + ((1 & "x")));
}

Some files were not shown because too many files have changed in this diff Show More