Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-84-1.js

raw
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 = {
18 length: 10
19 };
20
21 Object.defineProperty(obj, "foo", {
22 value: obj1,
23 writable: false,
24 configurable: false
25 });
26
27 var obj2 = obj1;
28 obj2.y = "hello";
29
30 Object.defineProperties(obj, {
31 foo: {
32 value: obj2
33 }
34 });
35 verifyEqualTo(obj, "foo", obj1);
36
37 verifyNotWritable(obj, "foo");
38
39 verifyNotEnumerable(obj, "foo");
40
41 verifyNotConfigurable(obj, "foo");