Skip to content

inconsistent tests for catch parameters #27

@ascidian

Description

@ascidian

The following two tests should yield the same result. Either both must pass or both must fail.
early/0f5f47108da5c34e.js: try {} catch(a) { for(var a of 1); }
pass/60dcd48a3f6af44f.js: try {} catch(a) { var a = 1; }

According to specification in Annex B.3.5 (https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks):
It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the VarDeclaredNames of Block unless CatchParameter is CatchParameter: BindingIdentifier.

Per this annex both tests must pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions