chakra-core / chakra-core/ChakraCore
Chakra should throw SyntaxError when a variable is already declared inside the "with" scope
Open
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
Assessment
This issue has not been assessed yet.