Skip to content

Populate match indices for RegExp d flag (hasIndices) #611

@frostney

Description

@frostney

Summary

Populate the indices property on RegExp match results when the d flag is set.

Why

18 test262 tests fail. The d flag is accepted but exec() does not populate result.indices.

Current behavior

/a(b)c/d.exec("abc").indices is undefined.

Expected behavior

Result includes indices: [[0,3],[1,2]] with indices.groups for named captures.

Scope notes

  • Capture slot positions already tracked by VM
  • Convert to 0-based character indices in BuildMatchArray (Goccia.RegExp.Runtime.pas)

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMspec complianceMismatch against official JavaScript/TypeScript specification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions