1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright 2019 Ron Buckton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The properties of the "indices" array are created with CreateDataProperty.
includes: [propertyHelper.js]
esid: sec-makeindicesarray
features: [regexp-match-indices]
info: |
MakeIndicesArray ( S, indices, groupNames, hasGroups )
13. For each integer _i_ such that _i_ >= 0 and _i_ < _n_, do
d. Perform ! CreateDataProperty(_A_, ! ToString(_n_), _matchIndicesArray_).
---*/
let input = "abcd";
let match = /b(c)/d.exec(input);
let indices = match.indices;
verifyProperty(indices, '0', {
enumerable: true,
configurable: true,
writable: true
});
verifyProperty(indices, '1', {
enumerable: true,
configurable: true,
writable: true
});
reportCompare(0, 0);
|