Mike Pennisi eb644bb2da Reduce reliance on fnGlobalObject.js
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00

52 lines
1.3 KiB
JavaScript

// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.2.3.6-4-531-4
description: >
Object.defineProperty will update [[Get]] and [[Set]] attributes
of named accessor property 'P' successfully when [[Configurable]]
attribute is true, 'O' is the global object (8.12.9 step 11)
includes: [propertyHelper.js]
---*/
var obj = this;
try {
obj.verifySetFunction = "data";
Object.defineProperty(obj, "property", {
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, "property", {
get: getFunc,
set: setFunc
});
verifyEqualTo(obj, "property", getFunc());
verifyWritable(obj, "property", "verifySetFunction1");
verifyNotEnumerable(obj, "property");
verifyConfigurable(obj, "property");
} finally {
delete obj.property;
delete obj.verifySetFunction;
delete obj.verifySetFunction1;
}