mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert helpers [test/language/expressions/object]
This commit is contained in:
parent
4eac0d909e
commit
c7e160084c
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue