keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | es5id: 15.2.3.6-4-347 |
| 6 | description: > |
| 7 | ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is |
| 8 | false, [[Configurable]] is false) is writable |
| 9 | ---*/ |
| 10 | |
| 11 | var obj = {}; |
| 12 | |
| 13 | Object.defineProperty(obj, "prop", { |
| 14 | value: 2010, |
| 15 | writable: true, |
| 16 | enumerable: false, |
| 17 | configurable: false |
| 18 | }); |
| 19 | var propertyDefineCorrect = (obj.prop === 2010); |
| 20 | obj.prop = 1001; |
| 21 | |
| 22 | assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); |
| 23 | assert.sameValue(obj.prop, 1001, 'obj.prop'); |