Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperties / 15.2.3.7-6-a-68.js
blobdb5ed622cd59812e9f623ec5f9eb87aa5a789a88
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.7-6-a-68
6 description: >
7     Object.defineProperties throws TypeError when P is data property
8     and  P.configurable is false, desc is accessor property (8.12.9
9     step 9.a)
10 includes: [propertyHelper.js]
11 ---*/
14 var obj = {};
16 Object.defineProperty(obj, "foo", {
17   value: 10,
18   configurable: false
19 });
21 function get_func() {
22   return 11;
25 try {
26   Object.defineProperties(obj, {
27     foo: {
28       get: get_func
29     }
30   });
31   throw new Test262Error("Expected an exception.");
32 } catch (e) {
33   if (!(e instanceof TypeError)) {
34     throw new Test262Error("Expected TypeError, got " + e);
35   }
38 verifyProperty(obj, "foo", {
39   value: 10,
40   writable: false,
41   enumerable: false,
42   configurable: false,
43 });
45 reportCompare(0, 0);