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

This commit is contained in:
Rick Waldron 2021-07-28 16:44:19 -04:00 committed by GitHub
parent 2581a439a5
commit 2dcd653272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 181 additions and 181 deletions

View File

@ -8,8 +8,8 @@ description: Assign true and false to variables
---*/
if (x !== undefined) {
$ERROR("#0 x !== undefined, but actual is "+ x);
}
throw new Test262Error("#0 x !== undefined, but actual is "+ x);
}
////////////////////////////////////////////////////////////////////////
// CHECK#1
@ -17,12 +17,12 @@ var x = true;
var y = false;
if (x !== true) {
$ERROR("#1.1 x !== true, but actual is "+ x);
}
throw new Test262Error("#1.1 x !== true, but actual is "+ x);
}
if (y !== false) {
$ERROR("#1.1 y !== false, but actual is "+ y);
}
throw new Test262Error("#1.1 y !== false, but actual is "+ y);
}
//
////////////////////////////////////////////////////////////////////////

View File

@ -10,7 +10,7 @@ description: Check type of true/false and its equality
//////////////////////////////////////////////////////////////////////
// CHECK#1
if (typeof(true) !== "boolean") {
$ERROR('#1: typeof(true) === "boolean"');
throw new Test262Error('#1: typeof(true) === "boolean"');
}
//
//////////////////////////////////////////////////////////////////////
@ -18,7 +18,7 @@ if (typeof(true) !== "boolean") {
//////////////////////////////////////////////////////////////////////
// CHECK#2
if (typeof(true) != "boolean") {
$ERROR('#2: typeof(true) == "boolean"');
throw new Test262Error('#2: typeof(true) == "boolean"');
}
//
//////////////////////////////////////////////////////////////////////
@ -26,7 +26,7 @@ if (typeof(true) != "boolean") {
//////////////////////////////////////////////////////////////////////
// CHECK#3
if (typeof(false) !== "boolean") {
$ERROR('#3: typeof(false) === "boolean"');
throw new Test262Error('#3: typeof(false) === "boolean"');
}
//
//////////////////////////////////////////////////////////////////////
@ -34,7 +34,7 @@ if (typeof(false) !== "boolean") {
//////////////////////////////////////////////////////////////////////
// CHECK#4
if (typeof(false) != "boolean") {
$ERROR('#4: typeof(false) == "boolean"');
throw new Test262Error('#4: typeof(false) == "boolean"');
}
//
//////////////////////////////////////////////////////////////////////
@ -42,7 +42,7 @@ if (typeof(false) != "boolean") {
//////////////////////////////////////////////////////////////////////
// CHECK#5
if (true === false) {
$ERROR('#5: true !== false');
throw new Test262Error('#5: true !== false');
}
//
//////////////////////////////////////////////////////////////////////
@ -50,7 +50,7 @@ if (true === false) {
//////////////////////////////////////////////////////////////////////
// CHECK#6
if (true == false) {
$ERROR('#6: true != false');
throw new Test262Error('#6: true != false');
}
//
//////////////////////////////////////////////////////////////////////
@ -58,7 +58,7 @@ if (true == false) {
//////////////////////////////////////////////////////////////////////
// CHECK#7
if (false === true) {
$ERROR('#7: false !== true');
throw new Test262Error('#7: false !== true');
}
//
//////////////////////////////////////////////////////////////////////
@ -66,7 +66,7 @@ if (false === true) {
//////////////////////////////////////////////////////////////////////
// CHECK#8
if (false == true) {
$ERROR('#8: false != true');
throw new Test262Error('#8: false != true');
}
//
//////////////////////////////////////////////////////////////////////

View File

@ -10,7 +10,7 @@ description: Check not false equals true, not true equals false
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (!false !== true){
$ERROR('#1: !false === true');
throw new Test262Error('#1: !false === true');
}
//
//////////////////////////////////////////////////////////////////////////////
@ -18,7 +18,7 @@ if (!false !== true){
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (!false != true){
$ERROR('#2: !false == true');
throw new Test262Error('#2: !false == true');
}
//
//////////////////////////////////////////////////////////////////////////////
@ -26,7 +26,7 @@ if (!false != true){
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (!true !== false){
$ERROR('#3: !true === false');
throw new Test262Error('#3: !true === false');
}
//
//////////////////////////////////////////////////////////////////////////////
@ -34,7 +34,7 @@ if (!true !== false){
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (!true != false){
$ERROR('#4: !true == false');
throw new Test262Error('#4: !true == false');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ function __mFunc(){return arguments.length;};
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__mFunc(1,2,3) !== 3){
$ERROR('#1: function __mFunc(){return arguments.length;}; __mFunc(1,2,3) === 3. Actual: ' + (__mFunc(1,2,3)));
throw new Test262Error('#1: function __mFunc(){return arguments.length;}; __mFunc(1,2,3) === 3. Actual: ' + (__mFunc(1,2,3)));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ function __mFunc(){return arguments.length;};
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__mFunc([,,]) !== 1){
$ERROR('#1: function __mFunc(){return arguments.length;}; __mFunc([,,]) === 1. Actual: ' + (__mFunc([,,])));
throw new Test262Error('#1: function __mFunc(){return arguments.length;}; __mFunc([,,]) === 1. Actual: ' + (__mFunc([,,])));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ function __mFunc(){var __accum=""; for (var i = 0; i < arguments.length; ++i){__
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__mFunc("A","B","C","D","E","F") !== "ABCDEF"){
$ERROR('#1: function __mFunc(){var __accum=""; for (var i = 0; i < arguments.length; ++i){__accum += arguments[i]};return __accum;}; __mFunc("A","B","C","D","E","F") === "ABCDEF". Actual: ' + (__mFunc("A","B","C","D","E","F")));
throw new Test262Error('#1: function __mFunc(){var __accum=""; for (var i = 0; i < arguments.length; ++i){__accum += arguments[i]};return __accum;}; __mFunc("A","B","C","D","E","F") === "ABCDEF". Actual: ' + (__mFunc("A","B","C","D","E","F")));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ description: Check type of null
//////////////////////////////////////////////////////////////
// CHECK#1
if (typeof(null) !== "object") {
$ERROR('#1: typeof null === "object". Actual: ' + (typeof null));
throw new Test262Error('#1: typeof null === "object". Actual: ' + (typeof null));
}
//
/////////////////////////////////////////////////////////////

View File

@ -8,7 +8,7 @@ description: Valid Number ranges
// Check range support for Number values (IEEE 754 64-bit floats having the form s*m*2**e)
//
// For normalized floats, sign (s) is +1 or -1, m (mantisa) is a positive integer less
// For normalized floats, sign (s) is +1 or -1, m (mantisa) is a positive integer less
// than 2**53 but not less than 2**52 and e (exponent) is an integer ranging from -1074 to 971
//
// For denormalized floats, s is +1 or -1, m is a positive integer less than 2**52, and
@ -20,7 +20,7 @@ description: Valid Number ranges
// MIN_NORM = ~2.2250738585072013830902327173324e-308 = 2**-1022
// MAX_DENORM = ~2.2250738585072008890245868760859e-308 = MIN_NORM - MIN_DENORM = (2**-1022) - (2**-1074)
// MIN_DENORM = ~4.9406564584124654417656879286822e-324 = 2**-1074
// Fill an array with 2 to the power of (0 ... -1075)
var value = 1;
var floatValues = new Array(1076);
@ -33,30 +33,30 @@ for(var power = 0; power <= 1075; power++){
// The last value is below min denorm and should round to 0, everything else should contain a value
if(floatValues[1075] !== 0) {
$ERROR("Value after min denorm should round to 0");
throw new Test262Error("Value after min denorm should round to 0");
}
// Validate the last actual value is min denorm
if(floatValues[1074] !== 4.9406564584124654417656879286822e-324) {
$ERROR("Min denorm value is incorrect: " + floatValues[1074]);
throw new Test262Error("Min denorm value is incorrect: " + floatValues[1074]);
}
// Validate that every value is half the value before it up to 1
for(var index = 1074; index > 0; index--){
if(floatValues[index] === 0){
$ERROR("2**-" + index + " should not be 0");
throw new Test262Error("2**-" + index + " should not be 0");
}
if(floatValues[index - 1] !== (floatValues[index] * 2)){
$ERROR("Value should be double adjacent value at index " + index);
throw new Test262Error("Value should be double adjacent value at index " + index);
}
}
// Max norm should be supported and compare less than inifity
if(!(1.797693134862315708145274237317e+308 < Infinity)){
$ERROR("Max Number value 1.797693134862315708145274237317e+308 should not overflow to infinity");
throw new Test262Error("Max Number value 1.797693134862315708145274237317e+308 should not overflow to infinity");
}
// Numbers closer to 2**1024 then max norm should overflow to infinity
if(!(1.797693134862315808e+308 === +Infinity)){
$ERROR("1.797693134862315808e+308 did not resolve to Infinity");
throw new Test262Error("1.797693134862315808e+308 did not resolve to Infinity");
}

View File

@ -13,7 +13,7 @@ var x_ = Number.NaN;
///////////////////////////////////////////////////////
// CHECK #1
if (x === x_){
$ERROR('#1: NaN !== NaN ');
throw new Test262Error('#1: NaN !== NaN ');
}
//
//////////////////////////////////////////////////////////

View File

@ -11,5 +11,5 @@ var p_zero=+0;
var n_zero=-0;
if (1.0/p_zero === 1.0/n_zero){
$ERROR('#1: var p_zero=+0; var n_zero=-0; 1.0/p_zero !== 1.0/n_zero');
throw new Test262Error('#1: var p_zero=+0; var n_zero=-0; 1.0/p_zero !== 1.0/n_zero');
}

View File

@ -12,25 +12,25 @@ var n_zero=-0;
//CHECK #1
if ((p_zero == n_zero) !== true){
$ERROR('#1: var p_zero=+0; var n_zero=-0; p_zero != n_zero');
throw new Test262Error('#1: var p_zero=+0; var n_zero=-0; p_zero != n_zero');
}
//CHECK #2
if ((n_zero == 0) !== true){
$ERROR('#2: var p_zero=+0; var n_zero=-0; n_zero == 0');
throw new Test262Error('#2: var p_zero=+0; var n_zero=-0; n_zero == 0');
}
//CHECK #3
if ((p_zero == -0) !== true){
$ERROR('#3: var p_zero=+0; var n_zero=-0; p_zero == -0');
throw new Test262Error('#3: var p_zero=+0; var n_zero=-0; p_zero == -0');
}
//CHECK #4
if ((p_zero === 0) !== true){
$ERROR('#4: var p_zero=+0; var n_zero=-0; p_zero === 0');
throw new Test262Error('#4: var p_zero=+0; var n_zero=-0; p_zero === 0');
}
//CHECK #5
if ((n_zero === -0) !== true){
$ERROR('#5: var p_zero=+0; var n_zero=-0; n_zero === -0');
throw new Test262Error('#5: var p_zero=+0; var n_zero=-0; n_zero === -0');
}

View File

@ -10,12 +10,12 @@ description: Compare Infinity and +Infinity with Number.POSITIVE_INFINITY
var p_inf=+Infinity;
var inf=Infinity;
//CHECK #1
//CHECK #1
if (p_inf!==Number.POSITIVE_INFINITY){
$ERROR('#1: +Infinity is the same as Number.POSITIVE_INFINITY');
throw new Test262Error('#1: +Infinity is the same as Number.POSITIVE_INFINITY');
}
//CHECK #2
//CHECK #2
if (inf!==Number.POSITIVE_INFINITY){
$ERROR('#2: Infinity is the same as Number.POSITIVE_INFINITY');
throw new Test262Error('#2: Infinity is the same as Number.POSITIVE_INFINITY');
}

View File

@ -9,7 +9,7 @@ description: Compare -Infinity with Number.NEGATIVE_INFINITY
var n_inf=-Infinity;
//CHECK #1
//CHECK #1
if (n_inf !== Number.NEGATIVE_INFINITY){
$ERROR('#1: -Infinity is the same as Number.NEGATIVE_INFINITY');
throw new Test262Error('#1: -Infinity is the same as Number.NEGATIVE_INFINITY');
}

View File

@ -10,17 +10,17 @@ es5id: 8.5_A13_T2
description: Finite Non zero values where e is 971
---*/
//CHECK #1
//CHECK #1
if ((1*(Math.pow(2,52))*(Math.pow(2,971))) !== 8.98846567431158e+307){
$ERROR('#1: (1*(Math.pow(2,52))*(Math.pow(2,971))) === 8.98846567431158e+307. Actual: ' + ((1*(Math.pow(2,52))*(Math.pow(2,971)))));
throw new Test262Error('#1: (1*(Math.pow(2,52))*(Math.pow(2,971))) === 8.98846567431158e+307. Actual: ' + ((1*(Math.pow(2,52))*(Math.pow(2,971)))));
}
//CHECK #2
//CHECK #2
if ((1*((Math.pow(2,53))-1)*(Math.pow(2,971))) !== 1.7976931348623157e+308){
$ERROR('#2: (1*((Math.pow(2,53))-1)*(Math.pow(2,971))) === 1.7976931348623157e+308. Actual: ' + ((1*((Math.pow(2,53))-1)*(Math.pow(2,971)))));
throw new Test262Error('#2: (1*((Math.pow(2,53))-1)*(Math.pow(2,971))) === 1.7976931348623157e+308. Actual: ' + ((1*((Math.pow(2,53))-1)*(Math.pow(2,971)))));
}
//CHECK #3
//CHECK #3
if ((-1*(Math.pow(2,52))*(Math.pow(2,971))) !== -8.98846567431158e+307){
$ERROR('#3: (-1*(Math.pow(2,52))*(Math.pow(2,971))) === -8.98846567431158e+307. Actual: ' + ((-1*(Math.pow(2,52))*(Math.pow(2,971)))));
throw new Test262Error('#3: (-1*(Math.pow(2,52))*(Math.pow(2,971))) === -8.98846567431158e+307. Actual: ' + ((-1*(Math.pow(2,52))*(Math.pow(2,971)))));
}

View File

@ -7,12 +7,12 @@ es5id: 8.5_A14_T1
description: Create number bigger of 2**1024
---*/
//CHECK #1
//CHECK #1
if (1e+308*2 !== Infinity){
$ERROR('#1: 1e+308*2 === Infinity. Actual: ' + (1e+308*2));
throw new Test262Error('#1: 1e+308*2 === Infinity. Actual: ' + (1e+308*2));
}
//CHECK #2
//CHECK #2
if ((1*(Math.pow(2,53))*(Math.pow(2,971))) !== Infinity){
$ERROR('#2: (1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((1*(Math.pow(2,53))*(Math.pow(2,971)))));
throw new Test262Error('#2: (1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((1*(Math.pow(2,53))*(Math.pow(2,971)))));
}

View File

@ -7,12 +7,12 @@ es5id: 8.5_A14_T2
description: Create number smaller of -2**1024
---*/
//CHECK #1
//CHECK #1
if (-1e+308*3 !== -Infinity){
$ERROR('#1: -1e+308*3 === Infinity. Actual: ' + (-1e+308*3));
throw new Test262Error('#1: -1e+308*3 === Infinity. Actual: ' + (-1e+308*3));
}
//CHECK #2
//CHECK #2
if ((-1*(Math.pow(2,53))*(Math.pow(2,971))) !== -Infinity){
$ERROR('#2: (-1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((-1*(Math.pow(2,53))*(Math.pow(2,971)))));
throw new Test262Error('#2: (-1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((-1*(Math.pow(2,53))*(Math.pow(2,971)))));
}

View File

@ -13,5 +13,5 @@ var z = x + y;
var d = z - x;
if (d !== 0){
$ERROR('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d === 0. Actual: ' + (d));
throw new Test262Error('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d === 0. Actual: ' + (d));
}

View File

@ -13,5 +13,5 @@ var z = x + y;
var d = z - x;
if (d === 2){
$ERROR('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d !== 2');
throw new Test262Error('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d !== 2');
}

View File

@ -12,7 +12,7 @@ var x=NaN;
///////////////////////////////////////////////////////
// CHECK#1
if (typeof(x) !== "number"){
$ERROR('#1: var x=NaN; typeof(x) === "number". Actual: ' + (typeof(x)));
throw new Test262Error('#1: var x=NaN; typeof(x) === "number". Actual: ' + (typeof(x)));
}
//
//////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (typeof(x) !== "number"){
///////////////////////////////////////////////////////
// CHECK#2
if (typeof(NaN) !== "number"){
$ERROR('#2: typeof(NaN) === "number". Actual: ' + (typeof(NaN)));
throw new Test262Error('#2: typeof(NaN) === "number". Actual: ' + (typeof(NaN)));
}
//
//////////////////////////////////////////////////////////

View File

@ -17,7 +17,7 @@ var x_geq_0_ADD_leq_0=(x >= 0.0) + (x <= 0.0);
///////////////////////////////////////////////////
// CHECK#1
if (x_geq_0){
$ERROR('#1: NaN not greater or equal zero');
throw new Test262Error('#1: NaN not greater or equal zero');
}
//
///////////////////////////////////////////////////
@ -25,7 +25,7 @@ if (x_geq_0){
///////////////////////////////////////////////////
// CHECK#2
if (x_leq_0){
$ERROR('#2: NaN not less or equal zero');
throw new Test262Error('#2: NaN not less or equal zero');
}
//
///////////////////////////////////////////////////
@ -33,7 +33,7 @@ if (x_leq_0){
///////////////////////////////////////////////////
// CHECK#3
if (x_leq_0_OR_geq_0){
$ERROR('#3: NaN not less or equal zero OR greater or equal zero');
throw new Test262Error('#3: NaN not less or equal zero OR greater or equal zero');
}
//
///////////////////////////////////////////////////
@ -41,7 +41,7 @@ if (x_leq_0_OR_geq_0){
///////////////////////////////////////////////////
// CHECK#4
if (x_geq_0_ADD_leq_0){
$ERROR('#4: NaN not less or equal zero ADD greater or equal zero');
throw new Test262Error('#4: NaN not less or equal zero ADD greater or equal zero');
}
//
///////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ var x=-Infinity;
///////////////////////////////////////////////////////
// CHECK#1
if (typeof(x) !== "number"){
$ERROR('#1: var x=-Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
throw new Test262Error('#1: var x=-Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
}
//
//////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (typeof(x) !== "number"){
///////////////////////////////////////////////////////
// CHECK#2
if (typeof(-Infinity) !== "number"){
$ERROR('#2: typeof(-Infinity) === "number". Actual: ' + (typeof(-Infinity)));
throw new Test262Error('#2: typeof(-Infinity) === "number". Actual: ' + (typeof(-Infinity)));
}
//
//////////////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ var x=+Infinity;
///////////////////////////////////////////////////////
// CHECK#1
if (typeof(x) !== "number"){
$ERROR('#1: var x=+Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
throw new Test262Error('#1: var x=+Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
}
//
//////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (typeof(x) !== "number"){
///////////////////////////////////////////////////////
// CHECK#2
if (typeof(+Infinity) !== "number"){
$ERROR('#2: typeof(+Infinity) === "number". Actual: ' + (typeof(+Infinity)));
throw new Test262Error('#2: typeof(+Infinity) === "number". Actual: ' + (typeof(+Infinity)));
}
//
//////////////////////////////////////////////////////////

View File

@ -11,9 +11,9 @@ var p_inf=+Infinity;
var inf=Infinity;
///////////////////////////////////////////////////////
//
//
if (p_inf!==inf){
$ERROR('#1: Infinity is the same as +Infinity');
throw new Test262Error('#1: Infinity is the same as +Infinity');
}
//
//////////////////////////////////////////////////////////

View File

@ -11,5 +11,5 @@ flags: [noStrict]
Number.NaN = 1;
if (Number.NaN === 1) {
$ERROR('#1: Globally defined variable NaN has not been altered by program execution');
throw new Test262Error('#1: Globally defined variable NaN has not been altered by program execution');
}

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');
throw new Test262Error('#1: __e = Math.E; Math.E=1; Math.E ===__e');
}

View File

@ -11,5 +11,5 @@ description: Try to enumerate properties of Number
var count=0;
for (p in Number) count++;
if (count > 0){
$ERROR('#1: count=0; for (p in Number) count++; count > 0. Actual: ' + (count));
throw new Test262Error('#1: count=0; for (p in Number) count++; count > 0. Actual: ' + (count));
}

View File

@ -13,7 +13,7 @@ flags: [noStrict]
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (delete Number.NaN !== false){
$ERROR('#1: delete Number.NaN === false. Actual: ' + (delete Number.NaN));
throw new Test262Error('#1: delete Number.NaN === false. Actual: ' + (delete Number.NaN));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -21,7 +21,7 @@ if (delete Number.NaN !== false){
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (typeof(Number.NaN) === "undefined"){
$ERROR('#2: delete Number.NaN; typeof(Number.NaN) !== "undefined" ');
throw new Test262Error('#2: delete Number.NaN; typeof(Number.NaN) !== "undefined" ');
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -13,14 +13,14 @@ description: Check [[Prototype]] property of object
//CHECK#1
var __obj={};
if (!Object.prototype.isPrototypeOf(__obj)){
$ERROR('#1: Native ECMAScript objects have an internal property called [[Prototype]]. ');
throw new Test262Error('#1: Native ECMAScript objects have an internal property called [[Prototype]]. ');
};
//
//////////////////////////////////////////////////////////////////////////////
//Establish proto (base) object
/*function ProtoObj(){
};*/
var protoObj={};
//Establish foo object
@ -32,21 +32,21 @@ function FooObj(){};
var obj__= new FooObj;
if (!Object.prototype.isPrototypeOf(obj__)){
$ERROR('#2.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; Object.prototype.isPrototypeOf(obj__) === true. Actual: ' + (Object.prototype.isPrototypeOf(obj__)));
throw new Test262Error('#2.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; Object.prototype.isPrototypeOf(obj__) === true. Actual: ' + (Object.prototype.isPrototypeOf(obj__)));
};
if (!FooObj.prototype.isPrototypeOf(obj__)){
$ERROR('#2.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype.isPrototypeOf(obj__) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(obj__)));
throw new Test262Error('#2.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype.isPrototypeOf(obj__) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(obj__)));
};
if (protoObj.isPrototypeOf(obj__)){
$ERROR('#2.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
throw new Test262Error('#2.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
};
// Establish inheritance from proto object
FooObj.prototype=protoObj;
if (protoObj.isPrototypeOf(obj__)){
$ERROR('#2.4: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
throw new Test262Error('#2.4: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -58,15 +58,15 @@ if (protoObj.isPrototypeOf(obj__)){
var __foo=new FooObj;
if (!Object.prototype.isPrototypeOf(__foo)){
$ERROR('#3.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; Object.prototype.isPrototypeOf(__foo) === true. Actual: ' + (Object.prototype.isPrototypeOf(__foo)));
throw new Test262Error('#3.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; Object.prototype.isPrototypeOf(__foo) === true. Actual: ' + (Object.prototype.isPrototypeOf(__foo)));
};
if (!FooObj.prototype.isPrototypeOf(__foo)){
$ERROR('#3.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; FooObj.prototype.isPrototypeOf(__foo) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(__foo)));
throw new Test262Error('#3.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; FooObj.prototype.isPrototypeOf(__foo) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(__foo)));
};
if (!protoObj.isPrototypeOf(__foo)){
$ERROR('#3.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; protoObj.isPrototypeOf(__foo) === true. Actual: ' + (protoObj.isPrototypeOf(__foo)));
throw new Test262Error('#3.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; protoObj.isPrototypeOf(__foo) === true. Actual: ' + (protoObj.isPrototypeOf(__foo)));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -21,7 +21,7 @@ var foo= new FooObj;
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (foo.prop !== "some"){
$ERROR('#1: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop === "some". Actual: ' + (foo.prop));
throw new Test262Error('#1: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop === "some". Actual: ' + (foo.prop));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -32,7 +32,7 @@ foo.prop=true;
// Invoke another instance of foo object
var foo__ = new FooObj;
if (foo__.prop !== "some"){
$ERROR('#2: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop=true; var foo__ = new FooObj; foo__.prop === "some". Actual: ' + (foo__.prop));
throw new Test262Error('#2: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop=true; var foo__ = new FooObj; foo__.prop === "some". Actual: ' + (foo__.prop));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ var __obj={};
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__obj.toString() !== "[object " + 'Object' + "]"){
$ERROR('#1: var __obj={}; __obj.toString() === "[object " + \'Object\' + "]". Actual: ' + (__obj.toString()));
throw new Test262Error('#1: var __obj={}; __obj.toString() === "[object " + \'Object\' + "]". Actual: ' + (__obj.toString()));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ var __obj={};
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (!(__obj instanceof Object)) {
$ERROR('#1: var __obj={}; (__obj instanceof Object) === true. Actual: ' + ((__obj instanceof Object)));
throw new Test262Error('#1: var __obj={}; (__obj instanceof Object) === true. Actual: ' + ((__obj instanceof Object)));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ if (!(__obj instanceof Object)) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (__obj instanceof Function) {
$ERROR('#2: var __obj={}; (__obj instanceof Function) === false. Actual: ' + ((__obj instanceof Function)));
throw new Test262Error('#2: var __obj={}; (__obj instanceof Function) === false. Actual: ' + ((__obj instanceof Function)));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -32,7 +32,7 @@ if (__obj instanceof Function) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (__obj instanceof String) {
$ERROR('#3: var __obj={}; (__obj instanceof String) === false. Actual: ' + ((__obj instanceof String)));
throw new Test262Error('#3: var __obj={}; (__obj instanceof String) === false. Actual: ' + ((__obj instanceof String)));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -40,7 +40,7 @@ if (__obj instanceof String) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (__obj instanceof Number) {
$ERROR('#4: var __obj={}; (__obj instanceof Number) === false. Actual: ' + ((__obj instanceof Number)));
throw new Test262Error('#4: var __obj={}; (__obj instanceof Number) === false. Actual: ' + ((__obj instanceof Number)));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -48,7 +48,7 @@ if (__obj instanceof Number) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#5
if (__obj instanceof Array) {
$ERROR('#5: var __obj={}; (__obj instanceof Array) === false. Actual: ' + ((__obj instanceof Array)));
throw new Test262Error('#5: var __obj={}; (__obj instanceof Array) === false. Actual: ' + ((__obj instanceof Array)));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ var testScreen = {touch:function(){count++}};
//CHECK#1
testScreen.touch();
if (count !==1) {
$ERROR('#1: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); count === 1. Actual: ' + (count));
throw new Test262Error('#1: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); count === 1. Actual: ' + (count));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,7 @@ if (count !==1) {
//CHECK#2
testScreen['touch']();
if (count !==2) {
$ERROR('#2: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); testScreen[\'touch\'](); count === 2. Actual: ' + (count));
throw new Test262Error('#2: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); testScreen[\'touch\'](); count === 2. Actual: ' + (count));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ seat['move']=function(){position++};
//CHECK#1
seat.move();
if (position !==1) {
$ERROR('#1: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); position === 1. Actual: ' + (position));
throw new Test262Error('#1: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); position === 1. Actual: ' + (position));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,7 @@ if (position !==1) {
//CHECK#2
seat['move']();
if (position !==2) {
$ERROR('#2: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); seat[\'move\'](); position === 2. Actual: ' + (position));
throw new Test262Error('#2: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); seat[\'move\'](); position === 2. Actual: ' + (position));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -15,7 +15,7 @@ var knock=function(){count++};
//CHECK#1
knock();
if (count !==1) {
$ERROR('#1: count=0; knock=function(){count++}; knock(); count === 1. Actual: ' + (count));
throw new Test262Error('#1: count=0; knock=function(){count++}; knock(); count === 1. Actual: ' + (count));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ if (count !==1) {
//CHECK#2
this['knock']();
if (count !==2) {
$ERROR('#2: count=0; knock=function(){count++}; knock(); this[\'knock\'](); count === 2. Actual: ' + (count));
throw new Test262Error('#2: count=0; knock=function(){count++}; knock(); this[\'knock\'](); count === 2. Actual: ' + (count));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ this["beep"]=function(){__count++};
//CHECK#1
beep();
if (__count !==1) {
$ERROR('#1: __count=0; this["beep"]=function(){__count++}; beep(); __count === 1. Actual: ' + (__count));
throw new Test262Error('#1: __count=0; this["beep"]=function(){__count++}; beep(); __count === 1. Actual: ' + (__count));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,7 @@ if (__count !==1) {
//CHECK#2
this["beep"]();
if (__count !==2) {
$ERROR('#2: __count=0; this["beep"]=function(){__count++}; beep(); this["beep"](); __count === 2. Actual: ' + (__count));
throw new Test262Error('#2: __count=0; this["beep"]=function(){__count++}; beep(); this["beep"](); __count === 2. Actual: ' + (__count));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ description: Create a few Objects via the new operator
//CHECK#1
var objInstance=new Object;
if (objInstance.constructor !== Object){
$ERROR('#1: var objInstance=new Object; objInstance.constructor === Object. Actual: ' + (objInstance.constructor));
throw new Test262Error('#1: var objInstance=new Object; objInstance.constructor === Object. Actual: ' + (objInstance.constructor));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -22,7 +22,7 @@ if (objInstance.constructor !== Object){
//CHECK#2
var numInstance=new Number;
if (numInstance.constructor !== Number){
$ERROR('#2: var numInstance=new Number; numInstance.constructor === Number. Actual: ' + (numInstance.constructor));
throw new Test262Error('#2: var numInstance=new Number; numInstance.constructor === Number. Actual: ' + (numInstance.constructor));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -18,5 +18,5 @@ try {
// be tested separately.
}
if (Object.getPrototypeOf(x) !== Object.prototype) {
$ERROR("Prototype of non-extensible object mutated");
throw new Test262Error("Prototype of non-extensible object mutated");
}

View File

@ -18,7 +18,7 @@ assert.sameValue(__map.foo++, NaN);
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (!("foo" in __map)) {
$ERROR('#2: var __map={}; "foo" in __map');
throw new Test262Error('#2: var __map={}; "foo" in __map');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -18,7 +18,7 @@ assert.sameValue(++__map.foo, NaN, "++__map.foo");
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (!("foo" in __map)) {
$ERROR('#2: var __map={}; "foo" in __map');
throw new Test262Error('#2: var __map={}; "foo" in __map');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ var count=0;
for (var property in obj) count++;
if (count !== 3){
$ERROR('#1: obj = {bar:true, some:1, foo:"a"}; count=0; for (property in obj) count++; count === 3. Actual: ' + (count));
throw new Test262Error('#1: obj = {bar:true, some:1, foo:"a"}; count=0; for (property in obj) count++; count === 3. Actual: ' + (count));
}
//
////////////////////////////////////////////////////////
@ -32,7 +32,7 @@ count=0;
for (property in obj_) count++;
if (count !== 3){
$ERROR('#2: obj_ = {bar:true}; obj_.some = 1; obj_.foo = "a"; count=0; for (property in obj_) count++; count === 3. Actual: ' + (count));
throw new Test262Error('#2: obj_ = {bar:true}; obj_.some = 1; obj_.foo = "a"; count=0; for (property in obj_) count++; count === 3. Actual: ' + (count));
}
//
////////////////////////////////////////////////////////
@ -49,7 +49,7 @@ count=0;
for (property in obj__) count++;
if (count !== 3){
$ERROR('#3: obj__ = new Object(); obj__.bar = true; obj__.some = 1; obj__.foo = "a"; for (property in obj__) count++; count === 3. Actual: ' + (count));
throw new Test262Error('#3: obj__ = new Object(); obj__.bar = true; obj__.some = 1; obj__.foo = "a"; for (property in obj__) count++; count === 3. Actual: ' + (count));
}
//
////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ this.y = 1;
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if((delete this.y) !== true){
$ERROR('#1: this.y = 1; (delete this.y) === true. Actual: ' + ((delete this.y)));
throw new Test262Error('#1: this.y = 1; (delete this.y) === true. Actual: ' + ((delete this.y)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -22,7 +22,7 @@ if((delete this.y) !== true){
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (this.y !== undefined){
$ERROR('#2: this.y = 1; (delete this.y) === true; this.y === undefined. Actual: ' + (this.y));
throw new Test262Error('#2: this.y = 1; (delete this.y) === true; this.y === undefined. Actual: ' + (this.y));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ var y = 1;
//CHECK#1
var result = delete y;
if(result){
$ERROR('#1: y = 1; (delete y) === false. Actual: ' + result);
throw new Test262Error('#1: y = 1; (delete y) === false. Actual: ' + result);
};
//
//////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ if(result){
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (y !== 1) {
$ERROR('#2: y = 1; delete y; y === 1. Actual: ' + (y));
throw new Test262Error('#2: y = 1; delete y; y === 1. Actual: ' + (y));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ var x;
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (x !== undefined) {
$ERROR('#1: var x; x === undefined. Actual: ' + (x));
throw new Test262Error('#1: var x; x === undefined. Actual: ' + (x));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -21,7 +21,7 @@ x++;
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (x === undefined) {
$ERROR('#2: var x; x++; x !== undefined');
throw new Test262Error('#2: var x; x++; x !== undefined');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ description: Execute this.x++, where this.x is undefined
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (this.x !== undefined) {
$ERROR('#1: this.x === undefined. Actual: ' + (this.x));
throw new Test262Error('#1: this.x === undefined. Actual: ' + (this.x));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ this.x++;
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (x === undefined) {
$ERROR('#2: this.x; this.x++; x !== undefined');
throw new Test262Error('#2: this.x; this.x++; x !== undefined');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -24,7 +24,7 @@ obj.oneProperty = true;
// We now see that that change is represented in both variables
// (Since they both refer to the same object)
if(objRef.oneProperty !== true){
$ERROR('#1: var obj = new Object(); var objRef = obj; objRef.oneProperty = -1; obj.oneProperty = true; objRef.oneProperty === true. Actual: ' + (objRef.oneProperty));
throw new Test262Error('#1: var obj = new Object(); var objRef = obj; objRef.oneProperty = -1; obj.oneProperty = true; objRef.oneProperty === true. Actual: ' + (objRef.oneProperty));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -18,7 +18,7 @@ items.push( "four" );var itemsRef = items;
// The length of each array should be the same,
// since they both point to the same array object
if( itemsRef.length !== 4){
$ERROR('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items.push( "four" );var itemsRef = items; itemsRef.length !== 4');
throw new Test262Error('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items.push( "four" );var itemsRef = items; itemsRef.length !== 4');
};
//
//////////////////////////////////////////////////////////////////////////////
@ -34,7 +34,7 @@ items[1]="duo";
// The length of each array should be the same,
// since they both point to the same array object
if( itemsRef[1] !== "duo"){
$ERROR('#2: var items = new Array( "one", "two", "three" ); var itemsRef = items; items[1]="duo"; itemsRef[1] === "duo". Actual: ' + (itemsRef[1]));
throw new Test262Error('#2: var items = new Array( "one", "two", "three" ); var itemsRef = items; items[1]="duo"; itemsRef[1] === "duo". Actual: ' + (itemsRef[1]));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -23,7 +23,7 @@ items = new Array( "new", "array" );
// items points to new Array( "new", "array" )
// itemsRef points to new Array( "one", "two", "three" )
if( items == itemsRef ){
$ERROR('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items = new Array( "new", "array" ); items != itemsRef');
throw new Test262Error('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items = new Array( "new", "array" ); items != itemsRef');
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -24,7 +24,7 @@ item += "ing";
// The values of item and itemRef are NOT equal, as a whole
// new string object has been created
if( item == itemRef ){
$ERROR('#1: var item = new String("test"); var itemRef = item; item += "ing"; item != itemRef');
throw new Test262Error('#1: var item = new String("test"); var itemRef = item; item += "ing"; item != itemRef');
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,8 +11,8 @@ flags: [noStrict]
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (typeof(__ref) !== "undefined"){
$ERROR('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
throw new Test262Error('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -22,15 +22,15 @@ var __ref = obj;
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (typeof(__ref) === "undefined"){
$ERROR('#2: obj = new Object(); var __ref = obj; typeof(__ref) !== "undefined"');
};
throw new Test262Error('#2: obj = new Object(); var __ref = obj; typeof(__ref) !== "undefined"');
};
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (delete __ref !== false){
$ERROR('#3: obj = new Object(); var __ref = obj; delete __ref === false. Actual: ' + (delete __ref));
throw new Test262Error('#3: obj = new Object(); var __ref = obj; delete __ref === false. Actual: ' + (delete __ref));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -38,7 +38,7 @@ if (delete __ref !== false){
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (typeof(__ref) !== "object"){
$ERROR('#4: obj = new Object(); var __ref = obj; delete __ref; typeof(__ref) === "object". Actual: ' + (typeof(__ref)));
throw new Test262Error('#4: obj = new Object(); var __ref = obj; delete __ref; typeof(__ref) === "object". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -46,7 +46,7 @@ if (typeof(__ref) !== "object"){
//////////////////////////////////////////////////////////////////////////////
//CHECK#5
if (typeof(obj) !== "object"){
$ERROR('#5: obj = new Object(); var __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
throw new Test262Error('#5: obj = new Object(); var __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,8 +11,8 @@ flags: [noStrict]
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (typeof(__ref) !== "undefined"){
$ERROR('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
throw new Test262Error('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -22,15 +22,15 @@ __ref = obj;
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (typeof(__ref) === "undefined"){
$ERROR('#2: obj = new Object(); __ref = obj; typeof(__ref) !== "undefined"');
};
throw new Test262Error('#2: obj = new Object(); __ref = obj; typeof(__ref) !== "undefined"');
};
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (delete __ref !== true){
$ERROR('#3: obj = new Object(); __ref = obj; delete __ref === true. Actual: ' + (delete __ref));
throw new Test262Error('#3: obj = new Object(); __ref = obj; delete __ref === true. Actual: ' + (delete __ref));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -38,7 +38,7 @@ if (delete __ref !== true){
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (typeof(__ref) !== "undefined"){
$ERROR('#4: obj = new Object(); __ref = obj; delete __ref; typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
throw new Test262Error('#4: obj = new Object(); __ref = obj; delete __ref; typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -46,7 +46,7 @@ if (typeof(__ref) !== "undefined"){
//////////////////////////////////////////////////////////////////////////////
//CHECK#5
if (typeof(obj) !== "object"){
$ERROR('#5: obj = new Object(); __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
throw new Test262Error('#5: obj = new Object(); __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -19,7 +19,7 @@ addFirst2Second(n, m);
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (m !== 1) {
$ERROR('#1: var n = 1; var m = n; function addFirst2Second(first, second){first += second;} addFirst2Second(n, m); m === 1. Actual: ' + (m));
throw new Test262Error('#1: var n = 1; var m = n; function addFirst2Second(first, second){first += second;} addFirst2Second(n, m); m === 1. Actual: ' + (m));
}
//

View File

@ -13,7 +13,7 @@ var m = n;
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (typeof m !== "object") {
$ERROR('#1: var n = {}; var m = n; typeof m === "object". Actual: ' + (typeof m));
throw new Test262Error('#1: var n = {}; var m = n; typeof m === "object". Actual: ' + (typeof m));
}
//
//////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,7 @@ populateAge(m);
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (n.age !== 50) {
$ERROR('#2: var n = {}; var m = n; function populateAge(person){person.age = 50;} populateAge(m); n.age === 50. Actual: ' + (n.age));
throw new Test262Error('#2: var n = {}; var m = n; function populateAge(person){person.age = 50;} populateAge(m); n.age === 50. Actual: ' + (n.age));
}
//

View File

@ -13,7 +13,7 @@ description: Check type of variable that has been assigned with string literal
// CHECK#1
var str="abcdfg";
if (typeof(str)!=="string"){
$ERROR('#1: var str="abcdfg"; typeof(str) === "string". Actual: ' + (typeof(str)));
throw new Test262Error('#1: var str="abcdfg"; typeof(str) === "string". Actual: ' + (typeof(str)));
}
//
////////////////////////////////////////////////////////
@ -22,7 +22,7 @@ if (typeof(str)!=="string"){
// CHECK#2
var str2='qwerty';
if (typeof(str2)!=="string"){
$ERROR('#2: var str2=\'qwerty\'; typeof(str) === "string". Actual: ' + (typeof(str2)));
throw new Test262Error('#2: var str2=\'qwerty\'; typeof(str) === "string". Actual: ' + (typeof(str2)));
}
//
////////////////////////////////////////////////////////
@ -31,7 +31,7 @@ if (typeof(str2)!=="string"){
// CHECK#3
var __str='\u0042\u0043\u0044\u0045\u0046\u0047\u0048';
if (typeof(__str)!=="string"){
$ERROR('#3: var __str=\'\\u0042\\u0043\\u0044\\u0045\\u0046\\u0047\\u0048\'; typeof(__str) === "string". Actual: ' + (typeof(__str)));
throw new Test262Error('#3: var __str=\'\\u0042\\u0043\\u0044\\u0045\\u0046\\u0047\\u0048\'; typeof(__str) === "string". Actual: ' + (typeof(__str)));
}
//
////////////////////////////////////////////////////////
@ -40,7 +40,7 @@ if (typeof(__str)!=="string"){
// CHECK#4
var str__="\u0042\u0043\u0044\u0045\u0046\u0047\u0048";
if (typeof(str__)!=="string"){
$ERROR('#4: var str__="abcdfg"; typeof(str__) === "string". Actual: ' + (typeof(str__)));
throw new Test262Error('#4: var str__="abcdfg"; typeof(str__) === "string". Actual: ' + (typeof(str__)));
}
//
////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ description: Create string using both unicode and ascii chars
//CHECK#1
var __str = "\u0041A\u0042B\u0043C";
if (__str !== 'AABBCC'){
$ERROR('#1: var __str = "\\u0041A\\u0042B\\u0043C"; __str === \'AABBCC\'. Actual: ' + (__str));
throw new Test262Error('#1: var __str = "\\u0041A\\u0042B\\u0043C"; __str === \'AABBCC\'. Actual: ' + (__str));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (__str !== 'AABBCC'){
//CHECK#2
var __str__ = "\u0041\u0042\u0043"+'ABC';
if (__str__ !== 'ABCABC'){
$ERROR('#2: var __str__ = "\\u0041\\u0042\\u0043"+\'ABC\'; __str__ === \'ABCABC\'. Actual: ' + (__str__));
throw new Test262Error('#2: var __str__ = "\\u0041\\u0042\\u0043"+\'ABC\'; __str__ === \'ABCABC\'. Actual: ' + (__str__));
};
//
//////////////////////////////////////////////////////////////////////////////
@ -29,7 +29,7 @@ if (__str__ !== 'ABCABC'){
//CHECK#3
var str__ = "ABC"+'\u0041\u0042\u0043';
if (str__ !== "ABCABC"){
$ERROR('#2: var str__ = "ABC"+\'\\u0041\\u0042\\u0043\'; str__ === "ABCABC". Actual: ' + (str__));
throw new Test262Error('#2: var str__ = "ABC"+\'\\u0041\\u0042\\u0043\'; str__ === "ABCABC". Actual: ' + (str__));
};
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ description: Check constructor of simple assigned variable
//CHECK#1
var str = "rock'n'roll";
if (str.constructor !== String){
$ERROR('#1: var str = "rock\'n\'roll"; str.constructor === String. Actual: ' + (str.constructor));
throw new Test262Error('#1: var str = "rock\'n\'roll"; str.constructor === String. Actual: ' + (str.constructor));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ description: Create empty string and check it type
// CHECK#1
var str = '';
if (typeof(str) !== 'string'){
$ERROR('#1: var str = \'\'; typeof(str) === \'string\'. Actual: ' + (typeof(str)));
throw new Test262Error('#1: var str = \'\'; typeof(str) === \'string\'. Actual: ' + (typeof(str)));
}
//
////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (typeof(str) !== 'string'){
// CHECK#2
var str = "";
if (typeof(str) !== "string"){
$ERROR('#2: var str = ""; typeof(str) === "string". Actual: ' + (str));
throw new Test262Error('#2: var str = ""; typeof(str) === "string". Actual: ' + (str));
}
//
////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ var __str = "ABCDEFGH";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__str.length !== 8) {
$ERROR('#1: var __str = "ABCDEFGH"; __str.length === 8. Actual: ' + (__str.length));
throw new Test262Error('#1: var __str = "ABCDEFGH"; __str.length === 8. Actual: ' + (__str.length));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -11,7 +11,7 @@ var __str = "";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__str.length !== 0) {
$ERROR('#1: var __str = ""; __str.length === 0. Actual: ' + (__str));
throw new Test262Error('#1: var __str = ""; __str.length === 0. Actual: ' + (__str));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -9,10 +9,10 @@ description: Insert "\0" into string
// CHECK#1
if ("x\0y" === "x") {
$ERROR('#1: "x\\0y" !== "x"');
throw new Test262Error('#1: "x\\0y" !== "x"');
}
// CHECK#2
if (!(("x\0a" < "x\0b") && ("x\0b" < "x\0c"))) {
$ERROR('#2: (("x\\0a" < "x\\0b") && ("x\\0b" < "x\\0c")) === true');
throw new Test262Error('#2: (("x\\0a" < "x\\0b") && ("x\\0b" < "x\\0c")) === true');
}

View File

@ -11,7 +11,7 @@ description: Assign variable by large string
// Check#1
var largeStr='Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompan Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Ap';
if(largeStr !== 'Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompan Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Ap'){
$ERROR('#1: Large string 4096 bytes');
throw new Test262Error('#1: Large string 4096 bytes');
}
//
////////////////////////////////////////////////////

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ var str='';
////////////////////////////////////////////////////////////
// CHECK#1
if (str == undefined){
$ERROR('#1: Empty string and undefined are not equal (!=) to each other');
throw new Test262Error('#1: Empty string and undefined are not equal (!=) to each other');
}
//
/////////////////////////////////////////////////////////////
@ -22,7 +22,7 @@ if (str == undefined){
////////////////////////////////////////////////////////////
// CHECK#2
if (str == null){
$ERROR('#1: Empty string and Null are not equal (!=) to each other');
throw new Test262Error('#1: Empty string and Null are not equal (!=) to each other');
}
//
/////////////////////////////////////////////////////////////
@ -30,7 +30,7 @@ if (str == null){
////////////////////////////////////////////////////////////
// CHECK#3
if (str != 0){
$ERROR('#3: Empty string and 0 are equal (==) to each other, since they all evaluate to 0');
throw new Test262Error('#3: Empty string and 0 are equal (==) to each other, since they all evaluate to 0');
}
//
/////////////////////////////////////////////////////////////
@ -38,7 +38,7 @@ if (str != 0){
////////////////////////////////////////////////////////////
// CHECK#4
if (str != false){
$ERROR('#4: Empty string and false are equal (==) to each other, since they all evaluate to 0');
throw new Test262Error('#4: Empty string and false are equal (==) to each other, since they all evaluate to 0');
}
//
/////////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ var strObj=new String('ABC');
////////////////////////////////////////////////////////////
// CHECK#1
if (str.constructor !== strObj.constructor){
$ERROR('#1: \'ABC\'.constructor === new String(\'ABC\').constructor');
throw new Test262Error('#1: \'ABC\'.constructor === new String(\'ABC\').constructor');
}
//
/////////////////////////////////////////////////////////////
@ -21,7 +21,7 @@ if (str.constructor !== strObj.constructor){
////////////////////////////////////////////////////////////
// CHECK#2
if (str != strObj){
$ERROR('#2: "ABC" == new String("ABC")');
throw new Test262Error('#2: "ABC" == new String("ABC")');
}
//
/////////////////////////////////////////////////////////////
@ -29,7 +29,7 @@ if (str != strObj){
////////////////////////////////////////////////////////////
// CHECK#3
if (str === strObj){
$ERROR('#3: "ABC" !== new String("ABC")');
throw new Test262Error('#3: "ABC" !== new String("ABC")');
}
//
/////////////////////////////////////////////////////////////

View File

@ -16,7 +16,7 @@ var strObj_=new String();
////////////////////////////////////////////////////////////
// CHECK#1
if (str.constructor !== strObj.constructor){
$ERROR('#1: "".constructor === new String("").constructor');
throw new Test262Error('#1: "".constructor === new String("").constructor');
}
//
/////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ if (str.constructor !== strObj.constructor){
////////////////////////////////////////////////////////////
// CHECK#2
if (str.constructor !== strObj_.constructor){
$ERROR('#2: "".constructor === new String().constructor');
throw new Test262Error('#2: "".constructor === new String().constructor');
}
//
/////////////////////////////////////////////////////////////
@ -32,7 +32,7 @@ if (str.constructor !== strObj_.constructor){
////////////////////////////////////////////////////////////
// CHECK#3
if (str != strObj){
$ERROR('#3: values of str=""; and strObj=new String(""); are equal');
throw new Test262Error('#3: values of str=""; and strObj=new String(""); are equal');
}
//
/////////////////////////////////////////////////////////////
@ -40,7 +40,7 @@ if (str != strObj){
////////////////////////////////////////////////////////////
// CHECK#4
if (str === strObj){
$ERROR('#4: objects of str=""; and strObj=new String(""); are different');
throw new Test262Error('#4: objects of str=""; and strObj=new String(""); are different');
}
//
/////////////////////////////////////////////////////////////
@ -48,7 +48,7 @@ if (str === strObj){
////////////////////////////////////////////////////////////
// CHECK#5
if (str != strObj_){
$ERROR('#5: values of str=""; and strObj=new String(); are equal');
throw new Test262Error('#5: values of str=""; and strObj=new String(); are equal');
}
//
/////////////////////////////////////////////////////////////
@ -56,7 +56,7 @@ if (str != strObj_){
////////////////////////////////////////////////////////////
// CHECK#6
if (str === strObj_){
$ERROR('#6: objects of str=""; and strObj=new String(); are different');
throw new Test262Error('#6: objects of str=""; and strObj=new String(); are different');
}
//
/////////////////////////////////////////////////////////////

View File

@ -13,7 +13,7 @@ var strObj=new String;
////////////////////////////////////////////////////////////
// CHECK#1
if (str.constructor !== strObj.constructor){
$ERROR('#1: "".constructor === new String.constructor');
throw new Test262Error('#1: "".constructor === new String.constructor');
}
//
/////////////////////////////////////////////////////////////
@ -21,7 +21,7 @@ if (str.constructor !== strObj.constructor){
////////////////////////////////////////////////////////////
// CHECK#2
if (str != strObj){
$ERROR('#2: values of str=""; and strObj=new String(""); are equal');
throw new Test262Error('#2: values of str=""; and strObj=new String(""); are equal');
}
//
/////////////////////////////////////////////////////////////
@ -29,7 +29,7 @@ if (str != strObj){
////////////////////////////////////////////////////////////
// CHECK#3
if (str === strObj){
$ERROR('#3: objects of str=""; and strObj=new String(""); are different');
throw new Test262Error('#3: objects of str=""; and strObj=new String(""); are different');
}
//
/////////////////////////////////////////////////////////////
@ -37,7 +37,7 @@ if (str === strObj){
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (typeof str == typeof strObj){
$ERROR('#4: types of str=""; and strObj=new String(""); are different');
throw new Test262Error('#4: types of str=""; and strObj=new String(""); are different');
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ var x;
///////////////////////////////////////////////////////////////////
// CHECK#1
if (!(x === undefined)) {
$ERROR('#1: var x; x === undefined. Actual: ' + (x));
throw new Test262Error('#1: var x; x === undefined. Actual: ' + (x));
}
//
///////////////////////////////////////////////////////////////////
@ -20,7 +20,7 @@ if (!(x === undefined)) {
///////////////////////////////////////////////////////////////////
// CHECK#2
if (!(typeof(x) === "undefined")) {
$ERROR('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x)));
throw new Test262Error('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x)));
}
//
///////////////////////////////////////////////////////////////////
@ -28,7 +28,7 @@ if (!(typeof(x) === "undefined")) {
///////////////////////////////////////////////////////////////////
// CHECK#3
if (!(x === void 0)) {
$ERROR('#3: var x; x === void 0. Actual: ' + (x));
throw new Test262Error('#3: var x; x === void 0. Actual: ' + (x));
}
//
///////////////////////////////////////////////////////////////////

View File

@ -13,13 +13,13 @@ function test1(x) {
}
if (!(test1() === void 0)) {
$ERROR('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1()));
throw new Test262Error('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1()));
}
// CHECK#2
function test2() {
function test2() {
}
if (!(test2() === void 0)) {
$ERROR('#2: function test2(){} test2() === void 0. Actual: ' + (test2()));
throw new Test262Error('#2: function test2(){} test2() === void 0. Actual: ' + (test2()));
}

View File

@ -7,7 +7,7 @@ es5id: 8.1_A4
description: Check value of not existed property
---*/
// CHECK#1
// CHECK#1
if ((new Object()).newProperty !== undefined) {
$ERROR('#1: (new Object()).newProperty === undefined. Actual: ' + ((new Object()).newProperty));
throw new Test262Error('#1: (new Object()).newProperty === undefined. Actual: ' + ((new Object()).newProperty));
}

View File

@ -12,7 +12,7 @@ description: Call function without provided argument
function test(arg) {
// Check and make sure that arg is not undefined
if (typeof(arg) !== "undefined") {
$ERROR('#1: Function argument that isn\'t provided has a value of undefined. Actual: ' + (typeof(arg)));
throw new Test262Error('#1: Function argument that isn\'t provided has a value of undefined. Actual: ' + (typeof(arg)));
}
}