summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js b/js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js
new file mode 100644
index 0000000000..c050976f54
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/match-indices/indices-array-properties.js
@@ -0,0 +1,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);