Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/match-indices/indices-groups-object-undefined.js

raw
1 // Copyright 2019 Ron Buckton. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: The groups object of indices is created unconditionally.
6 includes: [propertyHelper.js]
7 esid: sec-makeindicesarray
8 features: [regexp-named-groups, regexp-match-indices]
9 info: |
10 MakeIndicesArray ( S, indices, groupNames, hasGroups )
11 10. If _hasGroups_ is *true*, then
12 a. Let _groups_ be ! ObjectCreate(*null*).
13 11. Else,
14 a. Let _groups_ be *undefined*.
15 12. Perform ! CreateDataProperty(_A_, `"groups"`, _groups_).
16 ---*/
17
18
19 const re = /./d;
20 const indices = re.exec("a").indices;
21 verifyProperty(indices, 'groups', {
22 writable: true,
23 enumerable: true,
24 configurable: true,
25 value: undefined
26 });
27
28 reportCompare(0, 0);