Skip to content

Bug in type of RegExpMatchArray/RegExpExecArray #17094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abramobagnara opened this issue Jul 11, 2017 · 3 comments
Closed

Bug in type of RegExpMatchArray/RegExpExecArray #17094

abramobagnara opened this issue Jul 11, 2017 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@abramobagnara
Copy link

TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)

Expected behavior:

From ECMA specification it should be:

interface RegExpMatchArray extends Array<string | undefined> {
    index?: number;
    input?: string;
}

interface RegExpExecArray extends Array<string | undefined> {
    index: number;
    input: string;
}

Actual behavior:

Currently is:

interface RegExpMatchArray extends Array<string> {
    index?: number;
    input?: string;
}

interface RegExpExecArray extends Array<string> {
    index: number;
    input: string;
}
@ikatyang
Copy link
Contributor

Duplicate of #17053.

@jednano
Copy link
Contributor

jednano commented Oct 26, 2017

@abramobagnara, where in the ECMA specification does it have the index prop as optional (undefined)?

@abramobagnara
Copy link
Author

@jedmao, this is not what I've written: the fix should be about array items type.

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants