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:
Sam Mikes 2014-08-03 15:45:07 +01:00 committed by smikes
parent 61113dbfb3
commit b8ff1ba1bd
502 changed files with 8779 additions and 10157 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -9,37 +9,32 @@ 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 = {};
function getFunc() {
return 10;
}
function setFunc(value) {
newObj.setVerifyHelpProp = value;
}
var newObj = {}; newObj = Object.create({}, {
function getFunc() { foo1: {
return 10; value: 200,
} enumerable: true,
function setFunc(value) { writable: true,
newObj.setVerifyHelpProp = value; configurable: true
} },
foo2: {
newObj = Object.create({}, { get: getFunc,
foo1: { set: setFunc,
value: 200, enumerable: true,
enumerable: true, configurable: true
writable: true,
configurable: true
},
foo2: {
get: getFunc,
set: setFunc,
enumerable: true,
configurable: true
}
});
return dataPropertyAttributesAreCorrect(newObj, "foo1", 200, true, true, true) &&
accessorPropertyAttributesAreCorrect(newObj, "foo2", getFunc, setFunc, "setVerifyHelpProp", true, true);
} }
runTestCase(testcase); });
dataPropertyAttributesAreCorrect(newObj, "foo1", 200, true, true, true);
accessorPropertyAttributesAreCorrect(newObj, "foo2", getFunc, setFunc, "setVerifyHelpProp", true, true);

View File

@ -9,20 +9,15 @@ 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 Object.defineProperty(obj, "foo", {
value: 200
});
dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, true);
Object.defineProperty(obj, "foo", {
value: 200
});
return dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, true);
}
runTestCase(testcase);

View File

@ -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 });
dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, true, true);
Object.defineProperty(obj, "foo", { value: undefined });
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, true, true);
}
runTestCase(testcase);

View File

@ -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 });
dataPropertyAttributesAreCorrect(obj, "foo", 100, true, true, true);
Object.defineProperty(obj, "foo", { value: 100 });
return dataPropertyAttributesAreCorrect(obj, "foo", 100, true, true, true);
}
runTestCase(testcase);

View File

@ -10,22 +10,17 @@ 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", {
writable: false, configurable: true
});
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
writable: false, configurable: true writable: true
}); });
dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, false, true);
Object.defineProperty(obj, "foo", {
writable: true
});
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, true, false, true);
}
runTestCase(testcase);

View File

@ -10,23 +10,18 @@ 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", {
enumerable: false,
configurable: true
});
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
enumerable: false, enumerable: true
configurable: true });
}); dataPropertyAttributesAreCorrect(obj, "foo", undefined, false, true, true);
Object.defineProperty(obj, "foo", {
enumerable: true
});
return dataPropertyAttributesAreCorrect(obj, "foo", undefined, false, true, true);
}
runTestCase(testcase);

View File

@ -10,26 +10,21 @@ 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", {
value: 200,
enumerable: true,
writable: true,
configurable: true
});
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
value: 200, configurable: false
enumerable: true, });
writable: true,
configurable: true
});
Object.defineProperty(obj, "foo", { dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, false);
configurable: false
});
return dataPropertyAttributesAreCorrect(obj, "foo", 200, true, true, false);
}
runTestCase(testcase);

View File

@ -10,27 +10,22 @@ 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", {
value: 100,
writable: true,
enumerable: true,
configurable: true
});
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
value: 100, value: 200,
writable: true, writable: false,
enumerable: true, enumerable: false
configurable: true });
}); dataPropertyAttributesAreCorrect(obj, "foo", 200, false, false, true);
Object.defineProperty(obj, "foo", {
value: 200,
writable: false,
enumerable: false
});
return dataPropertyAttributesAreCorrect(obj, "foo", 200, false, false, true);
}
runTestCase(testcase);

View File

@ -10,36 +10,31 @@ 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 = {};
function getFunc() { function getFunc() {
return 10; return 10;
} }
function setFunc(value) { function setFunc(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
configurable: true configurable: true
}); });
function getFunc2() { function getFunc2() {
return 20; return 20;
} }
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);

View File

