Debian Codegraph @

js/src/tests/test262/harness/propertyhelper-verifyconfigurable-not-configurable.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 Objects whose specified property is not configurable do not satisfy the
7 assertion.
8 includes: [propertyHelper.js]
9 ---*/
10
11 var threw = false;
12 var obj = {};
13 Object.defineProperty(obj, 'a', {
14 configurable: false
15 });
16
17 try {
18 verifyConfigurable(obj, 'a');
19 } catch(err) {
20 threw = true;
21 if (err.constructor !== Test262Error) {
22 throw new Error(
23 'Expected a Test262Error, but a "' + err.constructor.name +
24 '" was thrown.'
25 );
26 }
27 }
28
29 if (threw === false) {
30 throw new Error('Expected a Test262Error, but no error was thrown.');
31 }
32
33 reportCompare(0, 0);