mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert helpers [test/language/arguments-object]
This commit is contained in:
parent
39b5b7272c
commit
27b234f708
|
@ -5,16 +5,9 @@
|
||||||
es5id: 10.6-12-1
|
es5id: 10.6-12-1
|
||||||
description: Accessing callee property of Arguments object is allowed
|
description: Accessing callee property of Arguments object is allowed
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
arguments.callee;
|
arguments.callee;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -5,17 +5,15 @@
|
||||||
es5id: 10.6-12-2
|
es5id: 10.6-12-2
|
||||||
description: arguments.callee has correct attributes
|
description: arguments.callee has correct attributes
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
||||||
if(desc.configurable === true &&
|
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
desc.writable === true &&
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
desc.hasOwnProperty('get') == false &&
|
assert.sameValue(desc.writable, true, 'desc.writable');
|
||||||
desc.hasOwnProperty('put') == false)
|
assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")');
|
||||||
return true;
|
assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")');
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -5,16 +5,9 @@
|
||||||
es5id: 10.6-13-1
|
es5id: 10.6-13-1
|
||||||
description: Accessing caller property of Arguments object is allowed
|
description: Accessing caller property of Arguments object is allowed
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
arguments.caller;
|
arguments.caller;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -5,11 +5,10 @@
|
||||||
es5id: 10.6-13-b-2-s
|
es5id: 10.6-13-b-2-s
|
||||||
description: arguments.caller exists in strict mode
|
description: arguments.caller exists in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||||
return desc!== undefined;
|
assert.notSameValue(desc, undefined);
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -5,18 +5,16 @@
|
||||||
es5id: 10.6-13-b-3-s
|
es5id: 10.6-13-b-3-s
|
||||||
description: arguments.caller is non-configurable in strict mode
|
description: arguments.caller is non-configurable in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||||
|
|
||||||
return (desc.configurable === false &&
|
assert.sameValue(desc.configurable, false, 'desc.configurable');
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
desc.hasOwnProperty('value') == false &&
|
assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
|
||||||
desc.hasOwnProperty('writable') == false &&
|
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
|
||||||
desc.hasOwnProperty('get') == true &&
|
assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
|
||||||
desc.hasOwnProperty('set') == true);
|
assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -4,11 +4,10 @@
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.6-13-c-2-s
|
es5id: 10.6-13-c-2-s
|
||||||
description: arguments.callee is exists
|
description: arguments.callee is exists
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
||||||
return desc !== undefined;
|
assert.notSameValue(desc, undefined);
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -5,16 +5,16 @@
|
||||||
es5id: 10.6-13-c-3-s
|
es5id: 10.6-13-c-3-s
|
||||||
description: arguments.callee is non-configurable in strict mode
|
description: arguments.callee is non-configurable in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
||||||
return (desc.configurable === false &&
|
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.configurable, false, 'desc.configurable');
|
||||||
desc.hasOwnProperty('value') == false &&
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
desc.hasOwnProperty('writable') == false &&
|
assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
|
||||||
desc.hasOwnProperty('get') == true &&
|
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
|
||||||
desc.hasOwnProperty('set') == true);
|
assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
|
||||||
|
assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -6,11 +6,9 @@ es5id: 10.6-5-1
|
||||||
description: >
|
description: >
|
||||||
[[Prototype]] property of Arguments is set to Object prototype
|
[[Prototype]] property of Arguments is set to Object prototype
|
||||||
object
|
object
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
if(Object.getPrototypeOf(arguments) === Object.getPrototypeOf({}))
|
assert.sameValue(Object.getPrototypeOf(arguments), Object.getPrototypeOf({}));
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -4,12 +4,11 @@
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.6-6-1
|
es5id: 10.6-6-1
|
||||||
description: "'length property of arguments object exists"
|
description: "'length property of arguments object exists"
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
|
||||||
return desc !== undefined
|
assert.notSameValue(desc, undefined);
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.6-6-2
|
es5id: 10.6-6-2
|
||||||
description: "'length' property of arguments object has correct attributes"
|
description: "'length' property of arguments object has correct attributes"
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
|
||||||
if(desc.configurable === true &&
|
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
desc.writable === true )
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
return true;
|
assert.sameValue(desc.writable, true, 'desc.writable');
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -6,10 +6,9 @@ es5id: 10.6-6-3
|
||||||
description: >
|
description: >
|
||||||
'length' property of arguments object for 0 argument function
|
'length' property of arguments object for 0 argument function
|
||||||
exists
|
exists
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
return (function () {return arguments.length !== undefined})();
|
assert.sameValue(arguments.length, 0);
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -7,11 +7,10 @@ description: >
|
||||||
'length' property of arguments object for 0 argument function
|
'length' property of arguments object for 0 argument function
|
||||||
exists
|
exists
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var arguments= undefined;
|
var arguments= undefined;
|
||||||
return (function () {return arguments.length !== undefined})();
|
(function () { assert.sameValue(arguments.length, 0); })();
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -6,10 +6,9 @@ es5id: 10.6-6-4
|
||||||
description: >
|
description: >
|
||||||
'length' property of arguments object for 0 argument function call
|
'length' property of arguments object for 0 argument function call
|
||||||
is 0 even with formal parameters
|
is 0 even with formal parameters
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase(a,b,c) {
|
||||||
return (function (a,b,c) {return arguments.length === 0})();
|
assert.sameValue(arguments.length, 0);
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
|
@ -7,11 +7,10 @@ description: >
|
||||||
'length' property of arguments object for 0 argument function call
|
'length' property of arguments object for 0 argument function call
|
||||||
is 0 even with formal parameters
|
is 0 even with formal parameters
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var arguments= undefined;
|
var arguments= undefined;
|
||||||
return (function (a,b,c) {return arguments.length === 0})();
|
(function (a,b,c) { assert.sameValue(arguments.length, 0); })();
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
|
Loading…
Reference in New Issue