@ -10,34 +10,29 @@ 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 = {};
function getFunc() { function getFunc() {
return 10; return 10;
} }
function setFunc(value) { function setFunc(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
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);

View File

@ -10,32 +10,27 @@ 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) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
set: setFunc, set: setFunc,
get: undefined, get: undefined,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
function getFunc() { function getFunc() {
return 10; return 10;
} }
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);

View File

@ -10,32 +10,27 @@ 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 = {};
function setFunc1() { function setFunc1() {
return 10; return 10;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
set: setFunc1, set: setFunc1,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
function setFunc2(value) { function setFunc2(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
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);

View File

@ -10,33 +10,28 @@ 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 = {};
function getFunc() { function getFunc() {
return 10; return 10;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
set: undefined, set: undefined,
get: getFunc, get: getFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
function setFunc(value) { function setFunc(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
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);

View File

@ -10,30 +10,25 @@ 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 = {};
function getFunc() { function getFunc() {
return 10; return 10;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc, get: getFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc, get: getFunc,
enumerable: false enumerable: false
}); });
return accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, undefined, undefined, false, true); accessorPropertyAttributesAreCorrect(obj, "foo", getFunc, undefined, undefined, false, true);
}
runTestCase(testcase);

View File

@ -10,33 +10,28 @@ 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 = {};
function setFunc(value) { function setFunc(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
function getFunc() { function getFunc() {
return 10; return 10;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
configurable: true configurable: true
}); });
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
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);

View File

@ -10,38 +10,33 @@ 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 = {};
function getFunc1() { function getFunc1() {
return 10; return 10;
} }
function setFunc1() {} function setFunc1() {}
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc1, get: getFunc1,
set: setFunc1, set: setFunc1,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
function getFunc2() { function getFunc2() {
return 20; return 20;
} }
function setFunc2(value) { function setFunc2(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
get: getFunc2, get: getFunc2,
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);

View File

@ -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", {
writable: false
});
dataPropertyAttributesAreCorrect(arrObj, "length", 0, false, false, false);
Object.defineProperty(arrObj, "length", {
writable: false
});
return dataPropertyAttributesAreCorrect(arrObj, "length", 0, false, false, false);
}
runTestCase(testcase);

View File

@ -11,26 +11,24 @@ 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, {
value: "ownDataProperty",
configurable: false
});
try { Object.defineProperty(arrObj, 0, {
Object.defineProperty(arrObj, 0, { value: "ownDataProperty",
configurable: true configurable: false
}); });
return false;
} catch (e) { try {
return e instanceof TypeError && Object.defineProperty(arrObj, 0, {
dataPropertyAttributesAreCorrect(arrObj, "0", "ownDataProperty", false, false, false); configurable: true
} });
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "0", "ownDataProperty", false, false, false);
if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase); }

View File

@ -10,25 +10,30 @@ 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, configurable: true
configurable: true });
});
var arrObj = []; var arrObj = [];
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
configurable: false configurable: false
}); });
return arrObj.hasOwnProperty("0") && Array.prototype[0] === 11 && typeof arrObj[0] === "undefined";
} finally {
delete Array.prototype[0];
}
if (!arrObj.hasOwnProperty("0")) {
$ERROR("Expected arrObj.hasOwnProperty('0') === true, actually " + arrObj.hasOwnProperty("0"));
} }
runTestCase(testcase); 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 {
delete Array.prototype[0];
}

View File

@ -11,30 +11,28 @@ 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; };
};
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
configurable: true configurable: true
}); });
return false; } catch (e) {
} catch (e) { accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, false);
return e instanceof TypeError &&
accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, false); if (!(e instanceof TypeError)) {
} $ERROR("Expected TypeError, got " + e.name);
} }
runTestCase(testcase);
}

View File

@ -10,40 +10,36 @@ 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() {
try { return arrObj.helpVerifySet;
Object.defineProperty(Array.prototype, "0", { }
get: function () { function setFunc(value) {
return 11; arrObj.helpVerifySet = value;
}, }
configurable: true
});
var arrObj = []; try {
Object.defineProperty(Array.prototype, "0", {
get: function () {
return 11;
},
configurable: true
});
function getFunc() { var arrObj = [];
return arrObj.helpVerifySet;
}
function setFunc(value) {
arrObj.helpVerifySet = value;
}
Object.defineProperty(arrObj, "0", {
get: getFunc,
set: setFunc,
configurable: false
});
arrObj[0] = 13; Object.defineProperty(arrObj, "0", {
get: getFunc,
set: setFunc,
configurable: false
});
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false); arrObj[0] = 13;
} finally {
delete Array.prototype[0]; accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "helpVerifySet", false, false);
} } finally {
} delete Array.prototype[0];
runTestCase(testcase); }

View File

@ -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
}); });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, false);
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, false);
}
runTestCase(testcase);

View File

@ -12,20 +12,16 @@ 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", {
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: false configurable: false
}); });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, false);
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, false);
}
runTestCase(testcase);

View File

@ -12,19 +12,15 @@ 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", {
value: 1001,
enumerable: true,
configurable: false
});
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, true, false);
Object.defineProperty(arrObj, "0", {
value: 1001,
enumerable: true,
configurable: false
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, true, false);
}
runTestCase(testcase);

View File

@ -12,19 +12,15 @@ 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", {
value: 1001,
writable: true,
configurable: true
});
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, false, true);
Object.defineProperty(arrObj, "0", {
value: 1001,
writable: true,
configurable: true
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, false, true);
}
runTestCase(testcase);

View File

@ -12,19 +12,15 @@ 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", {
value: 1001,
writable: true,
enumerable: true
});
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, true, false);
Object.defineProperty(arrObj, "0", {
value: 1001,
writable: true,
enumerable: true
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, true, true, false);
}
runTestCase(testcase);

View File

@ -10,21 +10,17 @@ 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", {
value: 1001, value: 1001,
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: false configurable: false
}); });
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, false);
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, false);
}
runTestCase(testcase);

View File

@ -11,23 +11,18 @@ 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; };
};
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true); accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
}
runTestCase(testcase);

View File

@ -12,24 +12,19 @@ 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) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
}; };
var getFunc = function () { }; var getFunc = function () { };
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc, set: setFunc,
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);

View File

@ -12,23 +12,18 @@ 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; };
}; var getFunc = function () { };
var getFunc = function () { };
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc, set: setFunc,
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);

View File

@ -10,36 +10,31 @@ 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; };
}; var getFunc = function () {
var getFunc = function () { return 14;
return 14; };
};
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: function () { get: function () {
return 11; return 11;
}, },
set: function () { }, set: function () { },
configurable: true, configurable: true,
enumerable: true enumerable: true
}); });
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
configurable: false, configurable: false,
enumerable: false enumerable: false
}); });
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, false); accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, setFunc, "setVerifyHelpProp", false, false);
}
runTestCase(testcase);

View File

@ -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", {});
dataPropertyAttributesAreCorrect(arrObj, "0", 101, true, true, true);
Object.defineProperty(arrObj, "0", {});
return dataPropertyAttributesAreCorrect(arrObj, "0", 101, true, true, true);
}
runTestCase(testcase);

View File

@ -10,29 +10,24 @@ 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() {
return 11; return 11;
} }
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
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);

View File

@ -11,23 +11,19 @@ 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
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
value: 100, value: 100,
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, true);
}
runTestCase(testcase);

View File

@ -11,36 +11,31 @@ 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"; };
}; var setFunc = function (value) {
var setFunc = function (value) { arrObj.setVerifyHelpProp = value;
arrObj.setVerifyHelpProp = value; };
};
var desc = { var desc = {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}; };
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
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);

View File

@ -12,25 +12,24 @@ 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, {
value: 101, value: 101,
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "0", { value: "abc" }); Object.defineProperty(arrObj, "0", { value: "abc" });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
Object.defineProperty(arrObj, "0", { value: undefined });
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
}
runTestCase(testcase);

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", null, false, false, false);
Object.defineProperty(arrObj, "0", { value: null });
return dataPropertyAttributesAreCorrect(arrObj, "0", null, false, false, false);
}
runTestCase(testcase);

View File

@ -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) { dataPropertyAttributesAreCorrect(arrObj, "0", -0, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", -0, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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) { dataPropertyAttributesAreCorrect(arrObj, "0", +0, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", +0, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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);

View File

@ -11,25 +11,24 @@ 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, {
value: 101, value: 101,
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "0", { value: 123 }); Object.defineProperty(arrObj, "0", { value: 123 });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", 101, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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" });
dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
Object.defineProperty(arrObj, "0", { value: "abcd" });
return dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
}
runTestCase(testcase);

View File

@ -11,25 +11,24 @@ 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, {
value: "abcd", value: "abcd",
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "0", { value: "fghj" }); Object.defineProperty(arrObj, "0", { value: "fghj" });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", "abcd", false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
Object.defineProperty(arrObj, "0", { value: true });
return dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
}
runTestCase(testcase);

View File

@ -11,25 +11,24 @@ 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, {
value: true, value: true,
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "0", { value: false }); Object.defineProperty(arrObj, "0", { value: false });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", true, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -11,19 +11,15 @@ 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 };
Object.defineProperty(arrObj, "0", { value: obj1 }); Object.defineProperty(arrObj, "0", { value: obj1 });
Object.defineProperty(arrObj, "0", { value: obj1 });
dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
Object.defineProperty(arrObj, "0", { value: obj1 });
return dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
}
runTestCase(testcase);

View File

@ -11,28 +11,27 @@ 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 };
Object.defineProperty(arrObj, 0, { Object.defineProperty(arrObj, 0, {
value: obj1, value: obj1,
writable: false, writable: false,
configurable: false configurable: false
}); });
var obj2 = { length: 20 }; var obj2 = { length: 20 };
try { try {
Object.defineProperty(arrObj, "0", { value: obj2 }); Object.defineProperty(arrObj, "0", { value: obj2 });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "0", obj1, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
Object.defineProperty(arrObj, "0", { writable: false });
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
}
runTestCase(testcase);

View File

@ -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);

View File

@ -11,30 +11,25 @@ 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;
function getFunc() { function getFunc() {
return arrObj.helpVerifySet; return arrObj.helpVerifySet;
} }
function setFunc(value) { function setFunc(value) {
arrObj.helpVerifySet = value; arrObj.helpVerifySet = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
set: setFunc set: setFunc
}); });
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);

View File

@ -11,35 +11,30 @@ 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;
function getFunc1() { function getFunc1() {
return 20; return 20;
} }
function getFunc2() { function getFunc2() {
return arrObj.helpVerifySet; return arrObj.helpVerifySet;
} }
function setFunc(value) { function setFunc(value) {
arrObj.helpVerifySet = value; arrObj.helpVerifySet = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc1, get: getFunc1,
set: setFunc, set: setFunc,
configurable: true configurable: true
}); });
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc2 get: getFunc2
}); });
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc2, setFunc, "helpVerifySet", false, true); accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc2, setFunc, "helpVerifySet", false, true);
}
runTestCase(testcase);

View File

@ -11,21 +11,16 @@ 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) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
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);

View File

@ -11,26 +11,21 @@ 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() { }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc1, set: setFunc1,
configurable: true configurable: true
}); });
function setFunc2(value) { function setFunc2(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
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);

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
Object.defineProperty(arrObj, "0", { enumerable: false });
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
}
runTestCase(testcase);

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, true);
Object.defineProperty(arrObj, "0", { enumerable: true });
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, true, true);
}
runTestCase(testcase);

View File

@ -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);

View File

@ -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 });
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
Object.defineProperty(arrObj, "0", { configurable: false });
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, false, false, false);
}
runTestCase(testcase);

View File

@ -11,31 +11,30 @@ 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 = [];
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 3, value: 3,
writable: true, writable: true,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 13, value: 13,
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);
}

View File

@ -12,32 +12,31 @@ 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 = [];
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 3, value: 3,
writable: true, writable: true,
configurable: false, configurable: false,
enumerable: false enumerable: false
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 13, value: 13,
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);
}

View File

@ -11,32 +11,31 @@ 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 = [];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
set: setFunc, set: setFunc,
configurable: false configurable: false
}); });
try { try {
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);
}

View File

@ -11,28 +11,27 @@ 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 = [];
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 3, value: 3,
configurable: false configurable: false
}); });
try { try {
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);
}

View File

@ -11,21 +11,17 @@ 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];
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
value: 1001, value: 1001,
writable: false, writable: false,
enumerable: false enumerable: false
}); });
dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, true);
return dataPropertyAttributesAreCorrect(arrObj, "0", 1001, false, false, true);
}
runTestCase(testcase);

