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-88.js
blob5534a858b6bf9bc5ea96ceef5a737787ed2d699a
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-88
6 description: >
7     Object.defineProperties throws TypeError when P.configurable is
8     false, P.[[Set]] is undefined, properties.[[Set]] refers to an
9     object (8.12.9 step 11.a.i)
10 includes: [propertyHelper.js]
11 ---*/
14 var obj = {};
16 function get_Func() {
17   return 0;
20 Object.defineProperty(obj, "foo", {
21   set: undefined,
22   get: get_Func,
23   enumerable: false,
24   configurable: false
25 });
27 function set_Func() {}
29 try {
30   Object.defineProperties(obj, {
31     foo: {
32       set: set_Func
33     }
34   });
35   throw new Test262Error("Expected an exception.");
36 } catch (e) {
37   if (!(e instanceof TypeError)) {
38     throw new Test262Error("Expected TypeError, got " + e);
39   }
42 verifyProperty(obj, "foo", {
43   enumerable: false,
44   configurable: false,
45 });
47 var desc = Object.getOwnPropertyDescriptor(obj, "foo");
49 if (typeof(desc.set) !== "undefined") {
50   throw new Test262Error('Expected typeof (desc.set) === "undefined", actually ' + typeof(desc.set));
53 reportCompare(0, 0);