Skip to content

Chakra should throw SyntaxError when a variable is already declared inside the "with" scope #5076

@baac

Description

@baac

Hi,

there is an inconsistency when a variable is declared twice as "var" and "let" inside the "with" scope. Chakra should not accept the redeclaration and indicate an error.

OS: Ubuntu 17.10
Chakra: 1.10.0.0-beta

Step to reproduce:

with({}) {
   var a;
   let a;
}

Actual result:
Pass without failures

Expected result:
SyntaxError: Cannot declare a variable twice

V8 and SpiderMonkey raises an exception as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions