Test case:
---------------------------------------
function testcase() {
var obj = fnGlobalObject();
try {
obj.verifySetFunction = "data";
Object.defineProperty(obj, "0", {get: function () {return obj.verifySetFunction;}, set: function (value) {obj.verifySetFunction = value;}, configurable: true});
obj.verifySetFunction1 = "data1";
var getFunc = function () {return obj.verifySetFunction1;};
var setFunc = function (value) {obj.verifySetFunction1 = value;};
Object.defineProperty(obj, "0", {get: getFunc, set: setFunc});
return accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunction1", false, true);
} finally {
delete obj[0];
delete obj.verifySetFunction;
delete obj.verifySetFunction1;
}
}
---------------------------------------
I am not familiar with accessorPropertyAttributesAreCorrect however, "verifySetFunction1" is being defined within the testcase function. I think that it value should be "data1" (obj.verifySetFunction1)
Same with 15.2.3.6-4-531-4 ?
The test case is OK based on the definition of accessorPropertyAttributesAreCorrect. The relevant snippet is:
function accessorPropertyAttributesAreCorrect(obj, name, get, set, setVerifyHelpProp, ...) {
//...
obj[name] = "toBeSetValue";
if (obj[setVerifyHelpProp] !== "toBeSetValue") {
attributesCorrect = false;
}
//...
return attributesCorrect;
}
It's not all that intuitive, but the helper function is checking that the value of obj.verifySetFunction1 changes from "data1" to "toBeSetValue"; not that it's "data1" before the setter gets invoked.