Merge pull request #396 from anba/remove-runTestCase-Object

Replace runTestCase in built-ins/Object
This commit is contained in:
Brian Terlson 2015-08-11 10:42:00 -07:00
commit b155e612ac
1511 changed files with 3497 additions and 9575 deletions

View File

@ -4,12 +4,6 @@
/*---
es5id: 15.2.3.5-0-1
description: Object.create must exist as a function
includes: [runTestCase.js]
---*/
function testcase() {
if (typeof(Object.create) === "function") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(typeof(Object.create), "function", 'typeof(Object.create)');

View File

@ -4,12 +4,6 @@
/*---
es5id: 15.2.3.5-0-2
description: Object.create must exist as a function taking 2 parameters
includes: [runTestCase.js]
---*/
function testcase() {
if (Object.create.length === 2) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.create.length, 2, 'Object.create.length');

View File

@ -7,17 +7,11 @@ info: >
This can be checked using isPrototypeOf, or getPrototypeOf.
es5id: 15.2.3.5-2-1
description: Object.create creates new Object
includes: [runTestCase.js]
---*/
function testcase() {
function base() {}
var b = new base();
var prop = new Object();
var d = Object.create(b);
if (typeof d === 'object') {
return true;
}
}
runTestCase(testcase);
assert.sameValue(typeof d, 'object', 'typeof d');

View File

@ -4,12 +4,8 @@
/*---
es5id: 15.2.3.5-2-2
description: Object.create - returned object is an instance of Object
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({});
return newObj instanceof Object;
}
runTestCase(testcase);
assert(newObj instanceof Object, 'newObj instanceof Object !== true');

View File

@ -7,17 +7,11 @@ info: >
This can be checked using isPrototypeOf, or getPrototypeOf.
es5id: 15.2.3.5-3-1
description: Object.create sets the prototype of the passed-in object
includes: [runTestCase.js]
---*/
function testcase() {
function base() {}
var b = new base();
var d = Object.create(b);
if (Object.getPrototypeOf(d) === b &&
b.isPrototypeOf(d) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(d), b, 'Object.getPrototypeOf(d)');
assert.sameValue(b.isPrototypeOf(d), true, 'b.isPrototypeOf(d)');

View File

@ -9,23 +9,17 @@ es5id: 15.2.3.5-4-1
description: >
Object.create sets the prototype of the passed-in object and adds
new properties
includes: [runTestCase.js]
---*/
function testcase() {
function base() {}
var b = new base();
var prop = new Object();
var d = Object.create(b,{ "x": {value: true,writable: false},
"y": {value: "str",writable: false} });
if (Object.getPrototypeOf(d) === b &&
b.isPrototypeOf(d) === true &&
d.x === true &&
d.y === "str" &&
b.x === undefined &&
b.y === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(Object.getPrototypeOf(d), b, 'Object.getPrototypeOf(d)');
assert.sameValue(b.isPrototypeOf(d), true, 'b.isPrototypeOf(d)');
assert.sameValue(d.x, true, 'd.x');
assert.sameValue(d.y, "str", 'd.y');
assert.sameValue(b.x, undefined, 'b.x');
assert.sameValue(b.y, undefined, 'b.y');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-102
description: >
Object.create - 'configurable' property of one property in
'Properties' is an inherited data property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
configurable: true
};
@ -27,7 +24,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-105
description: >
Object.create - 'configurable' property of one property in
'Properties' is own accessor property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = {};
Object.defineProperty(descObj, "configurable", {
get: function () {
@ -25,6 +22,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-106
description: >
Object.create - 'configurable' property of one property in
'Properties' is an inherited accessor property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "configurable", {
@ -30,6 +27,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-11
description: >
Object.create - argument 'Properties' is a Date object (15.2.3.7
step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var props = new Date();
var result = false;
@ -22,6 +19,6 @@ function testcase() {
enumerable: true
});
var newObj = Object.create({}, props);
return result && newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Function object
which implements its own [[Get]] method to access the
'configurable' property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = function () { };
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Array object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = [];
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a String object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new String();
descObj.configurable = true;
@ -23,6 +20,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Boolean object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new Boolean(false);
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Number object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new Number(-9);
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Date object that
uses Object's [[Get]] method to access the 'configurable' property
(8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new Date();
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Date object that
uses Object's [[Get]] method to access the 'configurable' property
(8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new RegExp();
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-12
description: >
Object.create - argument 'Properties' is a RegExp object (15.2.3.7
step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var props = new RegExp();
var result = false;
@ -22,6 +19,6 @@ function testcase() {
enumerable: true
});
var newObj = Object.create({}, props);
return result && newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Error object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = new Error();
descObj.configurable = true;
@ -24,6 +21,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Arguments
object which implements its own [[Get]] method to access the
'configurable' property (8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var argObj = (function () { return arguments; })();
argObj.configurable = true;
@ -23,6 +20,5 @@ function testcase() {
delete newObj.prop;
var result2 = newObj.hasOwnProperty("prop");
return result1 === true && result2 === false;
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-127
description: >
Object.create - 'configurable' property of one property in
'Properties' is true (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: true
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-133
description: >
Object.create - 'configurable' property of one property in
'Properties' is a positive number (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: 123
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-134
description: >
Object.create - 'configurable' property of one property in
'Properties' is a negative number (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: -123
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-136
description: >
Object.create - 'configurable' property of one property in
'Properties' is a non-empty string (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: "abc"
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-137
description: >
Object.create - 'configurable' property of one property in
'Properties' is a Function object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: function () { }
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-138
description: >
Object.create - 'configurable' property of one property in
'Properties' is an Array object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: []
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-139
description: >
Object.create - 'configurable' property of one property in
'Properties' is a String object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new String("abc")
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-14
description: >
Object.create - argument 'Properties' is an Error object (15.2.3.7
step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var props = new Error("test");
var result = false;
@ -26,6 +23,6 @@ function testcase() {
enumerable: true
});
var newObj = Object.create({}, props);
return result && newObj.hasOwnProperty("prop15_2_3_5_4_14");
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop15_2_3_5_4_14"), 'newObj.hasOwnProperty("prop15_2_3_5_4_14") !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-140
description: >
Object.create - 'configurable' property of one property in
'Properties' is a Boolean object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new Boolean(true)
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-141
description: >
Object.create - 'configurable' property of one property in
'Properties' is a Number object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new Number(123)
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-142
description: >
Object.create - 'configurable' property of one property in
'Properties' is the Math object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: Math
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-143
description: >
Object.create - 'configurable' property of one property in
'Properties' is a Date object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new Date()
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-144
description: >
Object.create - 'configurable' property of one property in
'Properties' is a RegExp object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new RegExp()
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-145
description: >
Object.create - 'configurable' property of one property in
'Properties' is the JSON object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: JSON
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-146
description: >
Object.create - 'configurable' property of one property in
'Properties' is an Error object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new Error()
@ -23,6 +20,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-147
description: >
Object.create - 'configurable' property of one property in
'Properties' is an Arguments object (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var argObj = (function () { return arguments; })();
var newObj = Object.create({}, {
@ -25,6 +22,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,13 +6,9 @@ es5id: 15.2.3.5-4-149
description: >
Object.create - 'configurable' property of one property in
'Properties' is the global object (8.10.5 step 4.b)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: fnGlobalObject()
@ -25,6 +21,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-15
description: >
Object.create - argument 'Properties' is the Aguments object
(15.2.3.7 step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var result = false;
var argObj = (function () { return arguments; })();
@ -24,6 +21,6 @@ function testcase() {
});
var newObj = Object.create({}, argObj);
return result && newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'configurable' property of one property in
'Properties' is a string (value is 'false') which is treated as
the value true (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: "false"
@ -24,6 +21,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'configurable' property of one property in
'Properties' is new Boolean(false) which is treated as the value
true (8.10.5 step 4.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
configurable: new Boolean(false)
@ -24,6 +21,5 @@ function testcase() {
var afterDeleted = newObj.hasOwnProperty("prop");
return beforeDeleted === true && afterDeleted === false;
}
runTestCase(testcase);
assert.sameValue(beforeDeleted, true, 'beforeDeleted');
assert.sameValue(afterDeleted, false, 'afterDeleted');

View File

@ -6,17 +6,12 @@ es5id: 15.2.3.5-4-152
description: >
Object.create - 'value' property of one property in 'Properties'
is present (8.10.5 step 5)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
value: 100
}
});
return newObj.prop === 100;
}
runTestCase(testcase);
assert.sameValue(newObj.prop, 100, 'newObj.prop');

View File

@ -6,15 +6,11 @@ es5id: 15.2.3.5-4-153
description: >
Object.create - 'value' property of one property in 'Properties'
is not present (8.10.5 step 5)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {}
});
return newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined";
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');
assert.sameValue(typeof (newObj.prop), "undefined", 'typeof (newObj.prop)');

View File

@ -6,17 +6,12 @@ es5id: 15.2.3.5-4-154
description: >
Object.create - 'value' property of one property in 'Properties'
is own data property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
value: "ownDataProperty"
}
});
return newObj.prop === "ownDataProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownDataProperty", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-155
description: >
Object.create - 'value' property of one property in 'Properties'
is an inherited data property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
value: "inheritedDataProperty"
};
@ -24,6 +21,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "inheritedDataProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "inheritedDataProperty", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is own data property that overrides an inherited data property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
value: "inheritedDataProperty"
};
@ -27,6 +24,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "ownDataProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownDataProperty", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is own data property that overrides an inherited accessor property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "value", {
@ -35,6 +32,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "ownDataProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownDataProperty", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-158
description: >
Object.create - 'value' property of one property in 'Properties'
is own accessor property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = {};
Object.defineProperty(descObj, "value", {
@ -23,6 +20,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "ownAccessorProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownAccessorProperty", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-159
description: >
Object.create - 'value' property of one property in 'Properties'
is an inherited accessor property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "value", {
@ -28,6 +25,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "inheritedAccessorProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "inheritedAccessorProperty", 'newObj.prop');

View File

@ -6,14 +6,10 @@ es5id: 15.2.3.5-4-16
description: >
Object.create - own enumerable data property in 'Properties' is
defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {}
});
return newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is own accessor property that overrides an inherited data property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
value: "inheritedDataProperty"
};
@ -31,6 +28,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "ownAccessorProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownAccessorProperty", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is own accessor property that overrides an inherited accessor
property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "value", {
@ -35,6 +32,4 @@ function testcase() {
prop: descObj
});
return newObj.prop === "ownAccessorProperty";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ownAccessorProperty", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-162
description: >
Object.create - 'value' property of one property in 'Properties'
is own accessor property without a get function (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = {};
Object.defineProperty(descObj, "value", {
@ -21,6 +18,5 @@ function testcase() {
prop: descObj
});
return newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined";
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');
assert.sameValue(typeof (newObj.prop), "undefined", 'typeof (newObj.prop)');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is own accessor property without a get function, which overrides
an inherited accessor property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "value", {
@ -33,6 +30,5 @@ function testcase() {
prop: descObj
});
return newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined";
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');
assert.sameValue(typeof (newObj.prop), "undefined", 'typeof (newObj.prop)');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'value' property of one property in 'Properties'
is an inherited accessor property without a get function (8.10.5
step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "value", {
@ -27,6 +24,5 @@ function testcase() {
prop: descObj
});
return newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined";
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');
assert.sameValue(typeof (newObj.prop), "undefined", 'typeof (newObj.prop)');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Function object
which implements its own [[Get]] method to access the 'value'
property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var Func = function (a, b) {
return a + b;
};
@ -22,6 +19,5 @@ function testcase() {
var newObj = Object.create({}, {
prop: fun
});
return newObj.prop === "FunValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "FunValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Array object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [1, 2, 3];
arr.value = "ArrValue";
@ -20,6 +17,4 @@ function testcase() {
prop: arr
});
return newObj.prop === "ArrValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ArrValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a String object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var str = new String("abc");
str.value = "StrValue";
@ -20,6 +17,4 @@ function testcase() {
prop: str
});
return newObj.prop === "StrValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "StrValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Boolean object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var booleanObj = new Boolean(false);
booleanObj.value = "BooleanValue";
@ -20,6 +17,4 @@ function testcase() {
prop: booleanObj
});
return newObj.prop === "BooleanValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "BooleanValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Number object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var numObj = new Number(123);
numObj.value = "NumValue";
@ -20,6 +17,4 @@ function testcase() {
prop: numObj
});
return newObj.prop === "NumValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "NumValue", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-17
description: >
Object.create - own data property in 'Properties' which is not
enumerable is not defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var props = {};
Object.defineProperty(props, "prop", {
value: {},
@ -18,6 +15,4 @@ function testcase() {
});
var newObj = Object.create({}, props);
return !newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert.sameValue(newObj.hasOwnProperty("prop"), false, 'newObj.hasOwnProperty("prop")');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Date object that
uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var dateObj = new Date();
dateObj.value = "DateValue";
@ -20,6 +17,4 @@ function testcase() {
prop: dateObj
});
return newObj.prop === "DateValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "DateValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a RegExp object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var regObj = new RegExp();
regObj.value = "RegExpValue";
@ -20,6 +17,4 @@ function testcase() {
prop: regObj
});
return newObj.prop === "RegExpValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "RegExpValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Error object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var errorObj = new Error();
errorObj.value = "ErrorValue";
@ -20,6 +17,4 @@ function testcase() {
prop: errorObj
});
return newObj.prop === "ErrorValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ErrorValue", 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Arguments
object which implements its own [[Get]] method to access the
'value' property (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var argObj = (function () { return arguments; })();
argObj.value = "ArgValue";
@ -20,6 +17,4 @@ function testcase() {
prop: argObj
});
return newObj.prop === "ArgValue";
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "ArgValue", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-178
description: >
Object.create - 'writable' property of one property in
'Properties' is true (8.10.5 step 6)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: true
@ -23,6 +20,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-18
description: >
Object.create - an enumerable inherited data property in
'Properties' is not defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
proto.prop = {};
@ -21,6 +18,4 @@ function testcase() {
var newObj = Object.create({}, child);
return !newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert.sameValue(newObj.hasOwnProperty("prop"), false, 'newObj.hasOwnProperty("prop")');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-180
description: >
Object.create - 'writable' property of one property in
'Properties' is own data property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: true
@ -23,6 +20,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-181
description: >
Object.create - 'writable' property of one property in
'Properties' is an inherited data property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
writable: true
};
@ -30,6 +27,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'writable' property of one property in
'Properties' is own data property that overrides an inherited data
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
writable: false
};
@ -33,6 +30,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'writable' property of one property in
'Properties' is own data property that overrides an inherited
accessor property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "writable", {
@ -39,6 +36,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-184
description: >
Object.create - 'writable' property of one property in
'Properties' is own accessor property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var descObj = {};
Object.defineProperty(descObj, "writable", {
@ -29,6 +26,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-185
description: >
Object.create - 'writable' property of one property in
'Properties' is an inherited accessor property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "writable", {
@ -34,6 +31,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'writable' property of one property in
'Properties' is own accessor property that overrides an inherited
data property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {
writable: false
};
@ -37,6 +34,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - 'writable' property of one property in
'Properties' is own accessor property that overrides an inherited
accessor property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "writable", {
@ -41,6 +38,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-19
description: >
Object.create - own enumerable accessor property in 'Properties'
is defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var props = {};
Object.defineProperty(props, "prop", {
@ -22,6 +19,4 @@ function testcase() {
var newObj = Object.create({}, props);
return newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Function object
which implements its own [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var Func = function (a, b) {
return a + b;
};
@ -29,6 +26,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Array object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var array = [1, 2, 3];
array.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a String object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var str = new String("abc");
str.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Boolean object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var booleanObj = new Boolean(false);
booleanObj.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Number object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var numObj = new Number(123);
numObj.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a Date object that
uses Object's [[Get]] method to access the 'writable' property
(8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var dateObj = new Date();
dateObj.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is a RegExp object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var regObj = new RegExp();
regObj.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -4,12 +4,8 @@
/*---
es5id: 15.2.3.5-4-2
description: Object.create - 'Properties' is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, undefined);
return (newObj instanceof Object);
}
runTestCase(testcase);
assert((newObj instanceof Object), '(newObj instanceof Object) !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-20
description: >
Object.create - own accessor property in 'Properties' which is not
enumerable is not defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var props = {};
Object.defineProperty(props, "prop", {
@ -22,6 +19,4 @@ function testcase() {
var newObj = Object.create({}, props);
return !newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert.sameValue(newObj.hasOwnProperty("prop"), false, 'newObj.hasOwnProperty("prop")');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Error object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var errorObj = new Error();
errorObj.writable = true;
@ -26,6 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,11 +7,8 @@ description: >
Object.create - one property in 'Properties' is an Arguments
object which implements its own [[Get]] method to access the
'writable' property (8.10.5 step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var argObj = (function () { return arguments; })();
argObj.writable = true;
@ -26,7 +23,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-206
description: >
Object.create - 'writable' property of one property in
'Properties' is true (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: true
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-21
description: >
Object.create - an enumerable inherited accessor property in
'Properties' is not defined in 'obj' (15.2.3.7 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
Object.defineProperty(proto, "prop", {
@ -26,6 +23,4 @@ function testcase() {
var newObj = Object.create({}, child);
return !newObj.hasOwnProperty("prop");
}
runTestCase(testcase);
assert.sameValue(newObj.hasOwnProperty("prop"), false, 'newObj.hasOwnProperty("prop")');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-212
description: >
Object.create - 'writable' property of one property in
'Properties' is a positive number primitive (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: 12
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-213
description: >
Object.create - 'writable' property of one property in
'Properties' is a negative number primitive (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: -9
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-215
description: >
Object.create - 'writable' property of one property in
'Properties' is a non-empty string (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: "abc"
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-216
description: >
Object.create - 'writable' property of one property in
'Properties' is a Function object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: function () { }
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-217
description: >
Object.create - 'writable' property of one property in
'Properties' is an Array object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: []
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-218
description: >
Object.create - 'writable' property of one property in
'Properties' is a String object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: new String()
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-219
description: >
Object.create - 'writable' property of one property in
'Properties' is a Boolean object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: new Boolean()
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -7,11 +7,8 @@ description: >
Object.create - own enumerable data property that overrides an
enumerable inherited data property in 'Properties' is defined in
'obj' (15.2.3.7 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var proto = {};
proto.prop = {
value: "abc"
@ -26,6 +23,5 @@ function testcase() {
};
var newObj = Object.create({}, child);
return newObj.hasOwnProperty("prop") && newObj.prop === "bbq";
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');
assert.sameValue(newObj.prop, "bbq", 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-220
description: >
Object.create - 'writable' property of one property in
'Properties' is a Number object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: new Number()
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-221
description: >
Object.create - 'writable' property of one property in
'Properties' is the Math object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: Math
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-222
description: >
Object.create - 'writable' property of one property in
'Properties' is a Date object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: new Date()
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-223
description: >
Object.create - 'writable' property of one property in
'Properties' is a RegExp object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var newObj = Object.create({}, {
prop: {
writable: new RegExp()
@ -20,6 +17,5 @@ function testcase() {
newObj.prop = 121;
return hasProperty && newObj.prop === 121;
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(newObj.prop, 121, 'newObj.prop');

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