diff options
Diffstat (limited to 'test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js')
-rw-r--r-- | test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js b/test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js index 10fc29682..d921745ca 100644 --- a/test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js +++ b/test/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js @@ -9,25 +9,34 @@ es5id: 15.2.3.9-2-b-i-1 description: > Object.freeze - The [[Wrtiable]] attribute of own data property of 'O' is set to false while other attributes are unchanged -includes: - - runTestCase.js - - dataPropertyAttributesAreCorrect.js +includes: [propertyHelper.js] ---*/ -function testcase() { - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "foo", { - value: 10, - writable: true, - enumerable: true, - configurable: false - }); +Object.defineProperty(obj, "foo", { + value: 10, + writable: true, + enumerable: true, + configurable: false +}); - Object.freeze(obj); - var desc = Object.getOwnPropertyDescriptor(obj, "foo"); +Object.freeze(obj); +var desc = Object.getOwnPropertyDescriptor(obj, "foo"); + +verifyEqualTo(obj, "foo", 10); + +verifyNotWritable(obj, "foo"); + +verifyEnumerable(obj, "foo"); + +verifyNotConfigurable(obj, "foo"); + +if (desc.writable !== false) { + $ERROR('Expected desc.writable === false, actually ' + desc.writable); +} + +if (desc.configurable !== false) { + $ERROR('Expected desc.configurable === false, actually ' + desc.configurable); +} - return dataPropertyAttributesAreCorrect(obj, "foo", 10, false, true, false) && - desc.writable === false && desc.configurable === false; - } -runTestCase(testcase); |