Debian Codegraph @

js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66.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-66
6 description: >
7 Object.defineProperties throws TypeError when P.configurable is
8 false, P.enumerable and desc.enumerable has different values
9 (8.12.9 step 7.b)
10 includes: [propertyHelper.js]
11 ---*/
12
13
14 var obj = {};
15
16 Object.defineProperty(obj, "foo", {
17 value: 10,
18 enumerable: true,
19 configurable: false
20 });
21
22 try {
23 Object.defineProperties(obj, {
24 foo: {
25 enumerable: false
26 }
27 });
28 throw new Test262Error("Expected an exception.");
29 } catch (e) {
30 if (!(e instanceof TypeError)) {
31 throw new Test262Error("Expected TypeError, got " + e);
32 }
33 }
34
35 verifyProperty(obj, "foo", {
36 value: 10,
37 writable: false,
38 enumerable: true,
39 configurable: false,
40 });
41
42 reportCompare(0, 0);