chakra-core / chakra-core/ChakraCore
Function declarations should not shadow non-enumerable non-configurable properties of the global object
Open
Bug
Severity: 3
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Eshost Repro:
```js
Object.defineProperty(
this,
'data1',
{ configurable: false, value: 0, writable: true, enumerable: false }
);
let cmpn = $.evalScript(`
var x;
function data1() { }
`);
print(cmpn.type);
```
Expected: throw (of a TypeError per [GDI](https://tc39.github.io/ecma262/#sec-globaldeclarationinstantiation))
Actual: Normal, function shadowing is allowed.
Contributor guide
Assessment
This issue has not been assessed yet.