Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-89.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-89
6 description: >
7 Object.defineProperties will not throw TypeError when
8 P.configurable is false, P.[[Set]] and properties.[[Set]] are
9 undefined (8.12.9 step 11.a.i)
10 includes: [propertyHelper.js]
11 ---*/
12
13
14 var obj = {};
15
16 function get_Func() {
17 return 0;
18 }
19
20 Object.defineProperty(obj, "foo", {
21 get: get_Func,
22 set: undefined,
23 enumerable: false,
24 configurable: false
25 });
26
27 Object.defineProperties(obj, {
28 foo: {
29 set: undefined
30 }
31 });
32
33 verifyNotEnumerable(obj, "foo");
34
35 verifyNotConfigurable(obj, "foo");
36
37 var desc = Object.getOwnPropertyDescriptor(obj, "foo");
38
39 if (typeof(desc.set) !== "undefined") {
40 $ERROR('Expected typeof (desc.set) === "undefined", actually ' + typeof(desc.set));
41 }