chakra-core / chakra-core/ChakraCore

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

Open
#5,076 11 comments 0 reactions 0 assignees View on GitHub
Bug Severity: 2
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.