Debian Codegraph @

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