mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #411 from anba/remove-runTestCase-language
Replace runTestCase in test/language
This commit is contained in:
commit
9cb89a4e3c
@ -4,15 +4,11 @@
|
||||
/*---
|
||||
es5id: 10.5-7-b-2-s
|
||||
description: Arguments object index assignment is allowed
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function _10_5_7_b_2_fun() {
|
||||
arguments[7] = 12;
|
||||
return arguments[7] === 12;
|
||||
};
|
||||
|
||||
return _10_5_7_b_2_fun(30);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(_10_5_7_b_2_fun(30), '_10_5_7_b_2_fun(30) !== true');
|
||||
|
@ -5,15 +5,11 @@
|
||||
es5id: 10.5-7-b-3-s
|
||||
description: >
|
||||
Adding property to the arguments object successful under strict mode
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function _10_5_7_b_3_fun() {
|
||||
arguments[1] = 12;
|
||||
return arguments[0] === 30 && arguments[1] === 12;
|
||||
};
|
||||
|
||||
return _10_5_7_b_3_fun(30);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(_10_5_7_b_3_fun(30), '_10_5_7_b_3_fun(30) !== true');
|
||||
|
@ -5,16 +5,13 @@
|
||||
es5id: 10.5-7-b-4-s
|
||||
description: >
|
||||
Deleting property of the arguments object successful under strict mode
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function _10_5_7_b_4_fun() {
|
||||
var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12;
|
||||
delete arguments[1];
|
||||
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_fun(30, 12);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(_10_5_7_b_4_fun(30, 12), '_10_5_7_b_4_fun(30, 12) !== true');
|
||||
|
@ -7,15 +7,12 @@ description: >
|
||||
arguments[i] remains same after changing actual parameters in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo(a,b,c)
|
||||
{
|
||||
a = 1; b = 'str'; c = 2.1;
|
||||
return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1);
|
||||
}
|
||||
return foo(10, 'sss', 1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(foo(10, 'sss', 1), 'foo(10, "sss", 1) !== true');
|
||||
|
@ -5,16 +5,13 @@
|
||||
es5id: 10.6-10-c-ii-1
|
||||
description: arguments[i] change with actual parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo(a,b,c)
|
||||
{
|
||||
a = 1; b = 'str'; c = 2.1;
|
||||
if(arguments[0] === 1 && arguments[1] === 'str' && arguments[2] === 2.1)
|
||||
return true;
|
||||
}
|
||||
return foo(10,'sss',1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
|
||||
|
@ -5,16 +5,12 @@
|
||||
es5id: 10.6-10-c-ii-2-s
|
||||
description: arguments[i] doesn't map to actual parameters in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo(a,b,c)
|
||||
{
|
||||
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
|
||||
return 10 === a && 'sss' === b && 1 === c;
|
||||
}
|
||||
return foo(10,'sss',1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
|
||||
|
@ -5,17 +5,13 @@
|
||||
es5id: 10.6-10-c-ii-2
|
||||
description: arguments[i] map to actual parameter
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo(a,b,c)
|
||||
{
|
||||
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
|
||||
if(1 === a && 'str' === b && 2.1 === c)
|
||||
return true;
|
||||
}
|
||||
return foo(10,'sss',1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 10.6-13-a-2
|
||||
description: A direct call to arguments.callee.caller should work
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var called = false;
|
||||
|
||||
function test1(flag) {
|
||||
@ -28,7 +26,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
test1();
|
||||
return called;
|
||||
}
|
||||
|
||||
runTestCase(testcase);
|
||||
assert(called, 'called !== true');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 10.6-13-a-3
|
||||
description: An indirect call to arguments.callee.caller should work
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var called = false;
|
||||
|
||||
function test1(flag) {
|
||||
@ -29,7 +27,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
test1();
|
||||
return called;
|
||||
}
|
||||
|
||||
runTestCase(testcase);
|
||||
assert(called, 'called !== true');
|
||||
|
@ -5,13 +5,11 @@
|
||||
es5id: 10.6-14-1-s
|
||||
description: Strict Mode - 'callee' exists and 'caller' exists under strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var argObj = function () {
|
||||
return arguments;
|
||||
} ();
|
||||
return argObj.hasOwnProperty("callee") && argObj.hasOwnProperty("caller");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');
|
||||
assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Strict Mode - [[Enumerable]] attribute value in 'caller' is false
|
||||
under strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var argObj = function () {
|
||||
return arguments;
|
||||
} ();
|
||||
@ -21,6 +19,6 @@ function testcase() {
|
||||
verifyEnumerable = true;
|
||||
}
|
||||
}
|
||||
return !verifyEnumerable && argObj.hasOwnProperty("caller");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
|
||||
assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 10.6-14-c-1-s
|
||||
description: >
|
||||
[[Enumerable]] attribute value in 'callee' is false
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var argObj = function () {
|
||||
return arguments;
|
||||
} ();
|
||||
@ -19,6 +17,6 @@ function testcase() {
|
||||
verifyEnumerable = true;
|
||||
}
|
||||
}
|
||||
return !verifyEnumerable && argObj.hasOwnProperty("callee");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
|
||||
assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');
|
||||
|
@ -6,13 +6,8 @@ es5id: 11.1.4-0
|
||||
description: >
|
||||
elements elided at the end of an array do not contribute to its
|
||||
length
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a = [,];
|
||||
if (a.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(a.length, 1, 'a.length');
|
||||
|
@ -5,15 +5,13 @@
|
||||
es5id: 8.14.4-8-b_1
|
||||
description: Non-writable property on a prototype written to.
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() {};
|
||||
Object.defineProperty(foo.prototype, "bar", {value: "unwritable"});
|
||||
|
||||
var o = new foo();
|
||||
o.bar = "overridden";
|
||||
return o.hasOwnProperty("bar")===false && o.bar==="unwritable";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(o.hasOwnProperty("bar"), false, 'o.hasOwnProperty("bar")');
|
||||
assert.sameValue(o.bar, "unwritable", 'o.bar');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-12-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(*=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_12 = 5
|
||||
_11_13_2_12 *= 2;
|
||||
return _11_13_2_12 === 10;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_12, 10, '_11_13_2_12');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-13-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(/=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_13 = 6
|
||||
_11_13_2_13 /= 2;
|
||||
return _11_13_2_13 === 3;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_13, 3, '_11_13_2_13');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-14-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(%=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_14 = 5
|
||||
_11_13_2_14 %= 2;
|
||||
return _11_13_2_14 === 1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_14, 1, '_11_13_2_14');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-15-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(>>>=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_15 = 8
|
||||
_11_13_2_15 >>>= 2;
|
||||
return _11_13_2_15 === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_15, 2, '_11_13_2_15');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-16-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(-=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_16 = 5
|
||||
_11_13_2_16 -= 2;
|
||||
return _11_13_2_16 === 3;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_16, 3, '_11_13_2_16');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-17-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(<<=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_17 = 1;
|
||||
_11_13_2_17 <<= 2;
|
||||
return _11_13_2_17 === 4;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_17, 4, '_11_13_2_17');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-18-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(>>=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_18 = 4
|
||||
_11_13_2_18 >>= 2;
|
||||
return _11_13_2_18 === 1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_18, 1, '_11_13_2_18');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-19-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(+=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_19 = -1
|
||||
_11_13_2_19 += 10;
|
||||
return _11_13_2_19 === 9;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_19, 9, '_11_13_2_19');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-20-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(&=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_20 = 5
|
||||
_11_13_2_20 &= 3;
|
||||
return _11_13_2_20 === 1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_20, 1, '_11_13_2_20');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-21-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(^=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_21 = 5
|
||||
_11_13_2_21 ^= 3;
|
||||
return _11_13_2_21 === 6;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_21, 6, '_11_13_2_21');
|
||||
|
@ -6,12 +6,9 @@ es5id: 11.13.2-22-s
|
||||
description: >
|
||||
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
|
||||
Assignment operator(|=) evaluates to a resolvable reference
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _11_13_2_22 = 5
|
||||
_11_13_2_22 |= 2;
|
||||
return _11_13_2_22 === 7;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(_11_13_2_22, 7, '_11_13_2_22');
|
||||
|
@ -6,15 +6,12 @@ es5id: 11.4.1-2-2
|
||||
description: >
|
||||
delete operator returns true when deleting returned value from a
|
||||
function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bIsFooCalled = false;
|
||||
var foo = function(){bIsFooCalled = true;};
|
||||
|
||||
var d = delete foo();
|
||||
if(d === true && bIsFooCalled === true)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(bIsFooCalled, true, 'bIsFooCalled');
|
||||
|
@ -6,13 +6,8 @@ es5id: 11.4.1-2-3
|
||||
description: >
|
||||
delete operator returns true when deleting a non-reference
|
||||
(boolean)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = delete true;
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 11.4.1-2-4
|
||||
description: delete operator returns true when deleting a non-reference (string)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = delete "abc";
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 11.4.1-2-5
|
||||
description: delete operator returns true when deleting a non-reference (obj)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = delete {a:0} ;
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 11.4.1-2-6
|
||||
description: delete operator returns true when deleting a non-reference (null)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = delete null;
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -7,14 +7,9 @@ description: >
|
||||
delete operator returns true when deleting an unresolvable
|
||||
reference
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
// just cooking up a long/veryLikely unique name
|
||||
var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_0__;
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -6,14 +6,9 @@ es5id: 11.4.1-3-3
|
||||
description: >
|
||||
delete operator returns true when deleting an explicitly qualified
|
||||
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 d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_3__.x;
|
||||
if (d === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 11.4.1-4-a-3-s
|
||||
description: >
|
||||
TypeError isn't thrown when deleting configurable data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "prop", {
|
||||
value: "abc",
|
||||
@ -16,6 +14,5 @@ function testcase() {
|
||||
});
|
||||
|
||||
delete obj.prop;
|
||||
return !obj.hasOwnProperty("prop");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 11.4.1-4-a-4-s
|
||||
description: >
|
||||
TypeError isn't thrown when deleting configurable accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "prop", {
|
||||
get: function () {
|
||||
@ -18,6 +16,5 @@ function testcase() {
|
||||
});
|
||||
|
||||
delete obj.prop;
|
||||
return !obj.hasOwnProperty("prop");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")');
|
||||
|
@ -9,18 +9,14 @@ es5id: 11.4.1-4.a-1
|
||||
description: >
|
||||
delete operator returns true when deleting a configurable data
|
||||
property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = {};
|
||||
|
||||
var desc = { value: 1, configurable: true };
|
||||
Object.defineProperty(o, "foo", desc);
|
||||
|
||||
var d = delete o.foo;
|
||||
if (d === true && o.hasOwnProperty("foo") === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');
|
||||
|
@ -8,15 +8,11 @@ info: >
|
||||
es5id: 11.4.1-4.a-12
|
||||
description: delete operator returns false when deleting a property(length)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var a = [1,2,3]
|
||||
a.x = 10;
|
||||
var d = delete a.length
|
||||
if(d === false && a.length === 3)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, false, 'd');
|
||||
assert.sameValue(a.length, 3, 'a.length');
|
||||
|
@ -7,15 +7,11 @@ info: >
|
||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||
es5id: 11.4.1-4.a-14
|
||||
description: delete operator returns true when deleting Array elements
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var a = [1,2,3]
|
||||
a.x = 10;
|
||||
var d = delete a[1]
|
||||
if(d === true && a[1] === undefined)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(a[1], undefined, 'a[1]');
|
||||
|
@ -7,15 +7,11 @@ info: >
|
||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||
es5id: 11.4.1-4.a-15
|
||||
description: delete operator returns true when deleting Array expandos
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var a = [1,2,3]
|
||||
a.x = 10;
|
||||
var d = delete a.x;
|
||||
if( d === true && a.x === undefined)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(a.x, undefined, 'a.x');
|
||||
|
@ -9,10 +9,8 @@ es5id: 11.4.1-4.a-2
|
||||
description: >
|
||||
delete operator returns true when deleting a configurable accessor
|
||||
property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = {};
|
||||
|
||||
// define an accessor
|
||||
@ -22,8 +20,6 @@ function testcase() {
|
||||
Object.defineProperty(o, "foo", desc);
|
||||
|
||||
var d = delete o.foo;
|
||||
if (d === true && o.hasOwnProperty("foo") === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")');
|
||||
|
@ -10,18 +10,14 @@ description: >
|
||||
delete operator returns false when deleting a non-configurable
|
||||
data property
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = {};
|
||||
var desc = { value : 1, configurable: false }; // all other attributes default to false
|
||||
Object.defineProperty(o, "foo", desc);
|
||||
|
||||
// Now, deleting o.foo should fail because [[Configurable]] on foo is false.
|
||||
var d = delete o.foo;
|
||||
if (d === false && o.hasOwnProperty("foo") === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, false, 'd');
|
||||
assert.sameValue(o.hasOwnProperty("foo"), true, 'o.hasOwnProperty("foo")');
|
||||
|
@ -10,14 +10,9 @@ description: >
|
||||
delete operator returns false when deleting a non-configurable
|
||||
data property (NaN)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
// NaN (15.1.1.1) has [[Configurable]] set to false.
|
||||
var d = delete NaN;
|
||||
if (d === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, false, 'd');
|
||||
|
@ -8,10 +8,8 @@ info: >
|
||||
es5id: 11.4.1-4.a-6
|
||||
description: delete operator returns true when deleting a property inside 'with'
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = new Object();
|
||||
o.x = 1;
|
||||
var d;
|
||||
@ -19,8 +17,6 @@ function testcase() {
|
||||
{
|
||||
d = delete x;
|
||||
}
|
||||
if (d === true && o.x === undefined) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, true, 'd');
|
||||
assert.sameValue(o.x, undefined, 'o.x');
|
||||
|
@ -10,13 +10,8 @@ description: >
|
||||
delete operator returns false when deleting a non-configurable
|
||||
data property (Math.LN2)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = delete Math.LN2;
|
||||
if (d === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, false, 'd');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
delete operator returns false when deleting a direct reference to
|
||||
a function argument
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo(a,b) {
|
||||
|
||||
// Now, deleting 'a' directly should fail
|
||||
@ -19,6 +16,5 @@ function testcase() {
|
||||
var d = delete a;
|
||||
return (d === false && a === 1);
|
||||
}
|
||||
return foo(1,2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(foo(1,2), 'foo(1,2) !== true');
|
||||
|
@ -4,12 +4,7 @@
|
||||
/*---
|
||||
es5id: 11.4.1-5-a-28-s
|
||||
description: Strict Mode - TypeError is not thrown when deleting RegExp.length
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a = new RegExp();
|
||||
var b = delete RegExp.length;
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.2-1
|
||||
description: >
|
||||
11.8.2 Greater-than Operator - Partial left to right order
|
||||
enforced when using Greater-than operator: valueOf > valueOf
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
valueOf: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return !(obj1 > obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.2-2
|
||||
description: >
|
||||
11.8.2 Greater-than Operator - Partial left to right order
|
||||
enforced when using Greater-than operator: valueOf > toString
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
valueOf: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return !(obj1 > obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.2-3
|
||||
description: >
|
||||
11.8.2 Greater-than Operator - Partial left to right order
|
||||
enforced when using Greater-than operator: toString > valueOf
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
toString: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return !(obj1 > obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.2-4
|
||||
description: >
|
||||
11.8.2 Greater-than Operator - Partial left to right order
|
||||
enforced when using Greater-than operator: toString > toString
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
toString: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return !(obj1 > obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(!(obj1 > obj2), '!(obj1 > obj2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.3-1
|
||||
description: >
|
||||
11.8.3 Less-than-or-equal Operator - Partial left to right order
|
||||
enforced when using Less-than-or-equal operator: valueOf <= valueOf
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
valueOf: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return (obj1 <= obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
11.8.3 Less-than-or-equal Operator - Partial left to right order
|
||||
enforced when using Less-than-or-equal operator: valueOf <=
|
||||
toString
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
valueOf: function () {
|
||||
@ -27,6 +25,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return (obj1 <= obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
11.8.3 Less-than-or-equal Operator - Partial left to right order
|
||||
enforced when using Less-than-or-equal operator: toString <=
|
||||
valueOf
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
toString: function () {
|
||||
@ -27,6 +25,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return (obj1 <= obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
11.8.3 Less-than-or-equal Operator - Partial left to right order
|
||||
enforced when using Less-than-or-equal operator: toString <=
|
||||
toString
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
toString: function () {
|
||||
@ -27,6 +25,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return (obj1 <= obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 11.8.3-5
|
||||
description: >
|
||||
11.8.3 Less-than-or-equal Operator - Partial left to right order
|
||||
enforced when using Less-than-or-equal operator: valueOf <= valueOf
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
var obj1 = {
|
||||
valueOf: function () {
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return (obj1 <= obj2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj1 <= obj2), '(obj1 <= obj2) !== true');
|
||||
|
@ -5,11 +5,6 @@
|
||||
es5id: 11.1.5-4-4-a-1-s
|
||||
description: >
|
||||
Object literal - No SyntaxError for duplicate data property names
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({foo:0,foo:1});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -12,12 +12,6 @@ es5id: 11.1.5_4-4-a-2
|
||||
description: >
|
||||
Object literal - Duplicate data property name allowed if not in
|
||||
strict mode
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
eval("({foo:0,foo:1});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -12,12 +12,8 @@ es5id: 11.1.5_4-4-a-3
|
||||
description: >
|
||||
Object literal - Duplicate data property name allowed gets last
|
||||
defined value
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var o = eval("({foo:0,foo:1});");
|
||||
return o.foo===1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(o.foo, 1, 'o.foo');
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-b-1
|
||||
description: >
|
||||
Object literal - No SyntaxError if a data property definition is
|
||||
followed by get accessor definition with the same name
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({foo : 1, get foo(){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-b-2
|
||||
description: >
|
||||
Object literal - No SyntaxError if a data property definition is
|
||||
followed by set accessor definition with the same name
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({foo : 1, set foo(x){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-c-1
|
||||
description: >
|
||||
Object literal - No SyntaxError if a get accessor property definition
|
||||
is followed by a data property definition with the same name
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({get foo(){}, foo : 1});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-c-2
|
||||
description: >
|
||||
Object literal - No SyntaxError if a set accessor property definition
|
||||
is followed by a data property definition with the same name
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({set foo(x){}, foo : 1});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -4,11 +4,6 @@
|
||||
/*---
|
||||
es5id: 11.1.5_4-4-d-1
|
||||
description: Object literal - No SyntaxError for duplicate property name (get,get)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({get foo(){}, get foo(){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -4,11 +4,6 @@
|
||||
/*---
|
||||
es5id: 11.1.5_4-4-d-2
|
||||
description: Object literal - No SyntaxError for duplicate property name (set,set)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({set foo(arg){}, set foo(arg1){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-d-3
|
||||
description: >
|
||||
Object literal - No SyntaxError for duplicate property name
|
||||
(get,set,get)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({get foo(){}, set foo(arg){}, get foo(){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 11.1.5_4-4-d-4
|
||||
description: >
|
||||
Object literal - No SyntaxError for duplicate property name
|
||||
(set,get,set)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -9,17 +9,12 @@ info: >
|
||||
4.Let desc be the Property Descriptor{[[Value]]: propValue, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}
|
||||
es5id: 11.1.5_5-4-1
|
||||
description: Object literal - property descriptor for assignment expression
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var o = {foo : 1};
|
||||
var desc = Object.getOwnPropertyDescriptor(o,"foo");
|
||||
if(desc.value === 1 &&
|
||||
desc.writable === true &&
|
||||
desc.enumerable === true &&
|
||||
desc.configurable === true)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.value, 1, 'desc.value');
|
||||
assert.sameValue(desc.writable, true, 'desc.writable');
|
||||
assert.sameValue(desc.enumerable, true, 'desc.enumerable');
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -9,15 +9,11 @@ info: >
|
||||
3.Let desc be the Property Descriptor{[[Get]]: closure, [[Enumerable]]: true, [[Configurable]]: true}
|
||||
es5id: 11.1.5_6-3-1
|
||||
description: Object literal - property descriptor for get property assignment
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o;
|
||||
eval("o = {get foo(){return 1;}};");
|
||||
var desc = Object.getOwnPropertyDescriptor(o,"foo");
|
||||
if(desc.enumerable === true &&
|
||||
desc.configurable === true)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.enumerable, true, 'desc.enumerable');
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -11,13 +11,10 @@ es5id: 11.1.5_6-3-2
|
||||
description: >
|
||||
Object literal - property descriptor for get property assignment
|
||||
should not create a set function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o;
|
||||
eval("o = {get foo(){return 1;}};");
|
||||
var desc = Object.getOwnPropertyDescriptor(o,"foo");
|
||||
return desc.set === undefined
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.set, undefined, 'desc.set');
|
||||
|
@ -9,15 +9,11 @@ info: >
|
||||
3.Let desc be the Property Descriptor{[[Set]]: closure, [[Enumerable]]: true, [[Configurable]]: true}
|
||||
es5id: 11.1.5_7-3-1
|
||||
description: Object literal - property descriptor for set property assignment
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o;
|
||||
eval("o = {set foo(arg){return 1;}};");
|
||||
var desc = Object.getOwnPropertyDescriptor(o,"foo");
|
||||
if(desc.enumerable === true &&
|
||||
desc.configurable === true)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.enumerable, true, 'desc.enumerable');
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -11,13 +11,10 @@ es5id: 11.1.5_7-3-2
|
||||
description: >
|
||||
Object literal - property descriptor for set property assignment
|
||||
should not create a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o;
|
||||
eval("o = {set foo(arg){}};");
|
||||
var desc = Object.getOwnPropertyDescriptor(o,"foo");
|
||||
return desc.get === undefined
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.get, undefined, 'desc.get');
|
||||
|
@ -5,11 +5,8 @@
|
||||
es5id: 10.4.3-1-1-s
|
||||
description: this is not coerced to an object in strict mode (Number)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
@ -22,6 +19,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
|
||||
return foo.call(1) === 'number' && bar.call(1) === 'object';
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(foo.call(1), 'number', 'foo.call(1)');
|
||||
assert.sameValue(bar.call(1), 'object', 'bar.call(1)');
|
||||
|
@ -7,14 +7,11 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression includes strict
|
||||
directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = function () {
|
||||
"use strict";
|
||||
return typeof this;
|
||||
}
|
||||
return f() === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(f(), "undefined", 'f()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 10.4.3-1-100-s
|
||||
description: >
|
||||
Strict Mode - checking 'this' (strict function passed as arg to
|
||||
String.prototype.replace)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var x = 3;
|
||||
|
||||
function f() {
|
||||
@ -17,6 +15,6 @@ function f() {
|
||||
x = this;
|
||||
return "a";
|
||||
}
|
||||
return ("ab".replace("b", f)==="aa") && (x===undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue("ab".replace("b", f), "aa", '"ab".replace("b", f)');
|
||||
assert.sameValue(x, undefined, 'x');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (Function constructor defined within
|
||||
strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Function("return typeof this;");
|
||||
return f() !== "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue(f(), "undefined", 'f()');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (Function constructor includes
|
||||
strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Function("\"use strict\";\nreturn typeof this;");
|
||||
return f() === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(f(), "undefined", 'f()');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed Function constructor defined
|
||||
within strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = new Function("return typeof this;");
|
||||
return f() !== "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue(f(), "undefined", 'f()');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed Function constructor
|
||||
includes strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = new Function("\"use strict\";\nreturn typeof this;");
|
||||
return f() === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(f(), "undefined", 'f()');
|
||||
|
@ -5,11 +5,8 @@
|
||||
es5id: 10.4.3-1-2-s
|
||||
description: this is not coerced to an object in strict mode (string)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
@ -22,6 +19,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
|
||||
return foo.call('1') === 'string' && bar.call('1') === 'object';
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(foo.call('1'), 'string', 'foo.call("1")');
|
||||
assert.sameValue(bar.call('1'), 'object', 'bar.call("1")');
|
||||
|
@ -7,15 +7,12 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from
|
||||
FunctionDeclaration defined within strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f() {
|
||||
return this;
|
||||
}
|
||||
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
|
||||
assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');
|
||||
|
@ -7,17 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from
|
||||
FunctionDeclaration includes strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f() {
|
||||
"use strict";
|
||||
return this;
|
||||
}
|
||||
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
|
||||
assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from
|
||||
FunctionExpression defined within strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = function () {
|
||||
return this;
|
||||
}
|
||||
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
|
||||
assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from
|
||||
FunctionExpression includes strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = function () {
|
||||
"use strict";
|
||||
return this;
|
||||
}
|
||||
return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue((new f()), fnGlobalObject(), '(new f())');
|
||||
assert.notSameValue(typeof (new f()), "undefined", 'typeof (new f())');
|
||||
|
@ -7,15 +7,12 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from Anonymous
|
||||
FunctionExpression defined within strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = new (function () {
|
||||
return this;
|
||||
});
|
||||
return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue(obj, fnGlobalObject(), 'obj');
|
||||
assert.notSameValue((typeof obj), "undefined", '(typeof obj)');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (New'ed object from Anonymous
|
||||
FunctionExpression includes strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = new (function () {
|
||||
"use strict";
|
||||
return this;
|
||||
});
|
||||
return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.notSameValue(obj, fnGlobalObject(), 'obj');
|
||||
assert.notSameValue((typeof obj), "undefined", '(typeof obj)');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||
a FunctionDeclaration inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
function f() {
|
||||
return typeof this;
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression defined within a
|
||||
FunctionDeclaration inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
var f = function () {
|
||||
return typeof this;
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,15 +7,12 @@ description: >
|
||||
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
||||
defined within a FunctionDeclaration inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
return ((function () {
|
||||
return typeof this;
|
||||
})()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -5,11 +5,8 @@
|
||||
es5id: 10.4.3-1-3-s
|
||||
description: this is not coerced to an object in strict mode (undefined)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
@ -20,6 +17,6 @@ function testcase() {
|
||||
{
|
||||
return typeof(this);
|
||||
}
|
||||
return foo.call(undefined) === 'undefined' && bar.call() === 'object';
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(foo.call(undefined), 'undefined', 'foo.call(undefined)');
|
||||
assert.sameValue(bar.call(), 'object', 'bar.call()');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||
a FunctionExpression inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
function f() {
|
||||
return typeof this;
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,16 +7,13 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression defined within a
|
||||
FunctionExpression inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
var f = function () {
|
||||
return typeof this;
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,15 +7,12 @@ description: >
|
||||
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
||||
defined within a FunctionExpression inside strict mode)
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
return ((function () {
|
||||
return typeof this;
|
||||
})()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||
a FunctionDeclaration with a strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
"use strict";
|
||||
function f() {
|
||||
@ -18,6 +16,5 @@ function f1() {
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression defined within a
|
||||
FunctionDeclaration with a strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
"use strict";
|
||||
var f = function () {
|
||||
@ -18,6 +16,5 @@ function f1() {
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -8,16 +8,13 @@ description: >
|
||||
defined within a FunctionDeclaration with a strict directive
|
||||
prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
"use strict";
|
||||
return ((function () {
|
||||
return typeof this;
|
||||
})()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||
a FunctionExpression with a strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
"use strict";
|
||||
function f() {
|
||||
@ -18,6 +16,5 @@ var f1 = function () {
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -5,11 +5,8 @@
|
||||
es5id: 10.4.3-1-4-s
|
||||
description: this is not coerced to an object in strict mode (boolean)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
@ -22,6 +19,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
|
||||
return foo.call(true) === 'boolean' && bar.call(true) === 'object';
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(foo.call(true), 'boolean', 'foo.call(true)');
|
||||
assert.sameValue(bar.call(true), 'object', 'bar.call(true)');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression defined within a
|
||||
FunctionExpression with a strict directive prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
"use strict";
|
||||
var f = function () {
|
||||
@ -18,6 +16,5 @@ var f1 = function () {
|
||||
}
|
||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -8,16 +8,13 @@ description: >
|
||||
defined within a FunctionExpression with a strict directive
|
||||
prologue)
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f1 = function () {
|
||||
"use strict";
|
||||
return ((function () {
|
||||
return typeof this;
|
||||
})()==="undefined") && ((typeof this)==="undefined");
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,12 +7,9 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionDeclaration with a strict
|
||||
directive prologue defined within a FunctionDeclaration)
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
function f() {
|
||||
"use strict";
|
||||
@ -20,6 +17,5 @@ function f1() {
|
||||
}
|
||||
return (f()==="undefined") && (this===fnGlobalObject());
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
@ -7,12 +7,9 @@ description: >
|
||||
Strict Mode - checking 'this' (FunctionExpression with a strict
|
||||
directive prologue defined within a FunctionDeclaration)
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function f1() {
|
||||
var f = function () {
|
||||
"use strict";
|
||||
@ -20,6 +17,5 @@ function f1() {
|
||||
}
|
||||
return (f()==="undefined") && (this===fnGlobalObject());
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(f1(), 'f1() !== true');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user