Debian Codegraph @

js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/prop-desc.js

raw
1 // |reftest| skip -- legacy-regexp is not supported
2 // Copyright (C) 2020 ExE Boss. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: pending
6 description: Property descriptor for RegExp.$1-$9
7 info: |
8 RegExp.$1-$9 are accessor properties with attributes
9 {
10 [[Enumerable]]: false,
11 [[Configurable]]: true,
12 [[Set]]: undefined,
13 }
14
15 get RegExp.$1-$9
16
17 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpParen1-9]]).
18 includes: [propertyHelper.js]
19 features: [legacy-regexp]
20 ---*/
21
22 for (let i = 1; i <= 9; i++) {
23 const property = "$" + i;
24 const desc = Object.getOwnPropertyDescriptor(RegExp, property);
25
26 assert.sameValue(desc.set, undefined, property + " setter");
27 assert.sameValue(typeof desc.get, "function", property + " getter");
28
29 verifyProperty(RegExp, property, {
30 enumerable: false,
31 configurable: true
32 });
33 }
34
35 reportCompare(0, 0);