Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-5.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-5
6 description: >
7 Object.defineProperties - 'P' is own accessor property (8.12.9
8 step 1 )
9 includes: [propertyHelper.js]
10 ---*/
11
12 var obj = {};
13
14 function getFunc() {
15 return 11;
16 }
17
18 Object.defineProperty(obj, "prop", {
19 get: getFunc,
20 configurable: false
21 });
22
23 try {
24 Object.defineProperties(obj, {
25 prop: {
26 value: 12,
27 configurable: true
28 }
29 });
30 $ERROR("Expected an exception.");
31 } catch (e) {
32 verifyEqualTo(obj, "prop", getFunc());
33
34 verifyNotEnumerable(obj, "prop");
35
36 verifyNotConfigurable(obj, "prop");
37
38 if (!(e instanceof TypeError)) {
39 $ERROR("Expected TypeError, got " + e);
40 }
41
42 }