Skip to content

Support destructuring of catch clause parameter? #6243

Closed
@Arnavion

Description

@Arnavion

CatchParameter can be a BindingPattern.

try {
    throw [5];
}
catch ([ex]) { // error TS1195: Catch clause variable name must be an identifier.
    // Expect ex === 5
}

But I guess type annotations should still not be allowed on the inner bindings, which does decrease the usefulness somewhat...

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptES6Relates to the ES6 SpecFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions