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.7-6-a-84-1 |
| 6 | description: > |
| 7 | Object.defineProperties will not throw TypeError when |
| 8 | P.configurable is false, P.writalbe is false, properties.value and |
| 9 | P.value are two Objects refer to the same object which has been |
| 10 | updated before use it to update the object (8.12.9 step 10.a.ii.1) |
| 11 | includes: [propertyHelper.js] |
| 12 | ---*/ |
| 13 | |
| 14 | |
| 15 | var obj = {}; |
| 16 | |
| 17 | var obj1 = { length: 10 }; |
| 18 | |
| 19 | Object.defineProperty(obj, "foo", { |
| 20 | value: obj1, |
| 21 | writable: false, |
| 22 | configurable: false |
| 23 | }); |
| 24 | |
| 25 | var obj2 = obj1; |
| 26 | obj2.y = "hello"; |
| 27 | |
| 28 | Object.defineProperties(obj, { |
| 29 | foo: { |
| 30 | value: obj2 |
| 31 | } |
| 32 | }); |
| 33 | verifyEqualTo(obj, "foo", obj1); |
| 34 | |
| 35 | verifyNotWritable(obj, "foo"); |
| 36 | |
| 37 | verifyNotEnumerable(obj, "foo"); |
| 38 | |
| 39 | verifyNotConfigurable(obj, "foo"); |