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

This commit is contained in:
Rick Waldron 2021-07-22 13:31:45 -04:00 committed by GitHub
parent f37edcb486
commit 6e2a29417a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
171 changed files with 356 additions and 356 deletions

View File

@ -16,4 +16,4 @@ var x = new function f1() {
return 1;
};
if (typeof(x.constructor) !== "function")
$ERROR('#1: typeof(x.constructor)!=="function"');
throw new Test262Error('#1: typeof(x.constructor)!=="function"');

View File

@ -13,12 +13,12 @@ var f = Function("return arguments[0];");
//CHECK#1
if (!(f instanceof Function)) {
$ERROR('#1: f instanceof Function');
throw new Test262Error('#1: f instanceof Function');
}
//CHECK#2
if (f(1) !== 1) {
$ERROR('#2: f(1) !== 1');
throw new Test262Error('#2: f(1) !== 1');
}
var g = new Function("return arguments[0];");
@ -26,15 +26,15 @@ var g = new Function("return arguments[0];");
//CHECK#3
if (!(g instanceof Function)) {
$ERROR('#3: g instanceof Function');
throw new Test262Error('#3: g instanceof Function');
}
//CHECK#4
if (g("A") !== "A") {
$ERROR('#4: g("A") !== "A"');
throw new Test262Error('#4: g("A") !== "A"');
}
//CHECK#5
if (g("A") !== f("A")) {
$ERROR('#5: g("A") !== f("A")');
throw new Test262Error('#5: g("A") !== f("A")');
}

View File

@ -23,9 +23,9 @@ var body = {
//CHECK#1
try {
var f = new Function(body);
$ERROR('#1: When the Function constructor is called with one argument then body be that argument the following step are taken: call ToString(body)');
throw new Test262Error('#1: When the Function constructor is called with one argument then body be that argument the following step are taken: call ToString(body)');
} catch (e) {
if (e !== 7) {
$ERROR('#1.1: When the Function constructor is called with one argument then body be that argument the following step are taken: call ToString(body)');
throw new Test262Error('#1.1: When the Function constructor is called with one argument then body be that argument the following step are taken: call ToString(body)');
}
}

View File

@ -18,15 +18,15 @@ description: Value of the function constructor argument is "null"
try {
var f = new Function(null);
} catch (e) {
$ERROR('#1: test fails with error ' + e);
throw new Test262Error('#1: test fails with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -18,15 +18,15 @@ description: Value of the function constructor argument is "undefined"
try {
var f = new Function(undefined);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -18,15 +18,15 @@ description: Value of the function constructor argument is "void 0"
try {
var f = new Function(void 0);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -17,9 +17,9 @@ description: Value of the function constructor argument is "{}"
//CHECK#1
try {
var f = new Function({});
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1.1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
throw new Test262Error('#1.1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
}
}

View File

@ -26,15 +26,15 @@ var body = {
try {
var f = new Function(body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== 1) {
$ERROR('#3: hen the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: hen the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -18,15 +18,15 @@ description: Value of the function constructor argument is 1
try {
var f = new Function(1);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -20,17 +20,17 @@ description: >
try {
var f = new Function(x);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}
var x;

View File

@ -22,15 +22,15 @@ var body = Object("return \'A\'");
try {
var f = new Function(body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== "\u0041") {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -20,15 +20,15 @@ description: >
try {
var f = new Function("return true;");
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (!(f())) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -20,15 +20,15 @@ var body = new Object(1);
try {
var f = new Function(body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -19,9 +19,9 @@ var body = "var 1=1;";
//CHECK#1
try {
var f = new Function(body);
$ERROR('#1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
throw new Test262Error('#1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1.1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
throw new Test262Error('#1.1: If body is not parsable as FunctionBody then throw a SyntaxError exception');
}
}

View File

@ -20,10 +20,10 @@ var f = new Function("return arguments[0];");
//CHECK#1
if (!(f instanceof Function)) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument and the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument and the following steps are taken...');
}
//CHECK#2
if (f("A") !== "A") {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and the following steps are taken...');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and the following steps are taken...');
}

View File

@ -15,15 +15,15 @@ description: >
try {
var f = Function("arg1", "arg2", "arg3", "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f(1, 2, 3) !== 6) {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -15,15 +15,15 @@ description: >
try {
var f = Function("arg1, arg2", "arg3", "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f("AB", "BA", 1) !== "ABBA1") {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -15,15 +15,15 @@ description: >
try {
var f = Function("arg1, arg2, arg3", "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f(1, 1, "ABBA") !== "2ABBA") {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -23,15 +23,15 @@ var p = {
try {
var f = Function(p, p, p, "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f(4, "2", "QUESTION") !== "42QUESTION") {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -23,15 +23,15 @@ var p = {
try {
var f = Function(p + "," + p, p, "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f("", 1, 2) !== "12") {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -23,15 +23,15 @@ var p = {
try {
var f = Function(p + "," + p + "," + p, "return arg1+arg2+arg3;");
} catch (e) {
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
}
//CHECK#2
if (!(f instanceof Function)) {
$ERROR('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#2: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}
//CHECK#3
if (f("", 1, p) !== "1arg4") {
$ERROR('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
throw new Test262Error('#3: It is permissible but not necessary to have one argument for each formal parameter to be specified');
}

View File

@ -33,9 +33,9 @@ var body = {
//CHECK#1
try {
var f = new Function(p, body);
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
} catch (e) {
if (e !== 1) {
$ERROR('#1.1: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
throw new Test262Error('#1.1: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
}
}

View File

@ -28,9 +28,9 @@ var p = {
//CHECK#1
try {
var f = new Function(p, body);
$ERROR('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
}
}

View File

@ -24,15 +24,15 @@ var p = "a,b,c";
try {
var f = new Function(p, void 0);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
}

View File

@ -24,15 +24,15 @@ var p = "a,b,c";
try {
var f = new Function(p, undefined);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
}

View File

@ -22,15 +22,15 @@ var p = "a,b,c";
try {
var f = new Function(p, null);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
}

View File

@ -24,17 +24,17 @@ var p = "a,b,c";
try {
var f = new Function(p, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
}
var body;

View File

@ -22,15 +22,15 @@ description: >
try {
var f = new Function("", "");
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== undefined) {
$ERROR('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body the following steps are taken...');
}

View File

@ -29,15 +29,15 @@ var body = "return a;";
try {
var f = new Function(p, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f(42) !== 42) {
$ERROR('#3: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
throw new Test262Error('#3: When the Function constructor is called with arguments p, body creates a new Function object as specified in 13.2');
}

View File

@ -34,14 +34,14 @@ var body = {
//CHECK#1
try {
var f = new Function(p, body);
$ERROR('#1: test failed');
throw new Test262Error('#1: test failed');
} catch (e) {
if (e !== "body") {
$ERROR('#1.1: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
throw new Test262Error('#1.1: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
}
}
//CHECK#2
if (p !== 1) {
$ERROR('#2: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
throw new Test262Error('#2: i) Let Result(i) be the first argument; ii) Let P be ToString(Result(i))');
}

View File

@ -24,17 +24,17 @@ var body = "return 1.1;";
try {
var f = new Function(p, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== 1.1) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}
var p;

View File

@ -24,15 +24,15 @@ var body = "return \"A\";";
try {
var f = new Function(void 0, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== '\u0041') {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -23,9 +23,9 @@ var body = "return true;";
//CHECK#1
try {
var f = new Function(null, body);
$ERROR('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
}
}

View File

@ -26,15 +26,15 @@ var p = Object("a");
try {
var f = new Function(p, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f(1) !== 1) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -24,15 +24,15 @@ var body = "return this;";
try {
var f = new Function(undefined, body);
} catch (e) {
$ERROR('#1: test failed with error ' + e);
throw new Test262Error('#1: test failed with error ' + e);
}
//CHECK#2
if (f.constructor !== Function) {
$ERROR('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
throw new Test262Error('#2: When the Function constructor is called with one argument then body be that argument and creates a new Function object as specified in 13.2');
}
//CHECK#3
if (f() !== this) {
$ERROR('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
throw new Test262Error('#3: When the Function constructor is called with one argument then body be that argument the following steps are taken...');
}

View File

@ -24,9 +24,9 @@ var p = "1,1";
//CHECK#1
try {
var f = new Function(p, body);
$ERROR('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
throw new Test262Error('#1.1: If P is not parsable as a FormalParameterList_opt then throw a SyntaxError exception');
}
}

View File

@ -15,10 +15,10 @@ var f = new Function;
//CHECK#1
if (f.constructor !== Function) {
$ERROR('#1: When Function is called as part of a new expression, it is a constructor: it initialises the newly created object');
throw new Test262Error('#1: When Function is called as part of a new expression, it is a constructor: it initialises the newly created object');
}
//CHECK#2
if (f === undefined) {
$ERROR('#2: When Function is called as part of a new expression, it is a constructor: it initialises the newly created object');
throw new Test262Error('#2: When Function is called as part of a new expression, it is a constructor: it initialises the newly created object');
}

View File

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

View File

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

View File

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

View File

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

View File

@ -10,5 +10,5 @@ description: For testing use variable f = new Function
var f = new Function;
if (Object.prototype.toString.call(f) !== "[object Function]") {
$ERROR('#1: The value of the [[Class]] property is "Function"');
throw new Test262Error('#1: The value of the [[Class]] property is "Function"');
}

View File

@ -10,5 +10,5 @@ description: For testing use variable f = Function()
var f = Function();
if (Object.prototype.toString.call(f) !== "[object Function]") {
$ERROR('#1: The value of the [[Class]] property is "Function"');
throw new Test262Error('#1: The value of the [[Class]] property is "Function"');
}

View File

@ -9,15 +9,15 @@ description: For testing call Function("var x =1; this.y=2;return \"OK\";")()
//CHECK#1
if (Function("var x =1; this.y=2;return \"OK\";")() !== "OK") {
$ERROR('#1: Every function instance has a [[Call]] property');
throw new Test262Error('#1: Every function instance has a [[Call]] property');
}
//CHECK#2
if (typeof x !== "undefined") {
$ERROR('#2: Every function instance has a [[Call]] property');
throw new Test262Error('#2: Every function instance has a [[Call]] property');
}
//CHECK#3
if (y !== 2) {
$ERROR('#3: Every function instance has a [[Call]] property');
throw new Test262Error('#3: Every function instance has a [[Call]] property');
}

View File

@ -11,15 +11,15 @@ description: >
//CHECK#1
if ((new Function("arg1,arg2", "var x =arg1; this.y=arg2;return arg1+arg2;"))("1", 2) !== "12") {
$ERROR('#1: Every function instance has a [[Call]] property');
throw new Test262Error('#1: Every function instance has a [[Call]] property');
}
//CHECK#2
if (typeof x !== "undefined") {
$ERROR('#2: Every function instance has a [[Call]] property');
throw new Test262Error('#2: Every function instance has a [[Call]] property');
}
//CHECK#3
if (y !== 2) {
$ERROR('#3: Every function instance has a [[Call]] property');
throw new Test262Error('#3: Every function instance has a [[Call]] property');
}

View File

@ -12,15 +12,15 @@ var obj = new FACTORY;
//CHECK#1
if (typeof obj !== "object") {
$ERROR('#1: every function instance has a [[Construct]] property');
throw new Test262Error('#1: every function instance has a [[Construct]] property');
}
//CHECK#2
if (obj.constructor !== FACTORY) {
$ERROR('#2: every function instance has a [[Construct]] property');
throw new Test262Error('#2: every function instance has a [[Construct]] property');
}
//CHECK#3
if (obj.y !== 2) {
$ERROR('#3: every function instance has a [[Construct]] property');
throw new Test262Error('#3: every function instance has a [[Construct]] property');
}

View File

@ -14,15 +14,15 @@ var obj = new FACTORY("1", 2);
//CHECK#1
if (typeof obj !== "object") {
$ERROR('#1: every function instance has a [[Construct]] property');
throw new Test262Error('#1: every function instance has a [[Construct]] property');
}
//CHECK#2
if (obj.constructor !== FACTORY) {
$ERROR('#2: every function instance has a [[Construct]] property');
throw new Test262Error('#2: every function instance has a [[Construct]] property');
}
//CHECK#3
if (obj.y !== "12") {
$ERROR('#3: every function instance has a [[Construct]] property');
throw new Test262Error('#3: every function instance has a [[Construct]] property');
}

View File

@ -12,5 +12,5 @@ var obj = Function;
var thisobj = this.Function;
if (obj !== thisobj) {
$ERROR('Function is the property of global');
throw new Test262Error('Function is the property of global');
}

View File

@ -15,6 +15,6 @@ try {
Function.call(this, "var x / = 1;");
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1: function body must be valid');
throw new Test262Error('#1: function body must be valid');
}
}

View File

@ -15,6 +15,6 @@ try {
Function.call(this, "var #x = 1;");
} catch (e) {
if (!(e instanceof SyntaxError)) {
$ERROR('#1: function body must be valid');
throw new Test262Error('#1: function body must be valid');
}
}

View File

@ -23,10 +23,10 @@ var about_mars = f();
//CHECK#2
if (about_mars !== undefined) {
$ERROR('#2: When applied to the Function object itself, thisArg should be ignored');
throw new Test262Error('#2: When applied to the Function object itself, thisArg should be ignored');
}
//CHECK#3
if (this.godname !== "ares" && mars.godname === undefined) {
$ERROR('#3: When applied to the Function object itself, thisArg should be ignored');
throw new Test262Error('#3: When applied to the Function object itself, thisArg should be ignored');
}

View File

@ -16,12 +16,12 @@ var f = Function.call("blablastring", "return this.color;");
//CHECK#1
if (f() !== "red") {
$ERROR('#1: ');
throw new Test262Error('#1: ');
}
var g = Function.call(null, "return this.planet;");
//CHECK#2
if (g() !== "mars") {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}

View File

@ -14,28 +14,28 @@ var g = Function.call(this, "return color;");
//CHECK#1
if (f() !== undefined) {
$ERROR('#1: ');
throw new Test262Error('#1: ');
}
var planet = "mars";
//CHECK#2
if (f() !== "mars") {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}
//CHECK#3
try {
g();
$ERROR('#3: ');
throw new Test262Error('#3: ');
} catch (e) {
if (!(e instanceof ReferenceError))
$ERROR('#3.1: ');
throw new Test262Error('#3.1: ');
}
this.color = "red";
//CHECK#4
if (g() !== "red") {
$ERROR('#4: ');
throw new Test262Error('#4: ');
}

View File

@ -13,12 +13,12 @@ var f = Function.call(this, "return planet;");
//CHECK#1
if (f() !== undefined) {
$ERROR('#1: ');
throw new Test262Error('#1: ');
}
var planet = "mars";
//CHECK#2
if (f() !== "mars") {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}

View File

@ -16,24 +16,24 @@ var g = Function.call(this, "return this.color;");
//CHECK#1
if (f() !== undefined) {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}
var planet = "mars";
//CHECK#2
if (f() !== "mars") {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}
//CHECK#3
if (g() !== undefined) {
$ERROR('#3: ');
throw new Test262Error('#3: ');
}
this.color = "red";
//CHECK#4
if (g() !== "red") {
$ERROR('#4: ');
throw new Test262Error('#4: ');
}

View File

@ -15,12 +15,12 @@ var f = Function.call(this, "return this.planet;");
//CHECK#1
if (f() !== undefined) {
$ERROR('#1: ');
throw new Test262Error('#1: ');
}
var planet = "mars";
//CHECK#2
if (f() !== "mars") {
$ERROR('#2: ');
throw new Test262Error('#2: ');
}

View File

@ -13,10 +13,10 @@ var f = new Function("arg1,arg2,arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
//CHECK#2
if (f.length !== 3) {
$ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
throw new Test262Error('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
}

View File

@ -15,10 +15,10 @@ var f = Function("arg1,arg2,arg3", "arg4,arg5", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
//CHECK#2
if (f.length !== 5) {
$ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
throw new Test262Error('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
}

View File

@ -15,10 +15,10 @@ var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
//CHECK#2
if (f.length !== 6) {
$ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
throw new Test262Error('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
}

View File

@ -13,20 +13,20 @@ var f = new Function("arg1,arg2,arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
//CHECK#2
if (!delete f.length) {
$ERROR('#2: the function.length property does not have the attributes DontDelete.');
throw new Test262Error('#2: the function.length property does not have the attributes DontDelete.');
}
//CHECK#3
if (f.hasOwnProperty('length')) {
$ERROR('#3: the function.length property does not have the attributes DontDelete.');
throw new Test262Error('#3: the function.length property does not have the attributes DontDelete.');
}
//CHECK#4
if (f.length === 3) {
$ERROR('#4: the length property does not have the attributes { DontDelete }');
throw new Test262Error('#4: the length property does not have the attributes { DontDelete }');
}

View File

@ -13,17 +13,17 @@ var f = Function("arg1,arg2,arg3", "arg4,arg5", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
delete f.length;
//CHECK#2
if (f.hasOwnProperty('length')) {
$ERROR('#2: the function.length property does not have the attributes DontDelete.');
throw new Test262Error('#2: the function.length property does not have the attributes DontDelete.');
}
//CHECK#3
if (f.length === 5) {
$ERROR('#3: the length property does not have the attributes { DontDelete }');
throw new Test262Error('#3: the length property does not have the attributes { DontDelete }');
}

View File

@ -13,17 +13,17 @@ var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
delete f.length;
//CHECK#2
if (f.hasOwnProperty('length')) {
$ERROR('#2: the function.length property does not have the attributes DontDelete.');
throw new Test262Error('#2: the function.length property does not have the attributes DontDelete.');
}
//CHECK#3
if (f.length === 6) {
$ERROR('#3: the length property does not have the attributes { DontDelete }');
throw new Test262Error('#3: the length property does not have the attributes { DontDelete }');
}

View File

@ -14,7 +14,7 @@ var f = new Function("arg1,arg2,arg3", "arg4,arg5", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
var flength = f.length;
@ -23,18 +23,18 @@ verifyNotWritable(f, "length", null, function() {});
//CHECK#2
if (f.length !== flength) {
$ERROR('#2: the function.length property has the attributes ReadOnly');
throw new Test262Error('#2: the function.length property has the attributes ReadOnly');
}
//CHECK#3
try {
f.length();
$ERROR('#3: the function.length property has the attributes ReadOnly');
throw new Test262Error('#3: the function.length property has the attributes ReadOnly');
} catch (e) {
if (e instanceof Test262Error) throw e;
}
//CHECK#4
if (f.length !== 5) {
$ERROR('#4: the length property has the attributes { ReadOnly }');
throw new Test262Error('#4: the length property has the attributes { ReadOnly }');
}

View File

@ -14,7 +14,7 @@ var f = Function("arg1,arg2,arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
var flength = f.length;
@ -23,18 +23,18 @@ verifyNotWritable(f, "length", null, function() {});
//CHECK#2
if (f.length !== flength) {
$ERROR('#2: the function.length property has the attributes ReadOnly');
throw new Test262Error('#2: the function.length property has the attributes ReadOnly');
}
//CHECK#3
try {
f.length();
$ERROR('#3: the function.length property has the attributes ReadOnly');
throw new Test262Error('#3: the function.length property has the attributes ReadOnly');
} catch (e) {
if (e instanceof Test262Error) throw e;
}
//CHECK#4
if (f.length !== 3) {
$ERROR('#4: the length property has the attributes { ReadOnly }');
throw new Test262Error('#4: the length property has the attributes { ReadOnly }');
}

View File

@ -14,7 +14,7 @@ var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
var flength = f.length;
@ -23,18 +23,18 @@ verifyNotWritable(f, "length", null, function() {});
//CHECK#2
if (f.length !== flength) {
$ERROR('#2: the function.length property has the attributes ReadOnly');
throw new Test262Error('#2: the function.length property has the attributes ReadOnly');
}
//CHECK#3
try {
f.length();
$ERROR('#3: the function.length property has the attributes ReadOnly');
throw new Test262Error('#3: the function.length property has the attributes ReadOnly');
} catch (e) {
if (e instanceof Test262Error) throw e;
}
//CHECK#4
if (f.length !== 6) {
$ERROR('#4: the length property has the attributes { ReadOnly }');
throw new Test262Error('#4: the length property has the attributes { ReadOnly }');
}

View File

@ -13,7 +13,7 @@ var f = new Function("arg1,arg2,arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
for (var key in f) {
@ -23,5 +23,5 @@ for (var key in f) {
}
//CHECK#2
if (lengthenumed) {
$ERROR('#2: the length property has the attributes { DontEnum }');
throw new Test262Error('#2: the length property has the attributes { DontEnum }');
}

View File

@ -13,7 +13,7 @@ var f = Function("arg1,arg2,arg3", "arg5,arg4", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
for (var key in f) {
@ -24,5 +24,5 @@ for (var key in f) {
//CHECK#2
if (lengthenumed) {
$ERROR('#2: the length property has the attributes { DontEnum }');
throw new Test262Error('#2: the length property has the attributes { DontEnum }');
}

View File

@ -13,7 +13,7 @@ var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
//CHECK#1
if (!(f.hasOwnProperty('length'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
for (var key in f) {
@ -24,5 +24,5 @@ for (var key in f) {
//CHECK#2
if (lengthenumed) {
$ERROR('#2: the length property has the attributes { DontEnum }');
throw new Test262Error('#2: the length property has the attributes { DontEnum }');
}

View File

@ -16,14 +16,14 @@ verifyNotWritable(Function, "prototype", null, function() {
//CHECK#1
if (Function.prototype !== obj) {
$ERROR('#1: the Function.prototype property has the attributes ReadOnly.');
throw new Test262Error('#1: the Function.prototype property has the attributes ReadOnly.');
}
//CHECK#2
try {
if (Function.prototype() !== undefined) {
$ERROR('#2: the Function.prototype property has the attributes ReadOnly');
throw new Test262Error('#2: the Function.prototype property has the attributes ReadOnly');
}
} catch (e) {
$ERROR('#2.1: the Function.prototype property has the attributes ReadOnly: ' + e);
throw new Test262Error('#2.1: the Function.prototype property has the attributes ReadOnly: ' + e);
}

View File

@ -9,7 +9,7 @@ description: Checking if enumerating the Function.prototype property fails
// CHECK#1
if (Function.propertyIsEnumerable('prototype')) {
$ERROR('#1: the Function.prototype property has the attributes DontEnum');
throw new Test262Error('#1: the Function.prototype property has the attributes DontEnum');
}
// CHECK#2
@ -20,5 +20,5 @@ for (var p in Function) {
}
if (count !== 0) {
$ERROR('#2: the Function.prototype property has the attributes DontEnum');
throw new Test262Error('#2: the Function.prototype property has the attributes DontEnum');
}

View File

@ -13,7 +13,7 @@ verifyNotConfigurable(Function, "prototype");
//CHECK#1
try {
if ((delete Function.prototype) !== false) {
$ERROR('#1: Function.prototype has the attribute DontDelete');
throw new Test262Error('#1: Function.prototype has the attribute DontDelete');
}
} catch (e) {
if (e instanceof Test262Error) throw e;
@ -22,5 +22,5 @@ try {
//CHECK#2
if (!(Function.hasOwnProperty('prototype'))) {
$ERROR('#2: the Function.prototype property has the attributes DontDelete.');
throw new Test262Error('#2: the Function.prototype property has the attributes DontDelete.');
}

View File

@ -20,5 +20,5 @@ Object.defineProperty(foo, 'prototype', {
});
if (foo.prototype !==
Object.getOwnPropertyDescriptor(foo, 'prototype').value) {
$ERROR("A function.prototype's descriptor lies");
throw new Test262Error("A function.prototype's descriptor lies");
}

View File

@ -10,6 +10,6 @@ description: Object.prototype.toString returns [object+[[Class]]+]
---*/
if (Object.prototype.toString.call(Function.prototype) !== "[object Function]") {
$ERROR('#2: The Function prototype object is itself a Function ' +
throw new Test262Error('#2: The Function prototype object is itself a Function ' +
'object (its [[Class]] is "Function") (15.3.4)');
}

View File

@ -12,8 +12,8 @@ description: Call Function.prototype()
//CHECK#1
try {
if (Function.prototype() !== undefined) {
$ERROR('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
throw new Test262Error('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
}
} catch (e) {
$ERROR('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
throw new Test262Error('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
}

View File

@ -12,8 +12,8 @@ description: Call Function.prototype(null,void 0)
//CHECK#1
try {
if (Function.prototype(null, void 0) !== undefined) {
$ERROR('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
throw new Test262Error('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
}
} catch (e) {
$ERROR('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
throw new Test262Error('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
}

View File

@ -13,8 +13,8 @@ description: Call Function.prototype(x), where x is undefined variable
try {
if (Function.prototype(x) !== undefined) {
var x;
$ERROR('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
throw new Test262Error('#1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined');
}
} catch (e) {
$ERROR('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
throw new Test262Error('#1.1: The Function prototype object is itself a Function object that, when invoked, accepts any arguments and returns undefined: ' + e);
}

View File

@ -10,7 +10,7 @@ description: Checking prototype of Function.prototype
---*/
if (Object.getPrototypeOf(Function.prototype) !== Object.prototype) {
$ERROR('#1: The value of the internal [[Prototype]] property of ' +
throw new Test262Error('#1: The value of the internal [[Prototype]] property of ' +
'the Function prototype object is the Object prototype ' +
'object (15.3.4)');
}

View File

@ -15,5 +15,5 @@ Object.prototype.indicator = 1;
//CHECK#1
if (Function.prototype.indicator !== 1) {
$ERROR('#1: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
throw new Test262Error('#1: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
}

View File

@ -12,15 +12,15 @@ description: Checking valueOf property at Function.prototype
//CHECK#1
if (Function.prototype.hasOwnProperty("valueOf") !== false) {
$ERROR('#1: The Function prototype object does not have a valueOf property of its own');
throw new Test262Error('#1: The Function prototype object does not have a valueOf property of its own');
}
//CHECK#2
if (typeof Function.prototype.valueOf === "undefined") {
$ERROR('#2: however, it inherits the valueOf property from the Object prototype Object');
throw new Test262Error('#2: however, it inherits the valueOf property from the Object prototype Object');
}
//CHECK#3
if (Function.prototype.valueOf !== Object.prototype.valueOf) {
$ERROR('#3: however, it inherits the valueOf property from the Object prototype Object');
throw new Test262Error('#3: however, it inherits the valueOf property from the Object prototype Object');
}

View File

@ -14,7 +14,7 @@ var f = new Function("", null);
//CHECK#1
if (!(f.hasOwnProperty('prototype'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
var fproto = f.prototype;
@ -24,7 +24,7 @@ verifyNotConfigurable(f, "prototype");
//CHECK#2
try {
if ((delete f.prototype) !== false) {
$ERROR('#2: the prototype property has the attributes { DontDelete }');
throw new Test262Error('#2: the prototype property has the attributes { DontDelete }');
}
} catch (e) {
if (e instanceof Test262Error) throw e;
@ -33,5 +33,5 @@ try {
//CHECK#3
if (f.prototype !== fproto) {
$ERROR('#3: the prototype property has the attributes { DontDelete }');
throw new Test262Error('#3: the prototype property has the attributes { DontDelete }');
}

View File

@ -14,7 +14,7 @@ var f = Function(void 0, "");
//CHECK#1
if (!(f.hasOwnProperty('prototype'))) {
$ERROR('#1: the function has length property.');
throw new Test262Error('#1: the function has length property.');
}
var fproto = f.prototype;
@ -24,7 +24,7 @@ verifyNotConfigurable(f, "prototype");
//CHECK#2
try {
if ((delete f.prototype) !== false) {
$ERROR('#2: the prototype property has the attributes { DontDelete }');
throw new Test262Error('#2: the prototype property has the attributes { DontDelete }');
}
} catch (e) {
if (e instanceof Test262Error) throw e;
@ -33,5 +33,5 @@ try {
//CHECK#3
if (f.prototype !== fproto) {
$ERROR('#3: the prototype property has the attributes { DontDelete }');
throw new Test262Error('#3: the prototype property has the attributes { DontDelete }');
}

View File

@ -11,5 +11,5 @@ description: >
//CHECK#1
if (Function.prototype.apply.prototype !== undefined) {
$ERROR('#1: Function.prototype.apply has not prototype property' + Function.prototype.apply.prototype);
throw new Test262Error('#1: Function.prototype.apply has not prototype property' + Function.prototype.apply.prototype);
}

View File

@ -22,15 +22,15 @@ var obj = new FACTORY;
//CHECK#1
if (typeof obj.apply !== "function") {
$ERROR('#1: apply method accessed');
throw new Test262Error('#1: apply method accessed');
}
//CHECK#2
try {
obj.apply();
$ERROR('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown');
throw new Test262Error('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown');
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown');
throw new Test262Error('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown');
}
}

View File

@ -20,15 +20,15 @@ var obj = new FACTORY;
//CHECK#1
if (typeof obj.apply !== "function") {
$ERROR('#1: apply method accessed');
throw new Test262Error('#1: apply method accessed');
}
//CHECK#2
try {
obj.apply();
$ERROR('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown');
throw new Test262Error('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown');
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown');
throw new Test262Error('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown');
}
}

View File

@ -13,5 +13,5 @@ Function("this.field=\"strawberry\"").apply();
//CHECK#1
if (this["field"] !== "strawberry") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -14,5 +14,5 @@ eval(" (function(){this.feat=1}).apply()");
//CHECK#1
if (this["feat"] !== 1) {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -13,5 +13,5 @@ Function("this.field=\"green\"").apply(null);
//CHECK#1
if (this["field"] !== "green") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -13,5 +13,5 @@ Function("this.field=\"battle\"").apply(void 0);
//CHECK#1
if (this["field"] !== "battle") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -13,5 +13,5 @@ Function("this.field=\"oil\"").apply(undefined);
//CHECK#1
if (this["field"] !== "oil") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -19,10 +19,10 @@ var obj = new FACTORY;
//CHECK#1
if (this["feat"] !== "in da haus") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}
//CHECK#2
if (typeof obj.feat !== "undefined") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -22,10 +22,10 @@ var obj = new FACTORY;
//CHECK#1
if (this["feat"] !== "kamon beyba") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}
//CHECK#2
if (typeof obj.feat !== "undefined") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -18,5 +18,5 @@ description: >
//CHECK#1
if (this["feat"] !== "in da haus") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -20,5 +20,5 @@ flags: [noStrict]
//CHECK#1
if (this["feat"] !== "kamon beyba") {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -13,5 +13,5 @@ eval(" Function(\"this.feat=1\").apply(void 0) ");
//CHECK#1
if (this["feat"] !== 1) {
$ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
throw new Test262Error('#1: If thisArg is null or undefined, the called function is passed the global object as the this value');
}

View File

@ -15,10 +15,10 @@ var retobj = Function("this.touched= true; return this;").apply(obj);
//CHECK#1
if (typeof obj.touched !== "undefined") {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}
//CHECK#2
if (!(retobj["touched"])) {
$ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}

View File

@ -15,10 +15,10 @@ var retobj = new Function("this.touched= true; return this;").apply(obj);
//CHECK#1
if (typeof obj.touched !== "undefined") {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}
//CHECK#2
if (!(retobj["touched"])) {
$ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}

View File

@ -19,10 +19,10 @@ var retobj = (function() {
//CHECK#1
if (typeof obj.touched !== "undefined") {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}
//CHECK#2
if (!(retobj["touched"])) {
$ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}

View File

@ -19,12 +19,12 @@ retobj = f.apply(obj);
//CHECK#1
if (typeof obj !== "undefined") {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}
//CHECK#2
if (!(retobj["touched"])) {
$ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}
var obj;

View File

@ -19,5 +19,5 @@ f.apply(obj);
//CHECK#1
if (!(obj.touched)) {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}

View File

@ -17,5 +17,5 @@ var obj = new String("soap");
//CHECK#1
if (!(obj.touched)) {
$ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
throw new Test262Error('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value');
}

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