Skip to content

Declaring a var inside a catch block with the same name gives no error #2186

@JsonFreeman

Description

@JsonFreeman

Like #2185, but in catch blocks:

try { }
catch (e) {
   let e;
   var e;
}

Section 13.14.1 of the ES6 spec says:

It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the
LexicallyDeclaredNames of Block.

It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the
VarDeclaredNames of Block

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions