indices-array.js 519 B

123456789101112131415161718
  1. // Copyright 2019 Ron Buckton. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. description: The "indices" property is an Array.
  5. esid: sec-makeindicesarray
  6. features: [regexp-match-indices]
  7. info: |
  8. MakeIndicesArray ( S, indices, groupNames )
  9. 6. Set _A_ to ! ArrayCreate(_n_).
  10. ---*/
  11. let match = /a/.exec("a");
  12. let indices = match.indices;
  13. // `indices` is an array
  14. assert.sameValue(Object.getPrototypeOf(indices), Array.prototype);
  15. assert(Array.isArray(indices));