View File

@ -12,22 +12,17 @@ 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];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc set: setFunc
}); });
return accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true); accessorPropertyAttributesAreCorrect(arrObj, "0", undefined, setFunc, "setVerifyHelpProp", true, true);
}
runTestCase(testcase);

View File

@ -11,25 +11,21 @@ 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 = [];
function getFunc() { function getFunc() {
return 3; return 3;
} }
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: getFunc, get: getFunc,
configurable: true configurable: true
}); });
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);

View File

@ -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);
}
}

View File

@ -12,27 +12,23 @@ 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 = [];
function getFunc() { function getFunc() {
return 3; return 3;
} }
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: getFunc, get: getFunc,
configurable: true configurable: true
}); });
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 12 value: 12
}); });
dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, true);
return dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, true);
}
runTestCase(testcase);

View File

@ -13,28 +13,28 @@ 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 = [];
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
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);
}

View File

@ -14,29 +14,27 @@ 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 = [];
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 3, value: 3,
writable: false, writable: false,
configurable: false configurable: false
}); });
try { try {
Object.defineProperty(arrObj, "1", {
value: "abc"
});
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
Object.defineProperty(arrObj, "1", { if (!(e instanceof TypeError)) {
value: "abc" $ERROR("Expected TypeError, got " + e);
});
return false;
} catch (e) {
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
}
} }
runTestCase(testcase);
}

View File

@ -14,27 +14,25 @@ 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", {
value: -0 value: -0
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: +0 value: +0
}); });
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "1", -0, false, false, false);
return false; if (!(e instanceof TypeError)) {
} catch (e) { $ERROR("Expected TypeError, got " + e);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", -0, false, false, false);
}
} }
runTestCase(testcase);
}

View File

@ -14,26 +14,25 @@ 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", {
value: +0 value: +0
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: -0 value: -0
}); });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "1", +0, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", +0, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -14,25 +14,24 @@ 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", {
value: 12 value: 12
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: 15 value: 15
}); });
return false; } catch (e) {
} catch (e) { dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, false);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 12, false, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -14,26 +14,25 @@ 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", {
value: "abc" value: "abc"
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: "fgh" value: "fgh"
}); });
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "1", "abc", false, false, false);
return false; if (!(e instanceof TypeError)) {
} catch (e) { $ERROR("Expected TypeError, got " + e);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", "abc", false, false, false);
}
} }
runTestCase(testcase);
}

View File

@ -14,26 +14,24 @@ 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", {
value: false value: false
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: true value: true
}); });
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "1", false, false, false, false);
return false; if (!(e instanceof TypeError)) {
} catch (e) { $ERROR("Expected TypeError, got " + e);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", false, false, false, false);
}
} }
runTestCase(testcase);
}

View File

@ -14,25 +14,24 @@ 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 };
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
value: obj value: obj
}); });
try { try {
Object.defineProperty(arrObj, "1", { value: {} }); Object.defineProperty(arrObj, "1", { value: {} });
} catch (e) {
dataPropertyAttributesAreCorrect(arrObj, "1", obj, false, false, false);
return false; if (!(e instanceof TypeError)) {
} catch (e) { $ERROR("Expected TypeError, got " + e);
return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", obj, false, false, false);
}
} }
runTestCase(testcase);
}

View File

@ -14,29 +14,28 @@ 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) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
set: setFunc set: setFunc
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
set: function () { } set: function () { }
}); });
return false; } catch (e) {
} catch (e) { accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
return e instanceof TypeError && accessorPropertyAttributesAreCorrect(arrObj, "1", undefined, setFunc, "setVerifyHelpProp", false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -13,29 +13,28 @@ 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; }
}
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: getFunc, get: getFunc,
set: undefined set: undefined
}); });
try { try {
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
set: function () { } set: function () { }
}); });
return false; } catch (e) {
} catch (e) { accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, false);
return e instanceof TypeError && accessorPropertyAttributesAreCorrect(arrObj, "1", getFunc, undefined, undefined, false, false);
} if (!(e instanceof TypeError)) {
$ERROR("Expected TypeError, got " + e);
} }
runTestCase(testcase);
}

View File

@ -13,31 +13,22 @@ 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; }
}
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: undefined, get: undefined,
set: setFunc, set: setFunc,
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);

View File

@ -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", {
value: 200
});
dataPropertyAttributesAreCorrect(arrObj, "0", 200, true, true, true);
Object.defineProperty(arrObj, "0", {
value: 200
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 200, true, true, true);
}
runTestCase(testcase);

View File

@ -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", {
value: undefined
});
dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, true);
Object.defineProperty(arrObj, "0", {
value: undefined
});
return dataPropertyAttributesAreCorrect(arrObj, "0", undefined, true, true, true);
}
runTestCase(testcase);

View File

@ -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);

View File

@ -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);

View File

@ -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", {
enumerable: false
});
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, false, true);
Object.defineProperty(arrObj, "0", {
enumerable: false
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, false, true);
}
runTestCase(testcase);

View File

@ -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", {
configurable: false
});
dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, false);
Object.defineProperty(arrObj, "0", {
configurable: false
});
return dataPropertyAttributesAreCorrect(arrObj, "0", 100, true, true, false);
}
runTestCase(testcase);

View File

@ -11,19 +11,15 @@ 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", {
writable: false, writable: false,
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);

View File

@ -11,27 +11,22 @@ 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 = [];
function getFunc() { function getFunc() {
return 100; return 100;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: function () { get: function () {
return 12; return 12;
}, },
configurable: true configurable: true
}); });
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);

View File

@ -11,26 +11,21 @@ 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() {
return 12; return 12;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: getFunc, get: getFunc,
configurable: true configurable: true
}); });
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);

View File

@ -11,26 +11,21 @@ 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 = [];
function getFunc() { function getFunc() {
return 12; return 12;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
get: undefined, get: undefined,
configurable: true configurable: true
}); });
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);

View File

@ -11,26 +11,21 @@ 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 = [];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: function () { }, set: function () { },
configurable: true configurable: true
}); });
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);

View File

@ -11,23 +11,18 @@ 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 = [];
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: function () { }, set: function () { },
configurable: true configurable: true
}); });
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);

View File

@ -11,27 +11,22 @@ 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 = [];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: undefined, set: undefined,
configurable: true configurable: true
}); });
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);

View File

@ -11,28 +11,23 @@ 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 = [];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
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);

View File

@ -11,26 +11,21 @@ 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) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", {
set: setFunc, set: setFunc,
configurable: true configurable: true
}); });
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);

View File

@ -11,35 +11,30 @@ 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 = [];
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
function getFunc() { function getFunc() {
return 12; return 12;
} }
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: function () { get: function () {
return 6; return 6;
}, },
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(arrObj, "1", { Object.defineProperty(arrObj, "1", {
get: getFunc, get: getFunc,
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);

View File

@ -11,22 +11,18 @@ 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 = [];
Object.defineProperty(arrObj, "property", { Object.defineProperty(arrObj, "property", {
value: 12, value: 12,
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
dataPropertyAttributesAreCorrect(arrObj, "property", 12, true, true, true);
return dataPropertyAttributesAreCorrect(arrObj, "property", 12, true, true, true);
}
runTestCase(testcase);

View File

@ -10,29 +10,24 @@ 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 = [];
function getFunc() { function getFunc() {
return 12; return 12;
} }
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "property", { Object.defineProperty(arrObj, "property", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
return accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", true, true); accessorPropertyAttributesAreCorrect(arrObj, "property", getFunc, setFunc, "setVerifyHelpProp", true, true);
}
runTestCase(testcase);

View File

@ -10,35 +10,30 @@ 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 = [];
function getFunc() { function getFunc() {
return 12; return 12;
} }
function setFunc(value) { function setFunc(value) {
arrObj.setVerifyHelpProp = value; arrObj.setVerifyHelpProp = value;
} }
Object.defineProperty(arrObj, "property", { Object.defineProperty(arrObj, "property", {
get: function () { get: function () {
return 24; return 24;
}, },
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(arrObj, "property", { Object.defineProperty(arrObj, "property", {
get: getFunc, get: getFunc,
set: setFunc, set: setFunc,
enumerable: false, enumerable: false,
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