Merge pull request #411 from anba/remove-runTestCase-language

Replace runTestCase in test/language
This commit is contained in:
Brian Terlson 2015-08-06 10:24:08 -07:00
commit 9cb89a4e3c
188 changed files with 374 additions and 1025 deletions

View File

@ -4,15 +4,11 @@
/*--- /*---
es5id: 10.5-7-b-2-s es5id: 10.5-7-b-2-s
description: Arguments object index assignment is allowed description: Arguments object index assignment is allowed
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function _10_5_7_b_2_fun() { function _10_5_7_b_2_fun() {
arguments[7] = 12; arguments[7] = 12;
return arguments[7] === 12; return arguments[7] === 12;
}; };
return _10_5_7_b_2_fun(30); assert(_10_5_7_b_2_fun(30), '_10_5_7_b_2_fun(30) !== true');
}
runTestCase(testcase);

View File

@ -5,15 +5,11 @@
es5id: 10.5-7-b-3-s es5id: 10.5-7-b-3-s
description: > description: >
Adding property to the arguments object successful under strict mode Adding property to the arguments object successful under strict mode
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function _10_5_7_b_3_fun() { function _10_5_7_b_3_fun() {
arguments[1] = 12; arguments[1] = 12;
return arguments[0] === 30 && arguments[1] === 12; return arguments[0] === 30 && arguments[1] === 12;
}; };
return _10_5_7_b_3_fun(30); assert(_10_5_7_b_3_fun(30), '_10_5_7_b_3_fun(30) !== true');
}
runTestCase(testcase);

View File

@ -5,16 +5,13 @@
es5id: 10.5-7-b-4-s es5id: 10.5-7-b-4-s
description: > description: >
Deleting property of the arguments object successful under strict mode Deleting property of the arguments object successful under strict mode
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function _10_5_7_b_4_fun() { function _10_5_7_b_4_fun() {
var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12; var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12;
delete arguments[1]; delete arguments[1];
var _10_5_7_b_4_2 = arguments[0] === 30 && typeof arguments[1] === "undefined"; var _10_5_7_b_4_2 = arguments[0] === 30 && typeof arguments[1] === "undefined";
return _10_5_7_b_4_1 && _10_5_7_b_4_2; return _10_5_7_b_4_1 && _10_5_7_b_4_2;
}; };
return _10_5_7_b_4_fun(30, 12);
} assert(_10_5_7_b_4_fun(30, 12), '_10_5_7_b_4_fun(30, 12) !== true');
runTestCase(testcase);

View File

@ -7,15 +7,12 @@ description: >
arguments[i] remains same after changing actual parameters in arguments[i] remains same after changing actual parameters in
strict mode strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo(a,b,c) function foo(a,b,c)
{ {
a = 1; b = 'str'; c = 2.1; a = 1; b = 'str'; c = 2.1;
return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1); return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1);
} }
return foo(10, 'sss', 1);
} assert(foo(10, 'sss', 1), 'foo(10, "sss", 1) !== true');
runTestCase(testcase);

View File

@ -5,16 +5,13 @@
es5id: 10.6-10-c-ii-1 es5id: 10.6-10-c-ii-1
description: arguments[i] change with actual parameters description: arguments[i] change with actual parameters
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo(a,b,c) function foo(a,b,c)
{ {
a = 1; b = 'str'; c = 2.1; a = 1; b = 'str'; c = 2.1;
if(arguments[0] === 1 && arguments[1] === 'str' && arguments[2] === 2.1) if(arguments[0] === 1 && arguments[1] === 'str' && arguments[2] === 2.1)
return true; return true;
} }
return foo(10,'sss',1);
} assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
runTestCase(testcase);

View File

@ -5,16 +5,12 @@
es5id: 10.6-10-c-ii-2-s es5id: 10.6-10-c-ii-2-s
description: arguments[i] doesn't map to actual parameters in strict mode description: arguments[i] doesn't map to actual parameters in strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo(a,b,c) function foo(a,b,c)
{ {
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1; arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
return 10 === a && 'sss' === b && 1 === c; return 10 === a && 'sss' === b && 1 === c;
} }
return foo(10,'sss',1);
} assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
runTestCase(testcase);

View File

@ -5,17 +5,13 @@
es5id: 10.6-10-c-ii-2 es5id: 10.6-10-c-ii-2
description: arguments[i] map to actual parameter description: arguments[i] map to actual parameter
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo(a,b,c) function foo(a,b,c)
{ {
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1; arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
if(1 === a && 'str' === b && 2.1 === c) if(1 === a && 'str' === b && 2.1 === c)
return true; return true;
} }
return foo(10,'sss',1);
} assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
runTestCase(testcase);

View File

@ -5,10 +5,8 @@
es5id: 10.6-13-a-2 es5id: 10.6-13-a-2
description: A direct call to arguments.callee.caller should work description: A direct call to arguments.callee.caller should work
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var called = false; var called = false;
function test1(flag) { function test1(flag) {
@ -28,7 +26,5 @@ function testcase() {
} }
test1(); test1();
return called;
}
runTestCase(testcase); assert(called, 'called !== true');

View File

@ -5,10 +5,8 @@
es5id: 10.6-13-a-3 es5id: 10.6-13-a-3
description: An indirect call to arguments.callee.caller should work description: An indirect call to arguments.callee.caller should work
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var called = false; var called = false;
function test1(flag) { function test1(flag) {
@ -29,7 +27,5 @@ function testcase() {
} }
test1(); test1();
return called;
}
runTestCase(testcase); assert(called, 'called !== true');

View File

@ -5,13 +5,11 @@
es5id: 10.6-14-1-s es5id: 10.6-14-1-s
description: Strict Mode - 'callee' exists and 'caller' exists under strict mode description: Strict Mode - 'callee' exists and 'caller' exists under strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var argObj = function () { var argObj = function () {
return arguments; return arguments;
} (); } ();
return argObj.hasOwnProperty("callee") && argObj.hasOwnProperty("caller");
} assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');
runTestCase(testcase); assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - [[Enumerable]] attribute value in 'caller' is false Strict Mode - [[Enumerable]] attribute value in 'caller' is false
under strict mode under strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var argObj = function () { var argObj = function () {
return arguments; return arguments;
} (); } ();
@ -21,6 +19,6 @@ function testcase() {
verifyEnumerable = true; verifyEnumerable = true;
} }
} }
return !verifyEnumerable && argObj.hasOwnProperty("caller");
} assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
runTestCase(testcase); assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');

View File

@ -5,10 +5,8 @@
es5id: 10.6-14-c-1-s es5id: 10.6-14-c-1-s
description: > description: >
[[Enumerable]] attribute value in 'callee' is false [[Enumerable]] attribute value in 'callee' is false
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var argObj = function () { var argObj = function () {
return arguments; return arguments;
} (); } ();
@ -19,6 +17,6 @@ function testcase() {
verifyEnumerable = true; verifyEnumerable = true;
} }
} }
return !verifyEnumerable && argObj.hasOwnProperty("callee");
} assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
runTestCase(testcase); assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');

View File

@ -6,13 +6,8 @@ es5id: 11.1.4-0
description: > description: >
elements elided at the end of an array do not contribute to its elements elided at the end of an array do not contribute to its
length length
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var a = [,]; var a = [,];
if (a.length === 1) {
return true; assert.sameValue(a.length, 1, 'a.length');
}
}
runTestCase(testcase);

View File

@ -5,15 +5,13 @@
es5id: 8.14.4-8-b_1 es5id: 8.14.4-8-b_1
description: Non-writable property on a prototype written to. description: Non-writable property on a prototype written to.
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() {}; function foo() {};
Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); Object.defineProperty(foo.prototype, "bar", {value: "unwritable"});
var o = new foo(); var o = new foo();
o.bar = "overridden"; o.bar = "overridden";
return o.hasOwnProperty("bar")===false && o.bar==="unwritable";
} assert.sameValue(o.hasOwnProperty("bar"), false, 'o.hasOwnProperty("bar")');
runTestCase(testcase); assert.sameValue(o.bar, "unwritable", 'o.bar');

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-12-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(*=) evaluates to a resolvable reference Assignment operator(*=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_12 = 5 var _11_13_2_12 = 5
_11_13_2_12 *= 2; _11_13_2_12 *= 2;
return _11_13_2_12 === 10;
} assert.sameValue(_11_13_2_12, 10, '_11_13_2_12');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-13-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(/=) evaluates to a resolvable reference Assignment operator(/=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_13 = 6 var _11_13_2_13 = 6
_11_13_2_13 /= 2; _11_13_2_13 /= 2;
return _11_13_2_13 === 3;
} assert.sameValue(_11_13_2_13, 3, '_11_13_2_13');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-14-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(%=) evaluates to a resolvable reference Assignment operator(%=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_14 = 5 var _11_13_2_14 = 5
_11_13_2_14 %= 2; _11_13_2_14 %= 2;
return _11_13_2_14 === 1;
} assert.sameValue(_11_13_2_14, 1, '_11_13_2_14');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-15-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(>>>=) evaluates to a resolvable reference Assignment operator(>>>=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_15 = 8 var _11_13_2_15 = 8
_11_13_2_15 >>>= 2; _11_13_2_15 >>>= 2;
return _11_13_2_15 === 2;
} assert.sameValue(_11_13_2_15, 2, '_11_13_2_15');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-16-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(-=) evaluates to a resolvable reference Assignment operator(-=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_16 = 5 var _11_13_2_16 = 5
_11_13_2_16 -= 2; _11_13_2_16 -= 2;
return _11_13_2_16 === 3;
} assert.sameValue(_11_13_2_16, 3, '_11_13_2_16');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-17-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(<<=) evaluates to a resolvable reference Assignment operator(<<=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_17 = 1; var _11_13_2_17 = 1;
_11_13_2_17 <<= 2; _11_13_2_17 <<= 2;
return _11_13_2_17 === 4;
} assert.sameValue(_11_13_2_17, 4, '_11_13_2_17');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-18-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(>>=) evaluates to a resolvable reference Assignment operator(>>=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_18 = 4 var _11_13_2_18 = 4
_11_13_2_18 >>= 2; _11_13_2_18 >>= 2;
return _11_13_2_18 === 1;
} assert.sameValue(_11_13_2_18, 1, '_11_13_2_18');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-19-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(+=) evaluates to a resolvable reference Assignment operator(+=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_19 = -1 var _11_13_2_19 = -1
_11_13_2_19 += 10; _11_13_2_19 += 10;
return _11_13_2_19 === 9;
} assert.sameValue(_11_13_2_19, 9, '_11_13_2_19');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-20-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(&=) evaluates to a resolvable reference Assignment operator(&=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_20 = 5 var _11_13_2_20 = 5
_11_13_2_20 &= 3; _11_13_2_20 &= 3;
return _11_13_2_20 === 1;
} assert.sameValue(_11_13_2_20, 1, '_11_13_2_20');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-21-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(^=) evaluates to a resolvable reference Assignment operator(^=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_21 = 5 var _11_13_2_21 = 5
_11_13_2_21 ^= 3; _11_13_2_21 ^= 3;
return _11_13_2_21 === 6;
} assert.sameValue(_11_13_2_21, 6, '_11_13_2_21');
runTestCase(testcase);

View File

@ -6,12 +6,9 @@ es5id: 11.13.2-22-s
description: > description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(|=) evaluates to a resolvable reference Assignment operator(|=) evaluates to a resolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_13_2_22 = 5 var _11_13_2_22 = 5
_11_13_2_22 |= 2; _11_13_2_22 |= 2;
return _11_13_2_22 === 7;
} assert.sameValue(_11_13_2_22, 7, '_11_13_2_22');
runTestCase(testcase);

View File

@ -6,15 +6,12 @@ es5id: 11.4.1-2-2
description: > description: >
delete operator returns true when deleting returned value from a delete operator returns true when deleting returned value from a
function function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var bIsFooCalled = false; var bIsFooCalled = false;
var foo = function(){bIsFooCalled = true;}; var foo = function(){bIsFooCalled = true;};
var d = delete foo(); var d = delete foo();
if(d === true && bIsFooCalled === true)
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(bIsFooCalled, true, 'bIsFooCalled');
runTestCase(testcase);

View File

@ -6,13 +6,8 @@ es5id: 11.4.1-2-3
description: > description: >
delete operator returns true when deleting a non-reference delete operator returns true when deleting a non-reference
(boolean) (boolean)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var d = delete true; var d = delete true;
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -4,13 +4,8 @@
/*--- /*---
es5id: 11.4.1-2-4 es5id: 11.4.1-2-4
description: delete operator returns true when deleting a non-reference (string) description: delete operator returns true when deleting a non-reference (string)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var d = delete "abc"; var d = delete "abc";
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -4,13 +4,8 @@
/*--- /*---
es5id: 11.4.1-2-5 es5id: 11.4.1-2-5
description: delete operator returns true when deleting a non-reference (obj) description: delete operator returns true when deleting a non-reference (obj)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var d = delete {a:0} ; var d = delete {a:0} ;
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -4,13 +4,8 @@
/*--- /*---
es5id: 11.4.1-2-6 es5id: 11.4.1-2-6
description: delete operator returns true when deleting a non-reference (null) description: delete operator returns true when deleting a non-reference (null)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var d = delete null; var d = delete null;
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -7,14 +7,9 @@ description: >
delete operator returns true when deleting an unresolvable delete operator returns true when deleting an unresolvable
reference reference
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
// just cooking up a long/veryLikely unique name // just cooking up a long/veryLikely unique name
var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_0__; var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_0__;
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -6,14 +6,9 @@ es5id: 11.4.1-3-3
description: > description: >
delete operator returns true when deleting an explicitly qualified delete operator returns true when deleting an explicitly qualified
yet unresolvable reference (property undefined for base obj) yet unresolvable reference (property undefined for base obj)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var __ES3_1_test_suite_test_11_4_1_3_unique_id_3__ = {}; var __ES3_1_test_suite_test_11_4_1_3_unique_id_3__ = {};
var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_3__.x; var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_3__.x;
if (d === true) {
return true; assert.sameValue(d, true, 'd');
}
}
runTestCase(testcase);

View File

@ -5,10 +5,8 @@
es5id: 11.4.1-4-a-3-s es5id: 11.4.1-4-a-3-s
description: > description: >
TypeError isn't thrown when deleting configurable data property TypeError isn't thrown when deleting configurable data property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: "abc", value: "abc",
@ -16,6 +14,5 @@ function testcase() {
}); });
delete obj.prop; delete obj.prop;
return !obj.hasOwnProperty("prop");
} assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")');
runTestCase(testcase);

View File

@ -5,10 +5,8 @@
es5id: 11.4.1-4-a-4-s es5id: 11.4.1-4-a-4-s
description: > description: >
TypeError isn't thrown when deleting configurable accessor property TypeError isn't thrown when deleting configurable accessor property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -18,6 +16,5 @@ function testcase() {
}); });
delete obj.prop; delete obj.prop;
return !obj.hasOwnProperty("prop");
} assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")');
runTestCase(testcase);

View File

@ -9,18 +9,14 @@ es5id: 11.4.1-4.a-1
description: > description: >
delete operator returns true when deleting a configurable data delete operator returns true when deleting a configurable data
property property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = {}; var o = {};
var desc = { value: 1, configurable: true }; var desc = { value: 1, configurable: true };
Object.defineProperty(o, "foo", desc); Object.defineProperty(o, "foo", desc);
var d = delete o.foo; var d = delete o.foo;
if (d === true && o.hasOwnProperty("foo") === false) {
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');
}
runTestCase(testcase);

View File

@ -8,15 +8,11 @@ info: >
es5id: 11.4.1-4.a-12 es5id: 11.4.1-4.a-12
description: delete operator returns false when deleting a property(length) description: delete operator returns false when deleting a property(length)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var a = [1,2,3] var a = [1,2,3]
a.x = 10; a.x = 10;
var d = delete a.length var d = delete a.length
if(d === false && a.length === 3)
return true; assert.sameValue(d, false, 'd');
} assert.sameValue(a.length, 3, 'a.length');
runTestCase(testcase);

View File

@ -7,15 +7,11 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here. language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-14 es5id: 11.4.1-4.a-14
description: delete operator returns true when deleting Array elements description: delete operator returns true when deleting Array elements
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var a = [1,2,3] var a = [1,2,3]
a.x = 10; a.x = 10;
var d = delete a[1] var d = delete a[1]
if(d === true && a[1] === undefined)
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(a[1], undefined, 'a[1]');
runTestCase(testcase);

View File

@ -7,15 +7,11 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here. language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-15 es5id: 11.4.1-4.a-15
description: delete operator returns true when deleting Array expandos description: delete operator returns true when deleting Array expandos
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var a = [1,2,3] var a = [1,2,3]
a.x = 10; a.x = 10;
var d = delete a.x; var d = delete a.x;
if( d === true && a.x === undefined)
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(a.x, undefined, 'a.x');
runTestCase(testcase);

View File

@ -9,10 +9,8 @@ es5id: 11.4.1-4.a-2
description: > description: >
delete operator returns true when deleting a configurable accessor delete operator returns true when deleting a configurable accessor
property property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = {}; var o = {};
// define an accessor // define an accessor
@ -22,8 +20,6 @@ function testcase() {
Object.defineProperty(o, "foo", desc); Object.defineProperty(o, "foo", desc);
var d = delete o.foo; var d = delete o.foo;
if (d === true && o.hasOwnProperty("foo") === false) {
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');
}
runTestCase(testcase);

View File

@ -10,18 +10,14 @@ description: >
delete operator returns false when deleting a non-configurable delete operator returns false when deleting a non-configurable
data property data property
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = {}; var o = {};
var desc = { value : 1, configurable: false }; // all other attributes default to false var desc = { value : 1, configurable: false }; // all other attributes default to false
Object.defineProperty(o, "foo", desc); Object.defineProperty(o, "foo", desc);
// Now, deleting o.foo should fail because [[Configurable]] on foo is false. // Now, deleting o.foo should fail because [[Configurable]] on foo is false.
var d = delete o.foo; var d = delete o.foo;
if (d === false && o.hasOwnProperty("foo") === true) {
return true; assert.sameValue(d, false, 'd');
} assert.sameValue(o.hasOwnProperty("foo"), true, 'o.hasOwnProperty("foo")');
}
runTestCase(testcase);

View File

@ -10,14 +10,9 @@ description: >
delete operator returns false when deleting a non-configurable delete operator returns false when deleting a non-configurable
data property (NaN) data property (NaN)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
// NaN (15.1.1.1) has [[Configurable]] set to false. // NaN (15.1.1.1) has [[Configurable]] set to false.
var d = delete NaN; var d = delete NaN;
if (d === false) {
return true; assert.sameValue(d, false, 'd');
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ info: >
es5id: 11.4.1-4.a-6 es5id: 11.4.1-4.a-6
description: delete operator returns true when deleting a property inside 'with' description: delete operator returns true when deleting a property inside 'with'
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = new Object(); var o = new Object();
o.x = 1; o.x = 1;
var d; var d;
@ -19,8 +17,6 @@ function testcase() {
{ {
d = delete x; d = delete x;
} }
if (d === true && o.x === undefined) {
return true; assert.sameValue(d, true, 'd');
} assert.sameValue(o.x, undefined, 'o.x');
}
runTestCase(testcase);

View File

@ -10,13 +10,8 @@ description: >
delete operator returns false when deleting a non-configurable delete operator returns false when deleting a non-configurable
data property (Math.LN2) data property (Math.LN2)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var d = delete Math.LN2; var d = delete Math.LN2;
if (d === false) {
return true; assert.sameValue(d, false, 'd');
}
}
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
delete operator returns false when deleting a direct reference to delete operator returns false when deleting a direct reference to
a function argument a function argument
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo(a,b) { function foo(a,b) {
// Now, deleting 'a' directly should fail // Now, deleting 'a' directly should fail
@ -19,6 +16,5 @@ function testcase() {
var d = delete a; var d = delete a;
return (d === false && a === 1); return (d === false && a === 1);
} }
return foo(1,2);
} assert(foo(1,2), 'foo(1,2) !== true');
runTestCase(testcase);

View File

@ -4,12 +4,7 @@
/*--- /*---
es5id: 11.4.1-5-a-28-s es5id: 11.4.1-5-a-28-s
description: Strict Mode - TypeError is not thrown when deleting RegExp.length description: Strict Mode - TypeError is not thrown when deleting RegExp.length
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var a = new RegExp(); var a = new RegExp();
var b = delete RegExp.length; var b = delete RegExp.length;
return true;
}
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.2-1
description: > description: >
11.8.2 Greater-than Operator - Partial left to right order 11.8.2 Greater-than Operator - Partial left to right order
enforced when using Greater-than operator: valueOf > valueOf enforced when using Greater-than operator: valueOf > valueOf
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
valueOf: function () { valueOf: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return !(obj1 > obj2);
} assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.2-2
description: > description: >
11.8.2 Greater-than Operator - Partial left to right order 11.8.2 Greater-than Operator - Partial left to right order
enforced when using Greater-than operator: valueOf > toString enforced when using Greater-than operator: valueOf > toString
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
valueOf: function () { valueOf: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return !(obj1 > obj2);
} assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.2-3
description: > description: >
11.8.2 Greater-than Operator - Partial left to right order 11.8.2 Greater-than Operator - Partial left to right order
enforced when using Greater-than operator: toString > valueOf enforced when using Greater-than operator: toString > valueOf
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
toString: function () { toString: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return !(obj1 > obj2);
} assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.2-4
description: > description: >
11.8.2 Greater-than Operator - Partial left to right order 11.8.2 Greater-than Operator - Partial left to right order
enforced when using Greater-than operator: toString > toString enforced when using Greater-than operator: toString > toString
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
toString: function () { toString: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return !(obj1 > obj2);
} assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.3-1
description: > description: >
11.8.3 Less-than-or-equal Operator - Partial left to right order 11.8.3 Less-than-or-equal Operator - Partial left to right order
enforced when using Less-than-or-equal operator: valueOf <= valueOf enforced when using Less-than-or-equal operator: valueOf <= valueOf
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
valueOf: function () { valueOf: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return (obj1 <= obj2);
} assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
11.8.3 Less-than-or-equal Operator - Partial left to right order 11.8.3 Less-than-or-equal Operator - Partial left to right order
enforced when using Less-than-or-equal operator: valueOf <= enforced when using Less-than-or-equal operator: valueOf <=
toString toString
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
valueOf: function () { valueOf: function () {
@ -27,6 +25,5 @@ function testcase() {
} }
} }
}; };
return (obj1 <= obj2);
} assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
11.8.3 Less-than-or-equal Operator - Partial left to right order 11.8.3 Less-than-or-equal Operator - Partial left to right order
enforced when using Less-than-or-equal operator: toString <= enforced when using Less-than-or-equal operator: toString <=
valueOf valueOf
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
toString: function () { toString: function () {
@ -27,6 +25,5 @@ function testcase() {
} }
} }
}; };
return (obj1 <= obj2);
} assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
11.8.3 Less-than-or-equal Operator - Partial left to right order 11.8.3 Less-than-or-equal Operator - Partial left to right order
enforced when using Less-than-or-equal operator: toString <= enforced when using Less-than-or-equal operator: toString <=
toString toString
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
toString: function () { toString: function () {
@ -27,6 +25,5 @@ function testcase() {
} }
} }
}; };
return (obj1 <= obj2);
} assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 11.8.3-5
description: > description: >
11.8.3 Less-than-or-equal Operator - Partial left to right order 11.8.3 Less-than-or-equal Operator - Partial left to right order
enforced when using Less-than-or-equal operator: valueOf <= valueOf enforced when using Less-than-or-equal operator: valueOf <= valueOf
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj1 = { var obj1 = {
valueOf: function () { valueOf: function () {
@ -26,6 +24,5 @@ function testcase() {
} }
} }
}; };
return (obj1 <= obj2);
} assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
runTestCase(testcase);

View File

@ -5,11 +5,6 @@
es5id: 11.1.5-4-4-a-1-s es5id: 11.1.5-4-4-a-1-s
description: > description: >
Object literal - No SyntaxError for duplicate data property names Object literal - No SyntaxError for duplicate data property names
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({foo:0,foo:1});"); eval("({foo:0,foo:1});");
return true;
}
runTestCase(testcase);

View File

@ -12,12 +12,6 @@ es5id: 11.1.5_4-4-a-2
description: > description: >
Object literal - Duplicate data property name allowed if not in Object literal - Duplicate data property name allowed if not in
strict mode strict mode
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({foo:0,foo:1});"); eval("({foo:0,foo:1});");
return true;
}
runTestCase(testcase);

View File

@ -12,12 +12,8 @@ es5id: 11.1.5_4-4-a-3
description: > description: >
Object literal - Duplicate data property name allowed gets last Object literal - Duplicate data property name allowed gets last
defined value defined value
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = eval("({foo:0,foo:1});"); var o = eval("({foo:0,foo:1});");
return o.foo===1;
} assert.sameValue(o.foo, 1, 'o.foo');
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-b-1
description: > description: >
Object literal - No SyntaxError if a data property definition is Object literal - No SyntaxError if a data property definition is
followed by get accessor definition with the same name followed by get accessor definition with the same name
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({foo : 1, get foo(){}});"); eval("({foo : 1, get foo(){}});");
return true;
}
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-b-2
description: > description: >
Object literal - No SyntaxError if a data property definition is Object literal - No SyntaxError if a data property definition is
followed by set accessor definition with the same name followed by set accessor definition with the same name
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({foo : 1, set foo(x){}});"); eval("({foo : 1, set foo(x){}});");
return true;
}
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-c-1
description: > description: >
Object literal - No SyntaxError if a get accessor property definition Object literal - No SyntaxError if a get accessor property definition
is followed by a data property definition with the same name is followed by a data property definition with the same name
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({get foo(){}, foo : 1});"); eval("({get foo(){}, foo : 1});");
return true;
}
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-c-2
description: > description: >
Object literal - No SyntaxError if a set accessor property definition Object literal - No SyntaxError if a set accessor property definition
is followed by a data property definition with the same name is followed by a data property definition with the same name
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({set foo(x){}, foo : 1});"); eval("({set foo(x){}, foo : 1});");
return true;
}
runTestCase(testcase);

View File

@ -4,11 +4,6 @@
/*--- /*---
es5id: 11.1.5_4-4-d-1 es5id: 11.1.5_4-4-d-1
description: Object literal - No SyntaxError for duplicate property name (get,get) description: Object literal - No SyntaxError for duplicate property name (get,get)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({get foo(){}, get foo(){}});"); eval("({get foo(){}, get foo(){}});");
return true;
}
runTestCase(testcase);

View File

@ -4,11 +4,6 @@
/*--- /*---
es5id: 11.1.5_4-4-d-2 es5id: 11.1.5_4-4-d-2
description: Object literal - No SyntaxError for duplicate property name (set,set) description: Object literal - No SyntaxError for duplicate property name (set,set)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({set foo(arg){}, set foo(arg1){}});"); eval("({set foo(arg){}, set foo(arg1){}});");
return true;
}
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-d-3
description: > description: >
Object literal - No SyntaxError for duplicate property name Object literal - No SyntaxError for duplicate property name
(get,set,get) (get,set,get)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({get foo(){}, set foo(arg){}, get foo(){}});"); eval("({get foo(){}, set foo(arg){}, get foo(){}});");
return true;
}
runTestCase(testcase);

View File

@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-d-4
description: > description: >
Object literal - No SyntaxError for duplicate property name Object literal - No SyntaxError for duplicate property name
(set,get,set) (set,get,set)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});"); eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});");
return true;
}
runTestCase(testcase);

View File

@ -9,17 +9,12 @@ info: >
4.Let desc be the Property Descriptor{[[Value]]: propValue, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true} 4.Let desc be the Property Descriptor{[[Value]]: propValue, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}
es5id: 11.1.5_5-4-1 es5id: 11.1.5_5-4-1
description: Object literal - property descriptor for assignment expression description: Object literal - property descriptor for assignment expression
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = {foo : 1}; var o = {foo : 1};
var desc = Object.getOwnPropertyDescriptor(o,"foo"); var desc = Object.getOwnPropertyDescriptor(o,"foo");
if(desc.value === 1 &&
desc.writable === true && assert.sameValue(desc.value, 1, 'desc.value');
desc.enumerable === true && assert.sameValue(desc.writable, true, 'desc.writable');
desc.configurable === true) assert.sameValue(desc.enumerable, true, 'desc.enumerable');
return true; assert.sameValue(desc.configurable, true, 'desc.configurable');
}
runTestCase(testcase);

View File

@ -9,15 +9,11 @@ info: >
3.Let desc be the Property Descriptor{[[Get]]: closure, [[Enumerable]]: true, [[Configurable]]: true} 3.Let desc be the Property Descriptor{[[Get]]: closure, [[Enumerable]]: true, [[Configurable]]: true}
es5id: 11.1.5_6-3-1 es5id: 11.1.5_6-3-1
description: Object literal - property descriptor for get property assignment description: Object literal - property descriptor for get property assignment
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o; var o;
eval("o = {get foo(){return 1;}};"); eval("o = {get foo(){return 1;}};");
var desc = Object.getOwnPropertyDescriptor(o,"foo"); var desc = Object.getOwnPropertyDescriptor(o,"foo");
if(desc.enumerable === true &&
desc.configurable === true) assert.sameValue(desc.enumerable, true, 'desc.enumerable');
return true; assert.sameValue(desc.configurable, true, 'desc.configurable');
}
runTestCase(testcase);

View File

@ -11,13 +11,10 @@ es5id: 11.1.5_6-3-2
description: > description: >
Object literal - property descriptor for get property assignment Object literal - property descriptor for get property assignment
should not create a set function should not create a set function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o; var o;
eval("o = {get foo(){return 1;}};"); eval("o = {get foo(){return 1;}};");
var desc = Object.getOwnPropertyDescriptor(o,"foo"); var desc = Object.getOwnPropertyDescriptor(o,"foo");
return desc.set === undefined
} assert.sameValue(desc.set, undefined, 'desc.set');
runTestCase(testcase);

View File

@ -9,15 +9,11 @@ info: >
3.Let desc be the Property Descriptor{[[Set]]: closure, [[Enumerable]]: true, [[Configurable]]: true} 3.Let desc be the Property Descriptor{[[Set]]: closure, [[Enumerable]]: true, [[Configurable]]: true}
es5id: 11.1.5_7-3-1 es5id: 11.1.5_7-3-1
description: Object literal - property descriptor for set property assignment description: Object literal - property descriptor for set property assignment
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o; var o;
eval("o = {set foo(arg){return 1;}};"); eval("o = {set foo(arg){return 1;}};");
var desc = Object.getOwnPropertyDescriptor(o,"foo"); var desc = Object.getOwnPropertyDescriptor(o,"foo");
if(desc.enumerable === true &&
desc.configurable === true) assert.sameValue(desc.enumerable, true, 'desc.enumerable');
return true; assert.sameValue(desc.configurable, true, 'desc.configurable');
}
runTestCase(testcase);

View File

@ -11,13 +11,10 @@ es5id: 11.1.5_7-3-2
description: > description: >
Object literal - property descriptor for set property assignment Object literal - property descriptor for set property assignment
should not create a get function should not create a get function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o; var o;
eval("o = {set foo(arg){}};"); eval("o = {set foo(arg){}};");
var desc = Object.getOwnPropertyDescriptor(o,"foo"); var desc = Object.getOwnPropertyDescriptor(o,"foo");
return desc.get === undefined
} assert.sameValue(desc.get, undefined, 'desc.get');
runTestCase(testcase);

View File

@ -5,11 +5,8 @@
es5id: 10.4.3-1-1-s es5id: 10.4.3-1-1-s
description: this is not coerced to an object in strict mode (Number) description: this is not coerced to an object in strict mode (Number)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() function foo()
{ {
'use strict'; 'use strict';
@ -22,6 +19,5 @@ function testcase() {
} }
return foo.call(1) === 'number' && bar.call(1) === 'object'; assert.sameValue(foo.call(1), 'number', 'foo.call(1)');
} assert.sameValue(bar.call(1), 'object', 'bar.call(1)');
runTestCase(testcase);

View File

@ -7,14 +7,11 @@ description: >
Strict Mode - checking 'this' (FunctionExpression includes strict Strict Mode - checking 'this' (FunctionExpression includes strict
directive prologue) directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = function () { var f = function () {
"use strict"; "use strict";
return typeof this; return typeof this;
} }
return f() === "undefined";
} assert.sameValue(f(), "undefined", 'f()');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 10.4.3-1-100-s
description: > description: >
Strict Mode - checking 'this' (strict function passed as arg to Strict Mode - checking 'this' (strict function passed as arg to
String.prototype.replace) String.prototype.replace)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var x = 3; var x = 3;
function f() { function f() {
@ -17,6 +15,6 @@ function f() {
x = this; x = this;
return "a"; return "a";
} }
return ("ab".replace("b", f)==="aa") && (x===undefined);
} assert.sameValue("ab".replace("b", f), "aa", '"ab".replace("b", f)');
runTestCase(testcase); assert.sameValue(x, undefined, 'x');

View File

@ -7,11 +7,8 @@ description: >
Strict Mode - checking 'this' (Function constructor defined within Strict Mode - checking 'this' (Function constructor defined within
strict mode) strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = Function("return typeof this;"); var f = Function("return typeof this;");
return f() !== "undefined";
} assert.notSameValue(f(), "undefined", 'f()');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Strict Mode - checking 'this' (Function constructor includes Strict Mode - checking 'this' (Function constructor includes
strict directive prologue) strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = Function("\"use strict\";\nreturn typeof this;"); var f = Function("\"use strict\";\nreturn typeof this;");
return f() === "undefined";
} assert.sameValue(f(), "undefined", 'f()');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Strict Mode - checking 'this' (New'ed Function constructor defined Strict Mode - checking 'this' (New'ed Function constructor defined
within strict mode) within strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = new Function("return typeof this;"); var f = new Function("return typeof this;");
return f() !== "undefined";
} assert.notSameValue(f(), "undefined", 'f()');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Strict Mode - checking 'this' (New'ed Function constructor Strict Mode - checking 'this' (New'ed Function constructor
includes strict directive prologue) includes strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = new Function("\"use strict\";\nreturn typeof this;"); var f = new Function("\"use strict\";\nreturn typeof this;");
return f() === "undefined";
} assert.sameValue(f(), "undefined", 'f()');
runTestCase(testcase);

View File

@ -5,11 +5,8 @@
es5id: 10.4.3-1-2-s es5id: 10.4.3-1-2-s
description: this is not coerced to an object in strict mode (string) description: this is not coerced to an object in strict mode (string)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() function foo()
{ {
'use strict'; 'use strict';
@ -22,6 +19,5 @@ function testcase() {
} }
return foo.call('1') === 'string' && bar.call('1') === 'object'; assert.sameValue(foo.call('1'), 'string', 'foo.call("1")');
} assert.sameValue(bar.call('1'), 'object', 'bar.call("1")');
runTestCase(testcase);

View File

@ -7,15 +7,12 @@ description: >
Strict Mode - checking 'this' (New'ed object from Strict Mode - checking 'this' (New'ed object from
FunctionDeclaration defined within strict mode) FunctionDeclaration defined within strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
function f() { function f() {
return this; return this;
} }
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
} assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
runTestCase(testcase); assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');

View File

@ -7,17 +7,13 @@ description: >
Strict Mode - checking 'this' (New'ed object from Strict Mode - checking 'this' (New'ed object from
FunctionDeclaration includes strict directive prologue) FunctionDeclaration includes strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
function f() { function f() {
"use strict"; "use strict";
return this; return this;
} }
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
} assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
runTestCase(testcase); assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');

View File

@ -7,16 +7,12 @@ description: >
Strict Mode - checking 'this' (New'ed object from Strict Mode - checking 'this' (New'ed object from
FunctionExpression defined within strict mode) FunctionExpression defined within strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
var f = function () { var f = function () {
return this; return this;
} }
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
} assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
runTestCase(testcase); assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (New'ed object from Strict Mode - checking 'this' (New'ed object from
FunctionExpression includes strict directive prologue) FunctionExpression includes strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
var f = function () { var f = function () {
"use strict"; "use strict";
return this; return this;
} }
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
} assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
runTestCase(testcase); assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');

View File

@ -7,15 +7,12 @@ description: >
Strict Mode - checking 'this' (New'ed object from Anonymous Strict Mode - checking 'this' (New'ed object from Anonymous
FunctionExpression defined within strict mode) FunctionExpression defined within strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
var obj = new (function () { var obj = new (function () {
return this; return this;
}); });
return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined");
} assert.notSameValue(obj, fnGlobalObject(), 'obj');
runTestCase(testcase); assert.notSameValue((typeof obj), "undefined", '(typeof obj)');

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (New'ed object from Anonymous Strict Mode - checking 'this' (New'ed object from Anonymous
FunctionExpression includes strict directive prologue) FunctionExpression includes strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
var obj = new (function () { var obj = new (function () {
"use strict"; "use strict";
return this; return this;
}); });
return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined");
} assert.notSameValue(obj, fnGlobalObject(), 'obj');
runTestCase(testcase); assert.notSameValue((typeof obj), "undefined", '(typeof obj)');

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (FunctionDeclaration defined within Strict Mode - checking 'this' (FunctionDeclaration defined within
a FunctionDeclaration inside strict mode) a FunctionDeclaration inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
function f() { function f() {
return typeof this; return typeof this;
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (FunctionExpression defined within a Strict Mode - checking 'this' (FunctionExpression defined within a
FunctionDeclaration inside strict mode) FunctionDeclaration inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
var f = function () { var f = function () {
return typeof this; return typeof this;
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,15 +7,12 @@ description: >
Strict Mode - checking 'this' (Anonymous FunctionExpression Strict Mode - checking 'this' (Anonymous FunctionExpression
defined within a FunctionDeclaration inside strict mode) defined within a FunctionDeclaration inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
return ((function () { return ((function () {
return typeof this; return typeof this;
})()==="undefined") && ((typeof this)==="undefined"); })()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -5,11 +5,8 @@
es5id: 10.4.3-1-3-s es5id: 10.4.3-1-3-s
description: this is not coerced to an object in strict mode (undefined) description: this is not coerced to an object in strict mode (undefined)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() function foo()
{ {
'use strict'; 'use strict';
@ -20,6 +17,6 @@ function testcase() {
{ {
return typeof(this); return typeof(this);
} }
return foo.call(undefined) === 'undefined' && bar.call() === 'object';
} assert.sameValue(foo.call(undefined), 'undefined', 'foo.call(undefined)');
runTestCase(testcase); assert.sameValue(bar.call(), 'object', 'bar.call()');

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (FunctionDeclaration defined within Strict Mode - checking 'this' (FunctionDeclaration defined within
a FunctionExpression inside strict mode) a FunctionExpression inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
function f() { function f() {
return typeof this; return typeof this;
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,16 +7,13 @@ description: >
Strict Mode - checking 'this' (FunctionExpression defined within a Strict Mode - checking 'this' (FunctionExpression defined within a
FunctionExpression inside strict mode) FunctionExpression inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
var f = function () { var f = function () {
return typeof this; return typeof this;
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,15 +7,12 @@ description: >
Strict Mode - checking 'this' (Anonymous FunctionExpression Strict Mode - checking 'this' (Anonymous FunctionExpression
defined within a FunctionExpression inside strict mode) defined within a FunctionExpression inside strict mode)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
return ((function () { return ((function () {
return typeof this; return typeof this;
})()==="undefined") && ((typeof this)==="undefined"); })()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - checking 'this' (FunctionDeclaration defined within Strict Mode - checking 'this' (FunctionDeclaration defined within
a FunctionDeclaration with a strict directive prologue) a FunctionDeclaration with a strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
"use strict"; "use strict";
function f() { function f() {
@ -18,6 +16,5 @@ function f1() {
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - checking 'this' (FunctionExpression defined within a Strict Mode - checking 'this' (FunctionExpression defined within a
FunctionDeclaration with a strict directive prologue) FunctionDeclaration with a strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
"use strict"; "use strict";
var f = function () { var f = function () {
@ -18,6 +16,5 @@ function f1() {
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -8,16 +8,13 @@ description: >
defined within a FunctionDeclaration with a strict directive defined within a FunctionDeclaration with a strict directive
prologue) prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function f1() { function f1() {
"use strict"; "use strict";
return ((function () { return ((function () {
return typeof this; return typeof this;
})()==="undefined") && ((typeof this)==="undefined"); })()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - checking 'this' (FunctionDeclaration defined within Strict Mode - checking 'this' (FunctionDeclaration defined within
a FunctionExpression with a strict directive prologue) a FunctionExpression with a strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
"use strict"; "use strict";
function f() { function f() {
@ -18,6 +16,5 @@ var f1 = function () {
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -5,11 +5,8 @@
es5id: 10.4.3-1-4-s es5id: 10.4.3-1-4-s
description: this is not coerced to an object in strict mode (boolean) description: this is not coerced to an object in strict mode (boolean)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() function foo()
{ {
'use strict'; 'use strict';
@ -22,6 +19,5 @@ function testcase() {
} }
return foo.call(true) === 'boolean' && bar.call(true) === 'object'; assert.sameValue(foo.call(true), 'boolean', 'foo.call(true)');
} assert.sameValue(bar.call(true), 'object', 'bar.call(true)');
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - checking 'this' (FunctionExpression defined within a Strict Mode - checking 'this' (FunctionExpression defined within a
FunctionExpression with a strict directive prologue) FunctionExpression with a strict directive prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
"use strict"; "use strict";
var f = function () { var f = function () {
@ -18,6 +16,5 @@ var f1 = function () {
} }
return (f()==="undefined") && ((typeof this)==="undefined"); return (f()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -8,16 +8,13 @@ description: >
defined within a FunctionExpression with a strict directive defined within a FunctionExpression with a strict directive
prologue) prologue)
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f1 = function () { var f1 = function () {
"use strict"; "use strict";
return ((function () { return ((function () {
return typeof this; return typeof this;
})()==="undefined") && ((typeof this)==="undefined"); })()==="undefined") && ((typeof this)==="undefined");
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,12 +7,9 @@ description: >
Strict Mode - checking 'this' (FunctionDeclaration with a strict Strict Mode - checking 'this' (FunctionDeclaration with a strict
directive prologue defined within a FunctionDeclaration) directive prologue defined within a FunctionDeclaration)
flags: [noStrict] flags: [noStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
function f1() { function f1() {
function f() { function f() {
"use strict"; "use strict";
@ -20,6 +17,5 @@ function f1() {
} }
return (f()==="undefined") && (this===fnGlobalObject()); return (f()==="undefined") && (this===fnGlobalObject());
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

View File

@ -7,12 +7,9 @@ description: >
Strict Mode - checking 'this' (FunctionExpression with a strict Strict Mode - checking 'this' (FunctionExpression with a strict
directive prologue defined within a FunctionDeclaration) directive prologue defined within a FunctionDeclaration)
flags: [noStrict] flags: [noStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
function f1() { function f1() {
var f = function () { var f = function () {
"use strict"; "use strict";
@ -20,6 +17,5 @@ function f1() {
} }
return (f()==="undefined") && (this===fnGlobalObject()); return (f()==="undefined") && (this===fnGlobalObject());
} }
return f1();
} assert(f1(), 'f1() !== true');
runTestCase(testcase);

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