chakra-core / chakra-core/ChakraCore

Function declarations should not shadow non-enumerable non-configurable properties of the global object

Open
#3,374 1 comment 0 reactions 1 assignee Claimed by @atulkatti View on GitHub
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

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.