mirror of https://github.com/tc39/test262.git
strict: drop use of runTestCase, *AreCorrect fns
- this change hits all files that use dataPropertyAttributesAreCorrect or acccessorPropertyAttributesAreCorrect Major changes: - remove include of runTestCase.js, dataPropertyAttributesAreCorrect.js and acccessorPropertyAttributesAreCorrect.js - add include of propertyHelper.js - remove function testCase() and call to function runTestCase() - instead of collecting test state into booleans, which are eventually returned from runTestCase, test conditions and throw errors immediately - use negative: to check error types instead of using `instanceof` in a catch() block Selected commit logs follow: manual conversion of accessorPropertyAttributesAreCorrect() test - remove runTestCase - remove wrapping testCase function - unindent - remove includes of runTestCase & accessor... - add include of propertyHelper.js - unpack final two args 'true, false' to explicit inline tests of isEnumerable and isConfigurable - unpack setter test into inline logic - unpack getter test into inline logic used script to replace includes: frontmatter with propertyHelper.js ; manually added back references to fnGlobalObject() where needed additional helper functions add helper functions for get and writable duplicate runTestCase so can remove runTestCase.js from includes of all tests in batch use keyboard macros to simplify repetitive conversions remove auto-save file accidentaly committed minor changes, manually remove runTestCase from remaining files lint etc. fixes remove now-obsolete harness files make strict/nonstrict variants tests where behavior is different in strict/nonstrict need two variants - strict mode throws on assign to read-only element (no setter fn) - strict mode separates named arguments from arguments[] fix indentation cleanup minor issues reviewing 15.2.3.7-9 tests, found some minor issues - indentation/spacing - duplicate test (eg, direct test of value and dataProp...) - remove needless try/finally - use assert.. helpers in place of if(is.. - rename some assertions to 'e' rename assertX to verifyX new helper fn sameValue test "set" as well as get reverse order of checks restore test of desc2 restore test of length restore test of ownProperty incorporate suggestions re order of ops, Object.prototype add test of sameValue helper restore return value in getter restore second defineProperty call restore check of explicit "false" restore explicit test of TypeError set noStrict flag on arguments changes
This commit is contained in:
parent
61113dbfb3
commit
b8ff1ba1bd
|
@ -1,74 +0,0 @@
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//Verify all attributes specified accessor property of given object:
|
|
||||||
//get, set, enumerable, configurable
|
|
||||||
//If all attribute values are expected, return true, otherwise, return false
|
|
||||||
function accessorPropertyAttributesAreCorrect(obj,
|
|
||||||
name,
|
|
||||||
get,
|
|
||||||
set,
|
|
||||||
setVerifyHelpProp,
|
|
||||||
enumerable,
|
|
||||||
configurable) {
|
|
||||||
var attributesCorrect = true;
|
|
||||||
|
|
||||||
if (get !== undefined) {
|
|
||||||
if (obj[name] !== get()) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof get() === "number" &&
|
|
||||||
isNaN(get())) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (obj[name] !== undefined) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(obj, name);
|
|
||||||
if (typeof desc.set === "undefined") {
|
|
||||||
if (typeof set !== "undefined") {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
obj[name] = "toBeSetValue";
|
|
||||||
if (obj[setVerifyHelpProp] !== "toBeSetValue") {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (se) {
|
|
||||||
throw se;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var enumerated = false;
|
|
||||||
for (var prop in obj) {
|
|
||||||
if (obj.hasOwnProperty(prop) && prop === name) {
|
|
||||||
enumerated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enumerated !== enumerable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var deleted = false;
|
|
||||||
try {
|
|
||||||
delete obj[name];
|
|
||||||
} catch (de) {
|
|
||||||
throw de;
|
|
||||||
}
|
|
||||||
if (!obj.hasOwnProperty(name)) {
|
|
||||||
deleted = true;
|
|
||||||
}
|
|
||||||
if (deleted !== configurable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return attributesCorrect;
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//Verify all attributes specified data property of given object:
|
|
||||||
//value, writable, enumerable, configurable
|
|
||||||
//If all attribute values are expected, return true, otherwise, return false
|
|
||||||
function dataPropertyAttributesAreCorrect(obj,
|
|
||||||
name,
|
|
||||||
value,
|
|
||||||
writable,
|
|
||||||
enumerable,
|
|
||||||
configurable) {
|
|
||||||
var attributesCorrect = true;
|
|
||||||
|
|
||||||
if (obj[name] !== value) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof value === "number" &&
|
|
||||||
isNaN(value)) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (obj[name] === "oldValue") {
|
|
||||||
obj[name] = "newValue";
|
|
||||||
} else {
|
|
||||||
obj[name] = "OldValue";
|
|
||||||
}
|
|
||||||
} catch (we) {
|
|
||||||
}
|
|
||||||
|
|
||||||
var overwrited = false;
|
|
||||||
if (obj[name] !== value) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof value === "number" &&
|
|
||||||
isNaN(value)) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
overwrited = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (overwrited !== writable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var enumerated = false;
|
|
||||||
for (var prop in obj) {
|
|
||||||
if (obj.hasOwnProperty(prop) && prop === name) {
|
|
||||||
enumerated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enumerated !== enumerable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var deleted = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
delete obj[name];
|
|
||||||
} catch (de) {
|
|
||||||
}
|
|
||||||
if (!obj.hasOwnProperty(name)) {
|
|
||||||
deleted = true;
|
|
||||||
}
|
|
||||||
if (deleted !== configurable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return attributesCorrect;
|
|
||||||
}
|
|
|
@ -0,0 +1,176 @@
|
||||||
|
|
||||||
|
function isConfigurable(obj, name) {
|
||||||
|
try {
|
||||||
|
delete obj[name];
|
||||||
|
} catch (e) {
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !Object.prototype.hasOwnProperty.call(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isEnumerable(obj, name) {
|
||||||
|
for (var prop in obj) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(obj, prop) &&
|
||||||
|
sameValue(prop, name)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sameValue(x, y) {
|
||||||
|
if ((typeof x === "number") && (typeof y === "number")) {
|
||||||
|
// special case NaN and ±0
|
||||||
|
if (isNaN(x) && isNaN(y)) {
|
||||||
|
return true;
|
||||||
|
} else if ((x === 0) && (y === 0)) {
|
||||||
|
return (1 / x) === (1 / y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return x === y;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isEqualTo(obj, name, expectedValue) {
|
||||||
|
var actualValue = obj[name];
|
||||||
|
|
||||||
|
return sameValue(actualValue, expectedValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isWritable(obj, name, verifyProp) {
|
||||||
|
var newValue = "unlikelyValue";
|
||||||
|
|
||||||
|
try {
|
||||||
|
obj[name] = newValue;
|
||||||
|
} catch (e) {
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((verifyProp && isEqualTo(obj, verifyProp, newValue)) ||
|
||||||
|
isEqualTo(obj, name, newValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyEqualTo(obj, name, value) {
|
||||||
|
if (!isEqualTo(obj, name, value)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] to equal " + value +
|
||||||
|
", actually " + obj[name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyWritable(obj, name, verifyProp) {
|
||||||
|
if (!isWritable(obj, name, verifyProp)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] to be writable, but was not.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyNotWritable(obj, name, verifyProp) {
|
||||||
|
if (isWritable(obj, name, verifyProp)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] NOT to be writable, but was.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyEnumerable(obj, name) {
|
||||||
|
if (!isEnumerable(obj, name)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] to be enumerable, but was not.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyNotEnumerable(obj, name) {
|
||||||
|
if (isEnumerable(obj, name)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] NOT to be enumerable, but was.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyConfigurable(obj, name) {
|
||||||
|
if (!isConfigurable(obj, name)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] to be configurable, but was not.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyNotConfigurable(obj, name) {
|
||||||
|
if (isConfigurable(obj, name)) {
|
||||||
|
$ERROR("Expected obj[" + String(name) + "] NOT to be configurable, but was.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//Verify all attributes specified accessor property of given object:
|
||||||
|
//get, set, enumerable, configurable
|
||||||
|
//If all attribute values are expected, return true, otherwise throw
|
||||||
|
function accessorPropertyAttributesAreCorrect(obj,
|
||||||
|
name,
|
||||||
|
get,
|
||||||
|
set,
|
||||||
|
setVerifyHelpProp,
|
||||||
|
enumerable,
|
||||||
|
configurable) {
|
||||||
|
var attributesCorrect = true;
|
||||||
|
var prop = 'obj["' + name + '"]';
|
||||||
|
|
||||||
|
if (get !== undefined) {
|
||||||
|
verifyEqualTo(obj, name, get());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof set !== "undefined") {
|
||||||
|
verifyWritable(obj, name, setVerifyHelpProp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enumerable) {
|
||||||
|
verifyEnumerable(obj, name);
|
||||||
|
} else {
|
||||||
|
verifyNotEnumerable(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configurable) {
|
||||||
|
|
||||||
|
|
||||||
|
verifyConfigurable(obj, name);
|
||||||
|
} else {
|
||||||
|
verifyNotConfigurable(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//Verify all attributes specified data property of given object:
|
||||||
|
//value, writable, enumerable, configurable
|
||||||
|
//If all attribute values as expected, return true, otherwise throw
|
||||||
|
function dataPropertyAttributesAreCorrect(obj,
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
writable,
|
||||||
|
enumerable,
|
||||||
|
configurable) {
|
||||||
|
|
||||||
|
verifyEqualTo(obj, name, value);
|
||||||
|
|
||||||
|
if (writable) {
|
||||||
|
verifyWritable(obj, name);
|
||||||
|
} else {
|
||||||
|
verifyNotWritable(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enumerable) {
|
||||||
|
verifyEnumerable(obj, name);
|
||||||
|
} else {
|
||||||
|
verifyNotEnumerable(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configurable) {
|
||||||
|
verifyConfigurable(obj, name);
|
||||||
|
} else {
|
||||||
|
verifyNotConfigurable(obj, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -9,14 +9,9 @@ es5id: 15.2.3.5-4-315
|
||||||
description: >
|
description: >
|
||||||
Object.create - all properties in 'Properties' are enumerable
|
Object.create - all properties in 'Properties' are enumerable
|
||||||
(data property and accessor property) (15.2.3.7 step 7)
|
(data property and accessor property) (15.2.3.7 step 7)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var newObj = {};
|
var newObj = {};
|
||||||
function getFunc() {
|
function getFunc() {
|
||||||
return 10;
|
return 10;
|
||||||
|
@ -39,7 +34,7 @@ function testcase() {
|
||||||
configurable: true
|
configurable: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(newObj, "foo1", 200, true, true, true) &&
|
|
||||||
|
dataPropertyAttributesAreCorrect(newObj, "foo1", 200, true, true, true);
|
||||||
|
|
||||||
accessorPropertyAttributesAreCorrect(newObj, "foo2", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(newObj, "foo2", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -9,13 +9,9 @@ es5id: 15.2.3.6-4-100
|
||||||
description: >
|
description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
desc.value and name.value are two different values (8.12.9 step 12)
|
desc.value and name.value are two different values (8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
obj.foo = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
obj.foo = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
@ -23,6 +19,5 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
value: 200
|
value: 200
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -9,18 +9,13 @@ es5id: 15.2.3.6-4-101
|
||||||
description: >
|
description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
name.value is present and desc.value is undefined (8.12.9 step 12)
|
name.value is present and desc.value is undefined (8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
obj.foo = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
obj.foo = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", { value: undefined });
|
Object.defineProperty(obj, "foo", { value: undefined });
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, true, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -9,18 +9,13 @@ es5id: 15.2.3.6-4-102
|
||||||
description: >
|
description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
desc.value is present and name.value is undefined (8.12.9 step 12)
|
desc.value is present and name.value is undefined (8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
obj.foo = undefined; // default value of attributes: writable: true, configurable: true, enumerable: true
|
obj.foo = undefined; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", { value: 100 });
|
Object.defineProperty(obj, "foo", { value: 100 });
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", 100, true, true, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", 100, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,13 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
name.writable and desc.writable are different values (8.12.9 step
|
name.writable and desc.writable are different values (8.12.9 step
|
||||||
12)
|
12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
|
@ -26,6 +22,5 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
writable: true
|
writable: true
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, false, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,13 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
name.enumerable and desc.enumerable are different values (8.12.9
|
name.enumerable and desc.enumerable are different values (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
|
@ -27,6 +23,5 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, false, true, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", undefined, false, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,13 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
name.configurable = true and desc.configurable = false (8.12.9
|
name.configurable = true and desc.configurable = false (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
|
@ -30,6 +26,5 @@ function testcase() {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, false);
|
dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,13 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are data properties,
|
Object.defineProperty - 'name' and 'desc' are data properties,
|
||||||
several attributes values of name and desc are different (8.12.9
|
several attributes values of name and desc are different (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
|
@ -31,6 +27,5 @@ function testcase() {
|
||||||
writable: false,
|
writable: false,
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(obj, "foo", 200, false, false, true);
|
dataPropertyAttributesAreCorrect(obj, "foo", 200, false, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
both desc.[[Get]] and name.[[Get]] are two different values
|
both desc.[[Get]] and name.[[Get]] are two different values
|
||||||
(8.12.9 step 12)
|
(8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -40,6 +37,4 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
get: getFunc2
|
get: getFunc2
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc2, setFunc, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc2, setFunc, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor
|
Object.defineProperty - 'name' and 'desc' are accessor
|
||||||
properties, name.[[Get]] is present and desc.[[Get]] is undefined
|
properties, name.[[Get]] is present and desc.[[Get]] is undefined
|
||||||
(8.12.9 step 12)
|
(8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -38,6 +35,4 @@ function testcase() {
|
||||||
set: setFunc,
|
set: setFunc,
|
||||||
get: undefined
|
get: undefined
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", undefined, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", undefined, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
name.[[Get]] is undefined and desc.[[Get]] is function (8.12.9
|
name.[[Get]] is undefined and desc.[[Get]] is function (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
function setFunc(value) {
|
function setFunc(value) {
|
||||||
|
@ -36,6 +33,4 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
get: getFunc
|
get: getFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
both desc.[[Set]] and name.[[Set]] are two different values
|
both desc.[[Set]] and name.[[Set]] are two different values
|
||||||
(8.12.9 step 12)
|
(8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -36,6 +33,4 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
set: setFunc2
|
set: setFunc2
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", undefined, setFunc2, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", undefined, setFunc2, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
name.[[Set]] is undefined and desc.[[Set]] is function (8.12.9
|
name.[[Set]] is undefined and desc.[[Set]] is function (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -37,6 +34,4 @@ function testcase() {
|
||||||
Object.defineProperty(obj, "foo", {
|
Object.defineProperty(obj, "foo", {
|
||||||
set: setFunc
|
set: setFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
name.enumerable and desc.enumerable are different values (8.12.9
|
name.enumerable and desc.enumerable are different values (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -34,6 +31,4 @@ function testcase() {
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
name.configurable = true and desc.configurable = false (8.12.9
|
name.configurable = true and desc.configurable = false (8.12.9
|
||||||
step 12)
|
step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -37,6 +34,4 @@ function testcase() {
|
||||||
get: getFunc,
|
get: getFunc,
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
Object.defineProperty - 'name' and 'desc' are accessor properties,
|
||||||
several attributes values of 'name' and 'desc' are different
|
several attributes values of 'name' and 'desc' are different
|
||||||
(8.12.9 step 12)
|
(8.12.9 step 12)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
|
||||||
|
@ -42,6 +39,4 @@ function testcase() {
|
||||||
set: setFunc2,
|
set: setFunc2,
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc2, setFunc2, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(obj, "foo", getFunc2, setFunc2, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,13 @@ description: >
|
||||||
property of 'O', the [[Value]] field of 'desc' is absent, test
|
property of 'O', the [[Value]] field of 'desc' is absent, test
|
||||||
updating the [[Writable]] attribute of the length property from
|
updating the [[Writable]] attribute of the length property from
|
||||||
true to false (15.4.5.1 step 3.a.i)
|
true to false (15.4.5.1 step 3.a.i)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "length", {
|
Object.defineProperty(arrObj, "length", {
|
||||||
writable: false
|
writable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "length", 0, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "length", 0, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,13 +11,11 @@ description: >
|
||||||
named property, 'name' is own data property, test TypeError is
|
named property, 'name' is own data property, test TypeError is
|
||||||
thrown on updating the configurable attribute from false to true
|
thrown on updating the configurable attribute from false to true
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
value: "ownDataProperty",
|
value: "ownDataProperty",
|
||||||
configurable: false
|
configurable: false
|
||||||
|
@ -27,10 +25,10 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError &&
|
|
||||||
dataPropertyAttributesAreCorrect(arrObj, "0", "ownDataProperty", false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", "ownDataProperty", false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,10 +10,8 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'name' is an inherited data property, test that
|
named property, 'name' is an inherited data property, test that
|
||||||
defining own index named property is successful (15.4.5.1 step 4.c)
|
defining own index named property is successful (15.4.5.1 step 4.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(Array.prototype, "0", {
|
Object.defineProperty(Array.prototype, "0", {
|
||||||
value: 11,
|
value: 11,
|
||||||
|
@ -25,10 +23,17 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return arrObj.hasOwnProperty("0") && Array.prototype[0] === 11 && typeof arrObj[0] === "undefined";
|
|
||||||
|
if (!arrObj.hasOwnProperty("0")) {
|
||||||
|
$ERROR("Expected arrObj.hasOwnProperty('0') === true, actually " + arrObj.hasOwnProperty("0"));
|
||||||
|
}
|
||||||
|
if (Array.prototype[0] !== 11) {
|
||||||
|
$ERROR("Expected Array.prototype[0] === 11), actually " + Array.prototype[0]);
|
||||||
|
}
|
||||||
|
if (typeof arrObj[0] !== "undefined") {
|
||||||
|
$ERROR("Expected typeof arrObj[0] === 'undefined'), actually " + typeof arrObj[0]);
|
||||||
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
delete Array.prototype[0];
|
delete Array.prototype[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, 'name' is own accessor property, test TypeError is
|
named property, 'name' is own accessor property, test TypeError is
|
||||||
thrown on updating the configurable attribute from false to true
|
thrown on updating the configurable attribute from false to true
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var getFunc = function () {
|
var getFunc = function () {
|
||||||
return 11;
|
return 11;
|
||||||
|
@ -31,10 +28,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError &&
|
|
||||||
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,16 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'name' is an inherited accessor property (15.4.5.1
|
named property, 'name' is an inherited accessor property (15.4.5.1
|
||||||
step 4.c)
|
step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function getFunc() {
|
||||||
|
return arrObj.helpVerifySet;
|
||||||
|
}
|
||||||
|
function setFunc(value) {
|
||||||
|
arrObj.helpVerifySet = value;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(Array.prototype, "0", {
|
Object.defineProperty(Array.prototype, "0", {
|
||||||
get: function () {
|
get: function () {
|
||||||
|
@ -26,12 +30,6 @@ function testcase() {
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
function getFunc() {
|
|
||||||
return arrObj.helpVerifySet;
|
|
||||||
}
|
|
||||||
function setFunc(value) {
|
|
||||||
arrObj.helpVerifySet = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
get: getFunc,
|
get: getFunc,
|
||||||
|
@ -41,9 +39,7 @@ function testcase() {
|
||||||
|
|
||||||
arrObj[0] = 13;
|
arrObj[0] = 13;
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false);
|
||||||
} finally {
|
} finally {
|
||||||
delete Array.prototype[0];
|
delete Array.prototype[0];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,14 @@ description: >
|
||||||
named property, 'name' property doesn't exist in 'O', test 'name'
|
named property, 'name' property doesn't exist in 'O', test 'name'
|
||||||
is defined as data property when 'desc' is generic descriptor
|
is defined as data property when 'desc' is generic descriptor
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Value]] of 'name' property of 'Attributes' is set as undefined
|
[[Value]] of 'name' property of 'Attributes' is set as undefined
|
||||||
if [[Value]] is absent in data descriptor 'desc' (15.4.5.1 step
|
if [[Value]] is absent in data descriptor 'desc' (15.4.5.1 step
|
||||||
4.c)
|
4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -26,6 +23,5 @@ function testcase() {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Writable]] is absent in data descriptor 'desc', test
|
[[Writable]] is absent in data descriptor 'desc', test
|
||||||
[[Writable]] attribute of property 'name' is set to false
|
[[Writable]] attribute of property 'name' is set to false
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -25,6 +22,5 @@ function testcase() {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, true, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Enumerable]] is absent in data descriptor 'desc', test
|
[[Enumerable]] is absent in data descriptor 'desc', test
|
||||||
[[Enumerable]] of property 'name' is set to false (15.4.5.1 step
|
[[Enumerable]] of property 'name' is set to false (15.4.5.1 step
|
||||||
4.c)
|
4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -25,6 +22,5 @@ function testcase() {
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, false, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Configurable]] is absent in data descriptor 'desc', test
|
[[Configurable]] is absent in data descriptor 'desc', test
|
||||||
[[Configurable]] of property 'name' is set to false (15.4.5.1 step
|
[[Configurable]] of property 'name' is set to false (15.4.5.1 step
|
||||||
4.c)
|
4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -25,6 +22,5 @@ function testcase() {
|
||||||
writable: true,
|
writable: true,
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, true, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'desc' is data descriptor, test updating all
|
named property, 'desc' is data descriptor, test updating all
|
||||||
attribute values of 'name' (15.4.5.1 step 4.c)
|
attribute values of 'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [1]; // default value of attributes: writable: true, configurable: true, enumerable: true
|
var arrObj = [1]; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -25,6 +22,5 @@ function testcase() {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, 'name' property doesn't exist in 'O' and [[Get]]
|
named property, 'name' property doesn't exist in 'O' and [[Get]]
|
||||||
is absent in accessor descriptor 'desc', test [[Get]] attribute of
|
is absent in accessor descriptor 'desc', test [[Get]] attribute of
|
||||||
property 'name' is set to undefined (15.4.5.1 step 4.c)
|
property 'name' is set to undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var setFunc = function (value) {
|
var setFunc = function (value) {
|
||||||
arrObj.setVerifyHelpProp = value;
|
arrObj.setVerifyHelpProp = value;
|
||||||
|
@ -28,6 +25,4 @@ function testcase() {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Enumerable]] is absent in accessor descriptor 'desc', test
|
[[Enumerable]] is absent in accessor descriptor 'desc', test
|
||||||
[[Enumerable]] attribute of property 'name' is set to false
|
[[Enumerable]] attribute of property 'name' is set to false
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
var setFunc = function (value) {
|
var setFunc = function (value) {
|
||||||
|
@ -30,6 +27,4 @@ function testcase() {
|
||||||
get: getFunc,
|
get: getFunc,
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
[[Configurable]] is absent in accessor descriptor 'desc', test
|
[[Configurable]] is absent in accessor descriptor 'desc', test
|
||||||
[[Configurable]] attribute of property 'name' is set to false
|
[[Configurable]] attribute of property 'name' is set to false
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var setFunc = function (value) {
|
var setFunc = function (value) {
|
||||||
arrObj.setVerifyHelpProp = value;
|
arrObj.setVerifyHelpProp = value;
|
||||||
|
@ -29,6 +26,4 @@ function testcase() {
|
||||||
get: getFunc,
|
get: getFunc,
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'desc' is accessor descriptor, test updating all
|
named property, 'desc' is accessor descriptor, test updating all
|
||||||
attribute values of 'name' (15.4.5.1 step 4.c)
|
attribute values of 'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var setFunc = function (value) {
|
var setFunc = function (value) {
|
||||||
arrObj.setVerifyHelpProp = value;
|
arrObj.setVerifyHelpProp = value;
|
||||||
|
@ -40,6 +37,4 @@ function testcase() {
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,17 +10,13 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'name' makes no change if every field in 'desc' is
|
named property, 'name' makes no change if every field in 'desc' is
|
||||||
absent (name is data property) (15.4.5.1 step 4.c)
|
absent (name is data property) (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
arrObj[0] = 101; // default value of attributes: writable: true, configurable: true, enumerable: true
|
arrObj[0] = 101; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {});
|
Object.defineProperty(arrObj, "0", {});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 101, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 101, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
named property, 'name' makes no change if every field in 'desc' is
|
named property, 'name' makes no change if every field in 'desc' is
|
||||||
absent(name is accessor property) (15.4.5.1 step 4.c)
|
absent(name is accessor property) (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
function getFunc() {
|
function getFunc() {
|
||||||
|
@ -33,6 +30,4 @@ function testcase() {
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {});
|
Object.defineProperty(arrObj, "0", {});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, 'name' makes no change if the value of every field
|
named property, 'name' makes no change if the value of every field
|
||||||
in 'desc' is the same value as the corresponding field in
|
in 'desc' is the same value as the corresponding field in
|
||||||
'name'(desc is data property) (15.4.5.1 step 4.c)
|
'name'(desc is data property) (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
arrObj[0] = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
arrObj[0] = 100; // default value of attributes: writable: true, configurable: true, enumerable: true
|
||||||
|
@ -28,6 +25,5 @@ function testcase() {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, 'name' makes no change if the value of every field
|
named property, 'name' makes no change if the value of every field
|
||||||
in 'desc' is the same value as the corresponding field in
|
in 'desc' is the same value as the corresponding field in
|
||||||
'name'(desc is accessor property) (15.4.5.1 step 4.c)
|
'name'(desc is accessor property) (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var getFunc = function () {
|
var getFunc = function () {
|
||||||
return "100";
|
return "100";
|
||||||
|
@ -41,6 +38,4 @@ function testcase() {
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", desc);
|
Object.defineProperty(arrObj, "0", desc);
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
false, test TypeError is thrown when the type of the [[Value]]
|
false, test TypeError is thrown when the type of the [[Value]]
|
||||||
field of 'desc' is different from the type of the [[Value]]
|
field of 'desc' is different from the type of the [[Value]]
|
||||||
attribute value of 'name' (15.4.5.1 step 4.c)
|
attribute value of 'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
|
@ -28,9 +25,11 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: "abc" });
|
Object.defineProperty(arrObj, "0", { value: "abc" });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,17 +10,13 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
property, both the [[Value]] field of 'desc' and the [[Value]]
|
property, both the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are undefined (15.4.5.1 step 4.c)
|
attribute value of 'name' are undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: undefined });
|
Object.defineProperty(arrObj, "0", { value: undefined });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: undefined });
|
Object.defineProperty(arrObj, "0", { value: undefined });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,17 +10,13 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
property, both the [[Value]] field of 'desc' and the [[Value]]
|
property, both the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are null (15.4.5.1 step 4.c)
|
attribute value of 'name' are null (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: null });
|
Object.defineProperty(arrObj, "0", { value: null });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: null });
|
Object.defineProperty(arrObj, "0", { value: null });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", null, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", null, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,21 +11,20 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' is +0, and the [[Value]] attribute value of 'name' is -0
|
'desc' is +0, and the [[Value]] attribute value of 'name' is -0
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: -0 });
|
Object.defineProperty(arrObj, "0", { value: -0 });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: +0 });
|
Object.defineProperty(arrObj, "0", { value: +0 });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", -0, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", -0, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,21 +11,20 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' is -0, and the [[Value]] attribute value of 'name' is +0
|
'desc' is -0, and the [[Value]] attribute value of 'name' is +0
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: +0 });
|
Object.defineProperty(arrObj, "0", { value: +0 });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: -0 });
|
Object.defineProperty(arrObj, "0", { value: -0 });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", +0, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", +0, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,12 @@ description: >
|
||||||
property, the [[Value]] field of 'desc' and the [[Value]]
|
property, the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are two numbers with same vaule
|
attribute value of 'name' are two numbers with same vaule
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: 101 });
|
Object.defineProperty(arrObj, "0", { value: 101 });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: 101 });
|
Object.defineProperty(arrObj, "0", { value: 101 });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' and the [[Value]] attribute value of 'name' are two numbers
|
'desc' and the [[Value]] attribute value of 'name' are two numbers
|
||||||
with different values (15.4.5.1 step 4.c)
|
with different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
|
@ -27,9 +24,11 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: 123 });
|
Object.defineProperty(arrObj, "0", { value: 123 });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Value]] field of 'desc' and the [[Value]]
|
property, the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are two strings which have same length
|
attribute value of 'name' are two strings which have same length
|
||||||
and same characters in corresponding positions (15.4.5.1 step 4.c)
|
and same characters in corresponding positions (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: "abcd" });
|
Object.defineProperty(arrObj, "0", { value: "abcd" });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: "abcd" });
|
Object.defineProperty(arrObj, "0", { value: "abcd" });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' and the [[Value]] attribute value of 'name' are two strings
|
'desc' and the [[Value]] attribute value of 'name' are two strings
|
||||||
with different values (15.4.5.1 step 4.c)
|
with different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
|
@ -27,9 +24,11 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: "fghj" });
|
Object.defineProperty(arrObj, "0", { value: "fghj" });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Value]] field of 'desc' and the [[Value]]
|
property, the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are two booleans with same value
|
attribute value of 'name' are two booleans with same value
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: true });
|
Object.defineProperty(arrObj, "0", { value: true });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: true });
|
Object.defineProperty(arrObj, "0", { value: true });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' and the [[Value]] attribute value of 'name' are two
|
'desc' and the [[Value]] attribute value of 'name' are two
|
||||||
booleans with different values (15.4.5.1 step 4.c)
|
booleans with different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, 0, {
|
Object.defineProperty(arrObj, 0, {
|
||||||
|
@ -27,9 +24,11 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: false });
|
Object.defineProperty(arrObj, "0", { value: false });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, the [[Value]] field of 'desc' and the [[Value]]
|
property, the [[Value]] field of 'desc' and the [[Value]]
|
||||||
attribute value of 'name' are two objects which refer to the same
|
attribute value of 'name' are two objects which refer to the same
|
||||||
object (15.4.5.1 step 4.c)
|
object (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
var obj1 = { length: 10 };
|
var obj1 = { length: 10 };
|
||||||
|
@ -24,6 +21,5 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", { value: obj1 });
|
Object.defineProperty(arrObj, "0", { value: obj1 });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { value: obj1 });
|
Object.defineProperty(arrObj, "0", { value: obj1 });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, test TypeError is thrown when the [[Value]] field of
|
property, test TypeError is thrown when the [[Value]] field of
|
||||||
'desc' and the [[Value]] attribute value of 'name' are two objects
|
'desc' and the [[Value]] attribute value of 'name' are two objects
|
||||||
which refer to two different objects (15.4.5.1 step 4.c)
|
which refer to two different objects (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
var obj1 = { length: 10 };
|
var obj1 = { length: 10 };
|
||||||
|
@ -30,9 +27,11 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "0", { value: obj2 });
|
Object.defineProperty(arrObj, "0", { value: obj2 });
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Writable]] field of 'desc' and the [[Writable]]
|
property, the [[Writable]] field of 'desc' and the [[Writable]]
|
||||||
attribute value of 'name' are two booleans with same value
|
attribute value of 'name' are two booleans with same value
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { writable: false });
|
Object.defineProperty(arrObj, "0", { writable: false });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { writable: false });
|
Object.defineProperty(arrObj, "0", { writable: false });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,12 @@ description: >
|
||||||
property, the [[Writable]] field of 'desc' and the [[Writable]]
|
property, the [[Writable]] field of 'desc' and the [[Writable]]
|
||||||
attribute value of 'name' are two booleans with different values
|
attribute value of 'name' are two booleans with different values
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { writable: false, configurable: true });
|
Object.defineProperty(arrObj, "0", { writable: false, configurable: true });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { writable: true });
|
Object.defineProperty(arrObj, "0", { writable: true });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, false, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, the [[Get]] field of 'desc' and the [[Get]] attribute
|
property, the [[Get]] field of 'desc' and the [[Get]] attribute
|
||||||
value of 'name' are two objects which refer to the same object
|
value of 'name' are two objects which refer to the same object
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
arrObj.helpVerifySet = 10;
|
arrObj.helpVerifySet = 10;
|
||||||
|
|
||||||
|
@ -35,6 +32,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
get: getFunc
|
get: getFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, the [[Get]] field of 'desc' and the [[Get]] attribute
|
property, the [[Get]] field of 'desc' and the [[Get]] attribute
|
||||||
value of 'name' are two objects which refer to the different
|
value of 'name' are two objects which refer to the different
|
||||||
objects (15.4.5.1 step 4.c)
|
objects (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
arrObj.helpVerifySet = 10;
|
arrObj.helpVerifySet = 10;
|
||||||
|
|
||||||
|
@ -40,6 +37,4 @@ function testcase() {
|
||||||
get: getFunc2
|
get: getFunc2
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc2, setFunc, "helpVerifySet", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc2, setFunc, "helpVerifySet", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, the [[Set]] field of 'desc' and the [[Set]] attribute
|
property, the [[Set]] field of 'desc' and the [[Set]] attribute
|
||||||
value of 'name' are two objects which refer to the same object
|
value of 'name' are two objects which refer to the same object
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
function setFunc(value) {
|
function setFunc(value) {
|
||||||
|
@ -26,6 +23,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", { set: setFunc });
|
Object.defineProperty(arrObj, "0", { set: setFunc });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { set: setFunc });
|
Object.defineProperty(arrObj, "0", { set: setFunc });
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property, the [[Set]] field of 'desc' and the [[Set]] attribute
|
property, the [[Set]] field of 'desc' and the [[Set]] attribute
|
||||||
value of 'name' are two objects which refer to the different
|
value of 'name' are two objects which refer to the different
|
||||||
objects (15.4.5.1 step 4.c)
|
objects (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
function setFunc1() { }
|
function setFunc1() { }
|
||||||
|
@ -31,6 +28,4 @@ function testcase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { set: setFunc2 });
|
Object.defineProperty(arrObj, "0", { set: setFunc2 });
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc2, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc2, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Enumerable]] field of 'desc' and the
|
property, the [[Enumerable]] field of 'desc' and the
|
||||||
[[Enumerable]] attribute value of 'name' are two booleans with
|
[[Enumerable]] attribute value of 'name' are two booleans with
|
||||||
same value (15.4.5.1 step 4.c)
|
same value (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { enumerable: false });
|
Object.defineProperty(arrObj, "0", { enumerable: false });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { enumerable: false });
|
Object.defineProperty(arrObj, "0", { enumerable: false });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Enumerable]] field of 'desc' and the
|
property, the [[Enumerable]] field of 'desc' and the
|
||||||
[[Enumerable]] attribute value of 'name' are two booleans with
|
[[Enumerable]] attribute value of 'name' are two booleans with
|
||||||
different values (15.4.5.1 step 4.c)
|
different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { enumerable: false, configurable: true });
|
Object.defineProperty(arrObj, "0", { enumerable: false, configurable: true });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { enumerable: true });
|
Object.defineProperty(arrObj, "0", { enumerable: true });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,12 @@ description: >
|
||||||
property, the [[Configurable]] field of 'desc' and the
|
property, the [[Configurable]] field of 'desc' and the
|
||||||
[[Configurable]] attribute value of 'name' are two booleans with
|
[[Configurable]] attribute value of 'name' are two booleans with
|
||||||
same value (15.4.5.1 step 4.c)
|
same value (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { configurable: false });
|
Object.defineProperty(arrObj, "0", { configurable: false });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { configurable: false });
|
Object.defineProperty(arrObj, "0", { configurable: false });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
property, the [[Configurable]] field of 'desc' and the
|
property, the [[Configurable]] field of 'desc' and the
|
||||||
[[Configurable]] attribute value of 'name' are two booleans with
|
[[Configurable]] attribute value of 'name' are two booleans with
|
||||||
different values (15.4.5.1 step 4.c)
|
different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { configurable: true });
|
Object.defineProperty(arrObj, "0", { configurable: true });
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", { configurable: false });
|
Object.defineProperty(arrObj, "0", { configurable: false });
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, TypeError is thrown if the [[Configurable]]
|
named property, TypeError is thrown if the [[Configurable]]
|
||||||
attribute value of 'name' is false and the [[Configurable]] field
|
attribute value of 'name' is false and the [[Configurable]] field
|
||||||
of 'desc' is true (15.4.5.1 step 4.c)
|
of 'desc' is true (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -32,10 +29,12 @@ function testcase() {
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, true, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 3, true, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
attribute value of 'name' is false, and [[Enumerable]] of 'desc'
|
attribute value of 'name' is false, and [[Enumerable]] of 'desc'
|
||||||
is present and its value is different from the [[Enumerable]]
|
is present and its value is different from the [[Enumerable]]
|
||||||
attribute value of 'name' (15.4.5.1 step 4.c)
|
attribute value of 'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -34,10 +31,12 @@ function testcase() {
|
||||||
writable: true,
|
writable: true,
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, true, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 3, true, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, TypeError is thrown if 'name' is accessor
|
named property, TypeError is thrown if 'name' is accessor
|
||||||
property, and 'desc' is data descriptor, and the [[Configurable]]
|
property, and 'desc' is data descriptor, and the [[Configurable]]
|
||||||
attribute value of 'name' is false (15.4.5.1 step 4.c)
|
attribute value of 'name' is false (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -33,10 +30,12 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: 13
|
value: 13
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, TypeError is thrown if 'name' is data property,
|
named property, TypeError is thrown if 'name' is data property,
|
||||||
and'desc' is accessor descriptor, and the [[Configurable]]
|
and'desc' is accessor descriptor, and the [[Configurable]]
|
||||||
attribute value of 'name' is false (15.4.5.1 step 4.c)
|
attribute value of 'name' is false (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -29,10 +26,12 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
set: function () { }
|
set: function () { }
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, 'name' is data property and 'desc' is data
|
named property, 'name' is data property and 'desc' is data
|
||||||
descriptor, and the [[Configurable]] attribute value of 'name' is
|
descriptor, and the [[Configurable]] attribute value of 'name' is
|
||||||
true, test 'name' is updated successfully (15.4.5.1 step 4.c)
|
true, test 'name' is updated successfully (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [3];
|
var arrObj = [3];
|
||||||
|
|
||||||
|
@ -26,6 +23,5 @@ function testcase() {
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
descriptor, and the [[Configurable]] attribute value of 'name' is
|
descriptor, and the [[Configurable]] attribute value of 'name' is
|
||||||
true, test 'name' is converted from data property to accessor
|
true, test 'name' is converted from data property to accessor
|
||||||
property (15.4.5.1 step 4.c)
|
property (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [3];
|
var arrObj = [3];
|
||||||
|
|
||||||
|
@ -28,6 +25,4 @@ function testcase() {
|
||||||
set: setFunc
|
set: setFunc
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,10 @@ description: >
|
||||||
named property, 'name' is accessor property and assignment to
|
named property, 'name' is accessor property and assignment to
|
||||||
the accessor property, fails to convert accessor property from
|
the accessor property, fails to convert accessor property from
|
||||||
accessor property to data property (15.4.5.1 step 4.c)
|
accessor property to data property (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
flags: [noStrict]
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -30,6 +28,4 @@ function testcase() {
|
||||||
|
|
||||||
arrObj[1] = 4;
|
arrObj[1] = 4;
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 15.2.3.6-4-243-2
|
||||||
|
description: >
|
||||||
|
Object.defineProperty - 'O' is an Array, 'name' is an array index
|
||||||
|
named property, 'name' is accessor property and assignment to
|
||||||
|
the accessor property, fails to convert accessor property from
|
||||||
|
accessor property to data property (15.4.5.1 step 4.c)
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
flags: [onlyStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var arrObj = [];
|
||||||
|
|
||||||
|
function getFunc() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
get: getFunc,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
arrObj[1] = 4;
|
||||||
|
} catch (e) {
|
||||||
|
accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, true);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -12,12 +12,9 @@ description: >
|
||||||
descriptor, and the [[Configurable]] attribute value of 'name' is
|
descriptor, and the [[Configurable]] attribute value of 'name' is
|
||||||
true, test 'name' is converted from accessor property to data
|
true, test 'name' is converted from accessor property to data
|
||||||
property (15.4.5.1 step 4.c)
|
property (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -33,6 +30,5 @@ function testcase() {
|
||||||
value: 12
|
value: 12
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, true);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -13,12 +13,9 @@ description: >
|
||||||
false, test TypeError is thrown if the [[Writable]] attribute
|
false, test TypeError is thrown if the [[Writable]] attribute
|
||||||
value of 'name' is false and the [[Writable]] field of 'desc' is
|
value of 'name' is false and the [[Writable]] field of 'desc' is
|
||||||
true (15.4.5.1 step 4.c)
|
true (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -32,9 +29,12 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
writable: true
|
writable: true
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", undefined, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", undefined, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the type of the [[Value]] field of
|
value of 'name' is false, and the type of the [[Value]] field of
|
||||||
'desc' is different from the type of the [[Value]] attribute value
|
'desc' is different from the type of the [[Value]] attribute value
|
||||||
of 'name' (15.4.5.1 step 4.c)
|
of 'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -30,13 +27,14 @@ function testcase() {
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: "abc"
|
value: "abc"
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' is +0,
|
value of 'name' is false, and the [[Value]] field of 'desc' is +0,
|
||||||
and the [[Value]] attribute value of 'name' is -0 (15.4.5.1 step
|
and the [[Value]] attribute value of 'name' is -0 (15.4.5.1 step
|
||||||
4.c)
|
4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
@ -31,10 +28,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: +0
|
value: +0
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", -0, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", -0, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' is -0,
|
value of 'name' is false, and the [[Value]] field of 'desc' is -0,
|
||||||
and the [[Value]] attribute value of 'name' is +0 (15.4.5.1 step
|
and the [[Value]] attribute value of 'name' is +0 (15.4.5.1 step
|
||||||
4.c)
|
4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
@ -31,9 +28,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: -0
|
value: -0
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", +0, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", +0, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' and
|
value of 'name' is false, and the [[Value]] field of 'desc' and
|
||||||
the [[Value]] attribute value of 'name' are two numbers with
|
the [[Value]] attribute value of 'name' are two numbers with
|
||||||
different vaules (15.4.5.1 step 4.c)
|
different vaules (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
@ -30,9 +27,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: 15
|
value: 15
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' and
|
value of 'name' is false, and the [[Value]] field of 'desc' and
|
||||||
the [[Value]] attribute value of 'name' are two strings with
|
the [[Value]] attribute value of 'name' are two strings with
|
||||||
different values (15.4.5.1 step 4.c)
|
different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
@ -30,10 +27,12 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: "fgh"
|
value: "fgh"
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", "abc", false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", "abc", false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' and
|
value of 'name' is false, and the [[Value]] field of 'desc' and
|
||||||
the [[Value]] attribute value of 'name' are two booleans with
|
the [[Value]] attribute value of 'name' are two booleans with
|
||||||
different values (15.4.5.1 step 4.c)
|
different values (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
|
@ -30,10 +27,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", false, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", false, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
value of 'name' is false, and the [[Value]] field of 'desc' and
|
value of 'name' is false, and the [[Value]] field of 'desc' and
|
||||||
the [[Value]] attribute value of 'name' are two objects which
|
the [[Value]] attribute value of 'name' are two objects which
|
||||||
refer to the different objects (15.4.5.1 step 4.c)
|
refer to the different objects (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
var obj = { length: 10 };
|
var obj = { length: 10 };
|
||||||
|
|
||||||
|
@ -29,10 +26,12 @@ function testcase() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(arrObj, "1", { value: {} });
|
Object.defineProperty(arrObj, "1", { value: {} });
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", obj, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "1", obj, false, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -14,12 +14,9 @@ description: >
|
||||||
present, and the [[Set]] field of 'desc' and the [[Set]] attribute
|
present, and the [[Set]] field of 'desc' and the [[Set]] attribute
|
||||||
value of 'name' are two objects which refer to the different
|
value of 'name' are two objects which refer to the different
|
||||||
objects (15.4.5.1 step 4.c)
|
objects (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
function setFunc(value) {
|
function setFunc(value) {
|
||||||
|
@ -34,9 +31,11 @@ function testcase() {
|
||||||
set: function () { }
|
set: function () { }
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -13,12 +13,9 @@ description: >
|
||||||
false, test TypeError is thrown if the [[Set]] field of 'desc' is
|
false, test TypeError is thrown if the [[Set]] field of 'desc' is
|
||||||
present, and the [[Set]] field of 'desc' is an object and the
|
present, and the [[Set]] field of 'desc' is an object and the
|
||||||
[[Set]] attribute value of 'name' is undefined (15.4.5.1 step 4.c)
|
[[Set]] attribute value of 'name' is undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
function getFunc() {
|
function getFunc() {
|
||||||
return 12;
|
return 12;
|
||||||
|
@ -33,9 +30,11 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
set: function () { }
|
set: function () { }
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return e instanceof TypeError && accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, false);
|
||||||
|
|
||||||
|
if (!(e instanceof TypeError)) {
|
||||||
|
$ERROR("Expected TypeError, got " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -13,12 +13,9 @@ description: >
|
||||||
false, test TypeError is not thrown if the [[Get]] field of 'desc'
|
false, test TypeError is not thrown if the [[Get]] field of 'desc'
|
||||||
is present, and the [[Get]] field of 'desc' and the [[Get]]
|
is present, and the [[Get]] field of 'desc' and the [[Get]]
|
||||||
attribute value of 'name' are undefined (15.4.5.1 step 4.c)
|
attribute value of 'name' are undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
function setFunc(value) {
|
function setFunc(value) {
|
||||||
arrObj.setVerifyHelpProp = value;
|
arrObj.setVerifyHelpProp = value;
|
||||||
|
@ -30,14 +27,8 @@ function testcase() {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
|
||||||
Object.defineProperty(arrObj, "1", {
|
Object.defineProperty(arrObj, "1", {
|
||||||
get: undefined
|
get: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,14 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test updating the [[Value]] attribute value of 'name'
|
descriptor, test updating the [[Value]] attribute value of 'name'
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
value: 200
|
value: 200
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 200, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 200, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,14 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test setting the [[Value]] attribute value of 'name'
|
descriptor, test setting the [[Value]] attribute value of 'name'
|
||||||
as undefined (15.4.5.1 step 4.c)
|
as undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
value: undefined
|
value: undefined
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test setting the [[Value]] attribute value of 'name'
|
descriptor, test setting the [[Value]] attribute value of 'name'
|
||||||
from undefined to number (15.4.5.1 step 4.c)
|
from undefined to number (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [undefined];
|
var arrObj = [undefined];
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
value: 100
|
value: 100
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,17 +11,13 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test updating the [[Writable]] attribute value of
|
descriptor, test updating the [[Writable]] attribute value of
|
||||||
'name' (15.4.5.1 step 4.c)
|
'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
writable: false
|
writable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, false, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, false, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,14 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test updating the [[Enumerable]] attribute value of
|
descriptor, test updating the [[Enumerable]] attribute value of
|
||||||
'name' (15.4.5.1 step 4.c)
|
'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, false, true);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,18 +11,14 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test updating the [[Configurable]] attribute value of
|
descriptor, test updating the [[Configurable]] attribute value of
|
||||||
'name' (15.4.5.1 step 4.c)
|
'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
|
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is data property and 'desc' is data
|
named property, name is data property and 'desc' is data
|
||||||
descriptor, test updating multiple attribute values of 'name'
|
descriptor, test updating multiple attribute values of 'name'
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [100];
|
var arrObj = [100];
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
|
@ -24,6 +21,5 @@ function testcase() {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, false, false, false);
|
dataPropertyAttributesAreCorrect(arrObj, "0", 100, false, false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Get]] attribute value of 'name'
|
descriptor, test updating the [[Get]] attribute value of 'name'
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -32,6 +29,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
get: getFunc
|
get: getFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test setting the [[Get]] attribute value of 'name' as
|
descriptor, test setting the [[Get]] attribute value of 'name' as
|
||||||
undefined (15.4.5.1 step 4.c)
|
undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
function getFunc() {
|
function getFunc() {
|
||||||
|
@ -31,6 +28,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
get: undefined
|
get: undefined
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Get]] attribute value of 'name'
|
descriptor, test updating the [[Get]] attribute value of 'name'
|
||||||
from undefined to function object (15.4.5.1 step 4.c)
|
from undefined to function object (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -31,6 +28,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
get: getFunc
|
get: getFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Set]] attribute value of 'name'
|
descriptor, test updating the [[Set]] attribute value of 'name'
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -31,6 +28,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
set: setFunc
|
set: setFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test setting the [[Set]] attribute value of 'name' as
|
descriptor, test setting the [[Set]] attribute value of 'name' as
|
||||||
undefined (15.4.5.1 step 4.c)
|
undefined (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -28,6 +25,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
set: undefined
|
set: undefined
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, undefined, undefined, false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, undefined, undefined, false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Set]] attribute value of 'name'
|
descriptor, test updating the [[Set]] attribute value of 'name'
|
||||||
from undefined to function object (15.4.5.1 step 4.c)
|
from undefined to function object (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -32,6 +29,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
set: setFunc
|
set: setFunc
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Enumerable]] attribute value of
|
descriptor, test updating the [[Enumerable]] attribute value of
|
||||||
'name' (15.4.5.1 step 4.c)
|
'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -33,6 +30,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating the [[Configurable]] attribute value of
|
descriptor, test updating the [[Configurable]] attribute value of
|
||||||
'name' (15.4.5.1 step 4.c)
|
'name' (15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
function setFunc(value) {
|
function setFunc(value) {
|
||||||
|
@ -31,6 +28,4 @@ function testcase() {
|
||||||
Object.defineProperty(arrObj, "0", {
|
Object.defineProperty(arrObj, "0", {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
named property, name is accessor property and 'desc' is accessor
|
named property, name is accessor property and 'desc' is accessor
|
||||||
descriptor, test updating multiple attribute values of 'name'
|
descriptor, test updating multiple attribute values of 'name'
|
||||||
(15.4.5.1 step 4.c)
|
(15.4.5.1 step 4.c)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -40,6 +37,4 @@ function testcase() {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -11,12 +11,9 @@ description: >
|
||||||
property that won't exist on 'O', and 'desc' is data descriptor,
|
property that won't exist on 'O', and 'desc' is data descriptor,
|
||||||
test 'name' is defined in 'O' with all correct attribute values
|
test 'name' is defined in 'O' with all correct attribute values
|
||||||
(15.4.5.1 step 5)
|
(15.4.5.1 step 5)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- dataPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -27,6 +24,5 @@ function testcase() {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return dataPropertyAttributesAreCorrect(arrObj, "property", 12, true, true, true);
|
dataPropertyAttributesAreCorrect(arrObj, "property", 12, true, true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'name' is generic property that won't
|
Object.defineProperty - 'name' is generic property that won't
|
||||||
exist on 'O', and 'desc' is accessor descriptor, test 'name' is
|
exist on 'O', and 'desc' is accessor descriptor, test 'name' is
|
||||||
defined in 'O' with all correct attribute values (15.4.5.1 step 5)
|
defined in 'O' with all correct attribute values (15.4.5.1 step 5)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -33,6 +30,4 @@ function testcase() {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", true, true);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ description: >
|
||||||
Object.defineProperty - 'O' is an Array, 'name' is generic own
|
Object.defineProperty - 'O' is an Array, 'name' is generic own
|
||||||
accessor property of 'O', and 'desc' is accessor descriptor, test
|
accessor property of 'O', and 'desc' is accessor descriptor, test
|
||||||
updating multiple attribute values of 'name' (15.4.5.1 step 5)
|
updating multiple attribute values of 'name' (15.4.5.1 step 5)
|
||||||
includes:
|
includes: [propertyHelper.js]
|
||||||
- runTestCase.js
|
|
||||||
- accessorPropertyAttributesAreCorrect.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var arrObj = [];
|
var arrObj = [];
|
||||||
|
|
||||||
|
@ -39,6 +36,4 @@ function testcase() {
|
||||||
configurable: false
|
configurable: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", false, false);
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue