Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperties / 15.2.3.7-6-a-18.js
blobfcd1e5d0d779998a01602f144a03ffdbeb097001
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-18
6 description: >
7     Object.defineProperties - 'O' is a Date object which implements
8     its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 )
9 includes: [propertyHelper.js]
10 ---*/
13 var obj = new Date();
15 Object.defineProperty(obj, "prop", {
16   value: 11,
17   configurable: false
18 });
20 try {
21   Object.defineProperties(obj, {
22     prop: {
23       value: 12,
24       configurable: true
25     }
26   });
27   throw new Test262Error("Expected an exception.");
28 } catch (e) {
29   verifyEqualTo(obj, "prop", 11);
31   verifyNotWritable(obj, "prop");
33   verifyNotEnumerable(obj, "prop");
35   verifyNotConfigurable(obj, "prop");
37   if (!(e instanceof TypeError)) {
38     throw new Test262Error("Expected TypeError, got " + e);
39   }
43 reportCompare(0, 0);