Skip to content

No match.index or match.input for RegExp::exec() result #1831

Open
@hfiguiere

Description

@hfiguiere

Describe the Bug

RegExp.exec() in JavaScript return an array with TWO extra properties set: input and index.
The Rust js_sys::RegExp::exec() just return an Array.

Steps to Reproduce

n/a. It's missing in the API.

Expected Behavior

js_sys::RegExp::exec() returns a Match struct that allow accessing input and index as per the JS API.

Actual Behavior

The returned value as a js_sys::Array that don't have index nor input properties.

Additional Context

There don't even seem to be an obvious way to the properties out of the underlying JS object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeTracking breaking changes for the next major version bump (if ever)js-sysIssues related to the `js-sys` crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions