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-14.js
blob3ecd73ab51ffa1ba4eb1df91af29281e730f19a7
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-14
6 description: >
7     Object.defineProperties - 'O' is a String object which implements
8     its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 )
9 includes: [propertyHelper.js]
10 ---*/
12 var str = new String();
14 Object.defineProperty(str, "prop", {
15   value: 11,
16   configurable: false
17 });
19 try {
20   Object.defineProperties(str, {
21     prop: {
22       value: 12,
23       configurable: true
24     }
25   });
26   throw new Test262Error("Expected an exception.");
27 } catch (e) {
28   verifyEqualTo(str, "prop", 11);
30   verifyNotWritable(str, "prop");
32   verifyNotEnumerable(str, "prop");
34   verifyNotConfigurable(str, "prop");
36   if (!(e instanceof TypeError)) {
37     throw new Test262Error("Expected TypeError, got " + e);
38   }
42 reportCompare(0, 0);