Replace runTestCase with assert, try-finally, [test/built-ins/Object]

This commit is contained in:
André Bargull 2015-08-13 17:41:47 +02:00
parent 39b5b7272c
commit 6b48d9f1b2
215 changed files with 599 additions and 2153 deletions

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-10
description: >
Object.create - argument 'Properties' is the Math object (15.2.3.7
step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var result = false;
Object.defineProperty(Math, "prop", {
get: function () {
@ -21,11 +18,7 @@ function testcase() {
configurable: true
});
try {
var newObj = Object.create({}, Math);
return result && newObj.hasOwnProperty("prop");
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

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

View File

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

View File

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

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-13
description: >
Object.create - argument 'Properties' is the JSON object (15.2.3.7
step 2)
includes: [runTestCase.js]
---*/
function testcase() {
var result = false;
Object.defineProperty(JSON, "prop", {
@ -22,11 +19,7 @@ function testcase() {
configurable: true
});
try {
var newObj = Object.create({}, JSON);
return result && newObj.hasOwnProperty("prop");
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(result, 'result !== true');
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,21 +7,12 @@ description: >
Object.create - one property in 'Properties' is the Math object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Math.value = "MathValue";
var newObj = Object.create({}, {
prop: Math
});
return newObj.prop === "MathValue";
} finally {
delete Math.value;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "MathValue", 'newObj.prop');

View File

@ -7,21 +7,12 @@ description: >
Object.create - one property in 'Properties' is the JSON object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
try {
JSON.value = "JSONValue";
var newObj = Object.create({}, {
prop: JSON
});
return newObj.prop === "JSONValue";
} finally {
delete JSON.value;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "JSONValue", 'newObj.prop');

View File

@ -7,23 +7,13 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
try {
fnGlobalObject().value = "GlobalValue";
var newObj = Object.create({}, {
prop: fnGlobalObject()
});
return newObj.prop === "GlobalValue";
} finally {
delete fnGlobalObject().value;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop');

View File

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

View File

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

View File

@ -7,14 +7,9 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
try {
fnGlobalObject().writable = true;
var newObj = Object.create({}, {
@ -27,9 +22,5 @@ function testcase() {
var afterWrite = (newObj.prop === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete fnGlobalObject().writable;
}
}
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 the Math object
that uses Object's [[Get]] method to access the 'get' property
(8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Math.get = function () {
return "VerifyMathObject";
};
@ -20,9 +17,4 @@ function testcase() {
prop: Math
});
return newObj.prop === "VerifyMathObject";
} finally {
delete Math.get;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "VerifyMathObject", 'newObj.prop');

View File

@ -7,22 +7,14 @@ description: >
Object.create - one property in 'Properties' is the JSON object
that uses Object's [[Get]] method to access the 'get' property
(8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
JSON.get = function () {
return "VerifyJSONObject";
};
try {
var newObj = Object.create({}, {
prop: JSON
});
return newObj.prop === "VerifyJSONObject";
} finally {
delete JSON.get;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "VerifyJSONObject", 'newObj.prop');

View File

@ -7,24 +7,15 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'get' property
(8.10.5 step 7.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
fnGlobalObject().get = function () {
return "VerifyGlobalObject";
};
try {
var newObj = Object.create({}, {
prop: fnGlobalObject()
});
return newObj.prop === "VerifyGlobalObject";
} finally {
delete fnGlobalObject().get;
}
}
runTestCase(testcase);
assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop');

View File

@ -7,13 +7,10 @@ description: >
Object.create - one property in 'Properties' is the Math object
that uses Object's [[Get]] method to access the 'set' property
(8.10.5 step 8.a)
includes: [runTestCase.js]
---*/
function testcase() {
var data = "data";
try {
Math.set = function (value) {
data = value;
};
@ -26,9 +23,5 @@ function testcase() {
newObj.prop = "overrideData";
return hasProperty && data === "overrideData";
} finally {
delete Math.set;
}
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(data, "overrideData", 'data');

View File

@ -7,13 +7,10 @@ description: >
Object.create - one property in 'Properties' is the JSON object
that uses Object's [[Get]] method to access the 'set' property
(8.10.5 step 8.a)
includes: [runTestCase.js]
---*/
function testcase() {
var data = "data";
try {
JSON.set = function (value) {
data = value;
};
@ -26,9 +23,5 @@ function testcase() {
newObj.prop = "overrideData";
return hasProperty && data === "overrideData";
} finally {
delete JSON.set;
}
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(data, "overrideData", 'data');

View File

@ -7,15 +7,11 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'set' property
(8.10.5 step 8.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var data = "data";
try {
fnGlobalObject().set = function (value) {
data = value;
};
@ -28,9 +24,5 @@ function testcase() {
newObj.prop = "overrideData";
return hasProperty && data === "overrideData";
} finally {
delete fnGlobalObject().set;
}
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(data, "overrideData", 'data');

View File

@ -7,20 +7,12 @@ description: >
Object.create - 'Properties' is the Math object that uses Object's
[[Get]] method to access own enumerable property (15.2.3.7 step
5.a)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Math.prop = {
value: 12,
enumerable: true
};
var newObj = Object.create({}, Math);
return newObj.hasOwnProperty("prop");
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,20 +7,12 @@ description: >
Object.create - 'Properties' is the JSON object that uses Object's
[[Get]] method to access own enumerable property (15.2.3.7 step
5.a)
includes: [runTestCase.js]
---*/
function testcase() {
try {
JSON.prop = {
value: 12,
enumerable: true
};
var newObj = Object.create({}, JSON);
return newObj.hasOwnProperty("prop");
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true');

View File

@ -7,14 +7,10 @@ description: >
Object.create - one property in 'Properties' is the Math object
that uses Object's [[Get]] method to access the 'enumerable'
property (8.10.5 step 3.a)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
try {
Math.enumerable = true;
var newObj = Object.create({}, {
@ -25,9 +21,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete Math.enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -7,14 +7,10 @@ description: >
Object.create - one property in 'Properties' is the JSON object
that uses Object's [[Get]] method to access the 'enumerable'
property (8.10.5 step 3.a)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
try {
JSON.enumerable = true;
var newObj = Object.create({}, {
@ -25,9 +21,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete JSON.enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -7,16 +7,11 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'enumerable'
property (8.10.5 step 3.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var accessed = false;
try {
fnGlobalObject().enumerable = true;
var newObj = Object.create({}, {
@ -27,9 +22,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete fnGlobalObject().enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -4,15 +4,11 @@
/*---
es5id: 15.2.3.7-2-11
description: Object.defineProperties - argument 'Properties' is the Math object
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
var result = false;
try {
Object.defineProperty(Math, "prop", {
get: function () {
result = (this === Math);
@ -23,9 +19,5 @@ function testcase() {
});
Object.defineProperties(obj, Math);
return result;
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(result, 'result !== true');

View File

@ -4,15 +4,11 @@
/*---
es5id: 15.2.3.7-2-14
description: Object.defineProperties - argument 'Properties' is the JSON object
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
var result = false;
try {
Object.defineProperty(JSON, "prop", {
get: function () {
result = (this === JSON);
@ -23,9 +19,5 @@ function testcase() {
});
Object.defineProperties(obj, JSON);
return result;
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(result, 'result !== true');

View File

@ -6,13 +6,9 @@ es5id: 15.2.3.7-2-18
description: >
Object.defineProperties - argument 'Properties' is the global
object
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
var result = false;
@ -27,11 +23,11 @@ function testcase() {
});
Object.defineProperties(obj, fnGlobalObject());
return result;
} catch (e) {
return (e instanceof TypeError);
if (!(e instanceof TypeError)) throw e;
result = true;
} finally {
delete fnGlobalObject().prop;
}
}
runTestCase(testcase);
assert(result, 'result !== true');

View File

@ -6,22 +6,14 @@ es5id: 15.2.3.7-5-a-12
description: >
Object.defineProperties - 'Properties' is the Math object which
implements its own [[Get]] method to get enumerable own property
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.prop = {
value: 12
};
Object.defineProperties(obj, Math);
return obj.hasOwnProperty("prop") && obj.prop === 12;
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
assert.sameValue(obj.prop, 12, 'obj.prop');

View File

@ -6,21 +6,14 @@ es5id: 15.2.3.7-5-a-15
description: >
Object.defineProperties - 'Properties' is the JSON object which
implements its own [[Get]] method to get enumerable own property
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.prop = {
value: 15
};
Object.defineProperties(obj, JSON);
return obj.hasOwnProperty("prop") && obj.prop === 15;
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
assert.sameValue(obj.prop, 15, 'obj.prop');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperties - 'descObj' is the Math object which
implements its own [[Get]] method to get 'value' property (8.10.5
step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.value = "Math";
Object.defineProperties(obj, {
property: Math
});
return obj.property === "Math";
} finally {
delete Math.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Math", 'obj.property');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperties - 'descObj' is the JSON object which
implements its own [[Get]] method to get 'value' property (8.10.5
step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.value = "JSON";
Object.defineProperties(obj, {
property: JSON
});
return obj.property === "JSON";
} finally {
delete JSON.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "JSON", 'obj.property');

View File

@ -7,24 +7,15 @@ description: >
Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'value' property (8.10.5
step 5.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().value = "global";
Object.defineProperties(obj, {
property: fnGlobalObject()
});
return obj.property === "global";
} finally {
delete fnGlobalObject().value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -13,7 +13,6 @@ includes: [propertyHelper.js]
var obj = {};
try {
Math.writable = false;
Object.defineProperties(obj, {
@ -22,7 +21,3 @@ try {
assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property");
} finally {
delete Math.writable;
}

View File

@ -12,7 +12,6 @@ includes: [propertyHelper.js]
var obj = {};
try {
JSON.writable = false;
Object.defineProperties(obj, {
@ -21,8 +20,3 @@ try {
assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property");
} finally {
delete JSON.writable;
}

View File

@ -15,7 +15,6 @@ includes:
var obj = {};
try {
fnGlobalObject().writable = false;
Object.defineProperties(obj, {
@ -24,9 +23,3 @@ try {
assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property");
} finally {
delete fnGlobalObject().writable;
}

View File

@ -7,14 +7,10 @@ description: >
Object.defineProperties - 'descObj' is the Math object which
implements its own [[Get]] method to get 'get' property (8.10.5
step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.get = function () {
return "Math";
};
@ -23,9 +19,4 @@ function testcase() {
property: Math
});
return obj.property === "Math";
} finally {
delete Math.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Math", 'obj.property');

View File

@ -7,14 +7,10 @@ description: >
Object.defineProperties - 'descObj' is the JSON object which
implements its own [[Get]] method to get 'get' property (8.10.5
step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.get = function () {
return "JSON";
};
@ -23,9 +19,4 @@ function testcase() {
property: JSON
});
return obj.property === "JSON";
} finally {
delete JSON.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "JSON", 'obj.property');

View File

@ -7,16 +7,11 @@ description: >
Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'get' property (8.10.5
step 7.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().get = function () {
return "global";
};
@ -25,9 +20,4 @@ function testcase() {
property: fnGlobalObject()
});
return obj.property === "global";
} finally {
delete fnGlobalObject().get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -7,15 +7,11 @@ description: >
Object.defineProperties - 'descObj' is the Math object which
implements its own [[Get]] method to get 'enumerable' property
(8.10.5 step 3.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
var accessed = false;
try {
Math.enumerable = true;
Object.defineProperties(obj, {
@ -26,9 +22,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete Math.enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -7,16 +7,13 @@ description: >
Object.defineProperties - 'descObj' is the Math object which
implements its own [[Get]] method to get 'set' property (8.10.5
step 8.a)
includes: [runTestCase.js]
---*/
function testcase() {
var data = "data";
var setFun = function (value) {
data = value;
};
try {
Math.prop = {
set: setFun
};
@ -24,9 +21,6 @@ function testcase() {
var obj = {};
Object.defineProperties(obj, Math);
obj.prop = "mathData";
return obj.hasOwnProperty("prop") && data === "mathData";
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
assert.sameValue(data, "mathData", 'data');

View File

@ -7,16 +7,13 @@ description: >
Object.defineProperties - 'descObj' is the JSON object which
implements its own [[Get]] method to get 'set' property (8.10.5
step 8.a)
includes: [runTestCase.js]
---*/
function testcase() {
var data = "data";
var setFun = function (value) {
data = value;
};
try {
JSON.prop = {
set: setFun
};
@ -24,9 +21,6 @@ function testcase() {
var obj = {};
Object.defineProperties(obj, JSON);
obj.prop = "JSONData";
return obj.hasOwnProperty("prop") && data === "JSONData";
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
assert.sameValue(data, "JSONData", 'data');

View File

@ -7,15 +7,11 @@ description: >
Object.defineProperties - 'descObj' is the JSON object which
implements its own [[Get]] method to get 'enumerable' property
(8.10.5 step 3.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
var accessed = false;
try {
JSON.enumerable = true;
Object.defineProperties(obj, {
@ -26,9 +22,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete JSON.enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -7,17 +7,12 @@ description: >
Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'enumerable' property
(8.10.5 step 3.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
var accessed = false;
try {
fnGlobalObject().enumerable = true;
Object.defineProperties(obj, {
@ -28,9 +23,5 @@ function testcase() {
accessed = true;
}
}
return accessed;
} finally {
delete fnGlobalObject().enumerable;
}
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -7,14 +7,10 @@ description: >
Object.defineProperties - 'descObj' is the Math object which
implements its own [[Get]] method to get 'configurable' property
(8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.configurable = true;
Object.defineProperties(obj, {
@ -25,9 +21,5 @@ function testcase() {
delete obj.prop;
var result2 = obj.hasOwnProperty("prop");
return result1 === true && result2 === false;
} finally {
delete Math.configurable;
}
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,14 +7,10 @@ description: >
Object.defineProperties - 'descObj' is the JSON object which
implements its own [[Get]] method to get 'configurable' property
(8.10.5 step 4.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.configurable = true;
Object.defineProperties(obj, {
@ -25,9 +21,5 @@ function testcase() {
delete obj.prop;
var result2 = obj.hasOwnProperty("prop");
return result1 === true && result2 === false;
} finally {
delete JSON.configurable;
}
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,16 +7,11 @@ description: >
Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'configurable' property
(8.10.5 step 4.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().configurable = true;
Object.defineProperties(obj, {
@ -27,9 +22,5 @@ function testcase() {
delete obj.prop;
var result2 = obj.hasOwnProperty("prop");
return result1 === true && result2 === false;
} finally {
delete fnGlobalObject().configurable;
}
}
runTestCase(testcase);
assert.sameValue(result1, true, 'result1');
assert.sameValue(result2, false, 'result2');

View File

@ -7,14 +7,12 @@ description: >
Object.defineProperties - 'O' is an Array, test the length
property of 'O' is own data property that overrides an inherited
data property (15.4.5.1 step 1)
includes: [runTestCase.js]
---*/
function testcase() {
var arrProtoLen;
var arr = [0, 1, 2];
try {
assert.throws(TypeError, function() {
arrProtoLen = Array.prototype.length;
Array.prototype.length = 0;
@ -25,14 +23,10 @@ function testcase() {
Object.defineProperties(arr, {
length: { value: 1 }
});
return false;
} catch (e) {
var desc = Object.getOwnPropertyDescriptor(arr, "length");
});
return e instanceof TypeError && desc.value === 3 &&
desc.writable && !desc.enumerable && !desc.configurable;
} finally {
Array.prototype.length = arrProtoLen;
}
}
runTestCase(testcase);
var desc = Object.getOwnPropertyDescriptor(arr, "length");
assert.sameValue(desc.value, 3, 'desc.value');
assert(desc.writable, 'desc.writable !== true');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.configurable, false, 'desc.configurable');

View File

@ -9,13 +9,10 @@ description: >
of the length property, test the [[Configurable]] attribute of
inherited data property with large index named in 'O' can't stop
deleting index named properties (15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
Array.prototype[1] = 2; //we are not allowed to set the [[Configurable]] attribute of property "1" to false here, since Array.prototype is a global object, and non-configurbale property can't revert to configurable
Object.defineProperties(arr, {
@ -24,9 +21,7 @@ function testcase() {
}
});
return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 2;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
assert.sameValue(arr.length, 1, 'arr.length');
assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]');

View File

@ -10,13 +10,11 @@ description: >
own data property with large index named in 'O' that overrides
inherited data property can stop deleting index named properties
(15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
assert.throws(TypeError, function() {
Object.defineProperty(arr, "1", {
configurable: false
});
@ -28,12 +26,8 @@ function testcase() {
value: 1
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr.length === 2 &&
arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 1;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
});
assert.sameValue(arr.length, 2, 'arr.length');
assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(arr[1], 1, 'arr[1]');

View File

@ -10,13 +10,11 @@ description: >
own data property with large index named in 'O' that overrides
inherited accessor property can stop deleting index named
properties (15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
assert.throws(TypeError, function() {
Object.defineProperty(arr, "1", {
configurable: false
});
@ -33,13 +31,9 @@ function testcase() {
value: 1
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") &&
arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
});
assert.sameValue(arr.length, 2, 'arr.length');
assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(arr[1], 1, 'arr[1]');
assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-17
description: >
Object.defineProperties - 'O' is the Math object which implements
its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 )
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.defineProperty(Math, "prop", {
value: 11,
writable: true,
@ -24,9 +20,6 @@ function testcase() {
value: 12
}
});
return hasProperty && Math.prop === 12;
} finally {
delete Math.prop;
}
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(Math.prop, 12, 'Math.prop');

View File

@ -9,13 +9,10 @@ description: >
of the length property, test the [[Configurable]] attribute of
inherited accessor property with large index named in 'O' can't
stop deleting index named properties (15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
Object.defineProperty(Array.prototype, "1", {
get: function () {
return 1;
@ -29,9 +26,7 @@ function testcase() {
}
});
return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 1;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
assert.sameValue(arr.length, 1, 'arr.length');
assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(Array.prototype[1], 1, 'Array.prototype[1]');

View File

@ -10,13 +10,11 @@ description: >
own accessor property with large index named in 'O' that overrides
inherited data property can stop deleting index named properties
(15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
assert.throws(TypeError, function() {
Object.defineProperty(arr, "1", {
get: function () {
return 2;
@ -31,12 +29,8 @@ function testcase() {
value: 1
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr.length === 2 &&
arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 2;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
});
assert.sameValue(arr.length, 2, 'arr.length');
assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(arr[1], 2, 'arr[1]');

View File

@ -10,13 +10,11 @@ description: >
own accessor property with large index named in 'O' that overrides
inherited accessor property can stop deleting index named
properties (15.4.5.1 step 3.l.ii)
includes: [runTestCase.js]
---*/
function testcase() {
var arr = [0, 1];
try {
assert.throws(TypeError, function() {
Object.defineProperty(arr, "1", {
get: function () {
return 1;
@ -36,12 +34,9 @@ function testcase() {
value: 1
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") &&
arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
});
assert.sameValue(arr.length, 2, 'arr.length');
assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true');
assert.sameValue(arr[0], 0, 'arr[0]');
assert.sameValue(arr[1], 1, 'arr[1]');
assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-187
description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
named property, 'P' is inherited data property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.defineProperty(Array.prototype, "0", {
value: 11,
configurable: true
@ -23,9 +20,7 @@ function testcase() {
configurable: false
}
});
return arr.hasOwnProperty("0") && typeof arr[0] === "undefined" && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true');
assert.sameValue(typeof arr[0], "undefined", 'typeof arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -7,17 +7,16 @@ description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
named property, 'P' is own data property that overrides an
inherited data property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var arr = [];
assert.throws(TypeError, function() {
Object.defineProperty(Array.prototype, "0", {
value: 11,
configurable: true
});
var arr = [];
Object.defineProperty(arr, "0", {
value: 12,
configurable: false
@ -28,11 +27,6 @@ function testcase() {
configurable: true
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
});
assert.sameValue(arr[0], 12, 'arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -7,11 +7,11 @@ description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
named property, 'P' is own data property that overrides an
inherited accessor property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var arr = [];
assert.throws(TypeError, function() {
Object.defineProperty(Array.prototype, "0", {
get: function () {
return 11;
@ -19,7 +19,6 @@ function testcase() {
configurable: true
});
var arr = [];
Object.defineProperty(arr, "0", {
value: 12,
configurable: false
@ -30,11 +29,6 @@ function testcase() {
configurable: true
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
});
assert.sameValue(arr[0], 12, 'arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-191
description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
property, 'P' is inherited accessor property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.defineProperty(Array.prototype, "0", {
get: function () {
return 11;
@ -28,9 +25,7 @@ function testcase() {
configurable: false
}
});
return arr.hasOwnProperty("0") && arr[0] === 12 && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true');
assert.sameValue(arr[0], 12, 'arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -7,17 +7,16 @@ description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
named property, 'P' is own accessor property that overrides an
inherited data property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var arr = [];
assert.throws(TypeError, function() {
Object.defineProperty(Array.prototype, "0", {
value: 11,
configurable: true
});
var arr = [];
Object.defineProperty(arr, "0", {
get: function () {
return 12;
@ -30,11 +29,6 @@ function testcase() {
configurable: true
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
});
assert.sameValue(arr[0], 12, 'arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -7,11 +7,11 @@ description: >
Object.defineProperties - 'O' is an Array, 'P' is an array index
named property, 'P' is own accessor property that overrides an
inherited accessor property (15.4.5.1 step 4.c)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var arr = [];
assert.throws(TypeError, function() {
Object.defineProperty(Array.prototype, "0", {
get: function () {
return 11;
@ -19,7 +19,6 @@ function testcase() {
configurable: true
});
var arr = [];
Object.defineProperty(arr, "0", {
get: function () {
return 12;
@ -32,11 +31,6 @@ function testcase() {
configurable: true
}
});
return false;
} catch (e) {
return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11;
} finally {
delete Array.prototype[0];
}
}
runTestCase(testcase);
});
assert.sameValue(arr[0], 12, 'arr[0]');
assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]');

View File

@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-20
description: >
Object.defineProperties - 'O' is a JSON object which implements
its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 )
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.defineProperty(JSON, "prop", {
value: 11,
writable: true,
@ -23,9 +19,6 @@ function testcase() {
value: 12
}
});
return hasProperty && JSON.prop === 12;
} finally {
delete JSON.prop;
}
}
runTestCase(testcase);
assert(hasProperty, 'hasProperty !== true');
assert.sameValue(JSON.prop, 12, 'JSON.prop');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Function object which
implements its own [[Get]] method to access the 'value' property
of prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Function.prototype.value = "Function";
var funObj = function (a, b) {
return a + b;
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", funObj);
return obj.property === "Function";
} finally {
delete Function.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Function", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is an Array object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Array.prototype.value = "Array";
var arrObj = [1, 2, 3];
Object.defineProperty(obj, "property", arrObj);
return obj.property === "Array";
} finally {
delete Array.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Array", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is a String object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
String.prototype.value = "String";
var strObj = new String("abc");
Object.defineProperty(obj, "property", strObj);
return obj.property === "String";
} finally {
delete String.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "String", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is a Boolean object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Boolean.prototype.value = "Boolean";
var boolObj = new Boolean(true);
Object.defineProperty(obj, "property", boolObj);
return obj.property === "Boolean";
} finally {
delete Boolean.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Boolean", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is a Number object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Number.prototype.value = "Number";
var numObj = new Number(-2);
Object.defineProperty(obj, "property", numObj);
return obj.property === "Number";
} finally {
delete Number.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Number", 'obj.property');

View File

@ -7,20 +7,12 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.value = "Math";
Object.defineProperty(obj, "property", Math);
return obj.property === "Math";
} finally {
delete Object.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Math", 'obj.property');

View File

@ -7,20 +7,12 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'value' property (8.10.5
step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.value = "Math";
Object.defineProperty(obj, "property", Math);
return obj.property === "Math";
} finally {
delete Math.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Math", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is a Date object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Date.prototype.value = "Date";
var dateObj = new Date();
Object.defineProperty(obj, "property", dateObj);
return obj.property === "Date";
} finally {
delete Date.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Date", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is a RegExp object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
RegExp.prototype.value = "RegExp";
var regObj = new RegExp();
Object.defineProperty(obj, "property", regObj);
return obj.property === "RegExp";
} finally {
delete RegExp.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "RegExp", 'obj.property');

View File

@ -7,20 +7,12 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.value = "JSON";
Object.defineProperty(obj, "property", JSON);
return obj.property === "JSON";
} finally {
delete Object.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "JSON", 'obj.property');

View File

@ -7,20 +7,12 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'value' property (8.10.5
step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.value = "JSON";
Object.defineProperty(obj, "property", JSON);
return obj.property === "JSON";
} finally {
delete JSON.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "JSON", 'obj.property');

View File

@ -7,20 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is an Error object that uses
Object's [[Get]] method to access the 'value' property of
prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Error.prototype.value = "Error";
var errObj = new Error();
Object.defineProperty(obj, "property", errObj);
return obj.property === "Error";
} finally {
delete Error.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "Error", 'obj.property');

View File

@ -7,21 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is an Arguments object which
implements its own [[Get]] method to access the 'value' property
of prototype object (8.10.5 step 5.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.value = "arguments";
var argObj = (function () { return arguments; })();
Object.defineProperty(obj, "property", argObj);
return obj.property === "arguments";
} finally {
delete Object.prototype.value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "arguments", 'obj.property');

View File

@ -7,22 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().value = "global";
Object.defineProperty(obj, "property", fnGlobalObject());
return obj.property === "global";
} finally {
delete fnGlobalObject().value;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -7,13 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Function object which
implements its own [[Get]] method to access the 'writable'
property of prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Function.prototype.writable = true;
var funObj = function (a, b) {
return a + b;
@ -27,9 +24,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Function.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Array object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Array.prototype.writable = true;
var arrObj = [1, 2, 3];
@ -24,9 +22,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Array.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a String object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
String.prototype.writable = true;
var strObj = new String("abc");
@ -24,9 +22,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete String.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Boolean object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Boolean.prototype.writable = true;
var boolObj = new Boolean(true);
@ -24,9 +22,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Boolean.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Number object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Number.prototype.writable = true;
var numObj = new Number(-2);
@ -24,9 +22,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Number.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,13 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.writable = true;
Object.defineProperty(obj, "property", Math);
@ -24,9 +21,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Object.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,13 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'writable' property (8.10.5
step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.writable = true;
Object.defineProperty(obj, "property", Math);
@ -24,9 +21,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Math.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a RegExp object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
RegExp.prototype.writable = true;
var regObj = new RegExp();
@ -25,9 +23,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete RegExp.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,13 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.writable = true;
Object.defineProperty(obj, "property", JSON);
@ -24,9 +21,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Object.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,13 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'writable' property (8.10.5
step 6.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.writable = true;
Object.defineProperty(obj, "property", JSON);
@ -24,9 +21,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete JSON.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Error object that uses
Object's [[Get]] method to access the 'writable' property of
prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Error.prototype.writable = true;
var errObj = new Error();
@ -25,9 +23,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Error.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Arguments object which
implements its own [[Get]] method to access the 'writable'
property of prototype object (8.10.5 step 6.b)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.writable = true;
var argObj = (function () { return arguments; })();
@ -25,9 +23,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete Object.prototype.writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,15 +7,11 @@ description: >
Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'writable' property
(8.10.5 step 6.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().writable = true;
Object.defineProperty(obj, "property", fnGlobalObject());
@ -26,9 +22,5 @@ function testcase() {
var afterWrite = (obj.property === "isWritable");
return beforeWrite === true && afterWrite === true;
} finally {
delete fnGlobalObject().writable;
}
}
runTestCase(testcase);
assert.sameValue(beforeWrite, true, 'beforeWrite');
assert.sameValue(afterWrite, true, 'afterWrite');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Function object which
implements its own [[Get]] method to access the 'get' property of
prototype object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Function.prototype.get = function () {
return "functionGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", funObj);
return obj.property === "functionGetProperty";
} finally {
delete Function.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "functionGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Array object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Array.prototype.get = function () {
return "arrayGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", arrObj);
return obj.property === "arrayGetProperty";
} finally {
delete Array.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "arrayGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a String object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
String.prototype.get = function () {
return "stringGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", strObj);
return obj.property === "stringGetProperty";
} finally {
delete String.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "stringGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Boolean object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Boolean.prototype.get = function () {
return "booleanGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", boolObj);
return obj.property === "booleanGetProperty";
} finally {
delete Boolean.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "booleanGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Number object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Number.prototype.get = function () {
return "numberGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", numObj);
return obj.property === "numberGetProperty";
} finally {
delete Number.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "numberGetProperty", 'obj.property');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.get = function () {
return "mathGetProperty";
};
Object.defineProperty(obj, "property", Math);
return obj.property === "mathGetProperty";
} finally {
delete Object.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "mathGetProperty", 'obj.property');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the Math object that uses
Object's [[Get]] method to access the 'get' property (8.10.5 step
7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Math.get = function () {
return "mathGetProperty";
};
Object.defineProperty(obj, "property", Math);
return obj.property === "mathGetProperty";
} finally {
delete Math.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "mathGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a Date object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Date.prototype.get = function () {
return "dateGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", dateObj);
return obj.property === "dateGetProperty";
} finally {
delete Date.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "dateGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is a RegExp object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
RegExp.prototype.get = function () {
return "regExpGetProperty";
};
@ -21,9 +19,4 @@ function testcase() {
Object.defineProperty(obj, "property", regObj);
return obj.property === "regExpGetProperty";
} finally {
delete RegExp.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "regExpGetProperty", 'obj.property');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.get = function () {
return "jsonGetProperty";
};
Object.defineProperty(obj, "property", JSON);
return obj.property === "jsonGetProperty";
} finally {
delete Object.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "jsonGetProperty", 'obj.property');

View File

@ -7,22 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the JSON object that uses
Object's [[Get]] method to access the 'get' property (8.10.5 step
7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
JSON.get = function () {
return "jsonGetProperty";
};
Object.defineProperty(obj, "property", JSON);
return obj.property === "jsonGetProperty";
} finally {
delete JSON.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "jsonGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Error object that uses
Object's [[Get]] method to access the 'get' property of prototype
object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Error.prototype.get = function () {
return "errorGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", errObj);
return obj.property === "errorGetProperty";
} finally {
delete Error.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "errorGetProperty", 'obj.property');

View File

@ -7,12 +7,10 @@ description: >
Object.defineProperty - 'Attributes' is an Arguments object which
implements its own [[Get]] method to access the 'get' property of
prototype object (8.10.5 step 7.a)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
try {
Object.prototype.get = function () {
return "argumentGetProperty";
};
@ -20,9 +18,4 @@ function testcase() {
Object.defineProperty(obj, "property", argObj);
return obj.property === "argumentGetProperty";
} finally {
delete Object.prototype.get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "argumentGetProperty", 'obj.property');

View File

@ -7,24 +7,15 @@ description: >
Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'get' property (8.10.5
step 7.a)
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var obj = {};
try {
fnGlobalObject().get = function () {
return "globalGetProperty";
};
Object.defineProperty(obj, "property", fnGlobalObject());
return obj.property === "globalGetProperty";
} finally {
delete fnGlobalObject().get;
}
}
runTestCase(testcase);
assert.sameValue(obj.property, "globalGetProperty", 'obj.property');

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