1 # Disallow Shadowing of Restricted Names (no-shadow-restricted-names)
3 ES5 §15.1.1 Value Properties of the Global Object (`NaN`, `Infinity`, `undefined`) as well as strict mode restricted identifiers `eval` and `arguments` are considered to be restricted names in JavaScript. Defining them to mean something else can have unintended consequences and confuse others reading the code. For example, there's nothing preventing you from writing:
9 Then any code used within the same scope would not get the global `undefined`, but rather the local version with a very different meaning.
13 Examples of **incorrect** code for this rule:
16 /*eslint no-shadow-restricted-names: "error"*/
20 !function(Infinity){};
27 Examples of **correct** code for this rule:
30 /*eslint no-shadow-restricted-names: "error"*/
36 // Exception: `undefined` may be shadowed if the variable is never assigned a value.
42 * [Annotated ES5 - §15.1.1](https://es5.github.io/#x15.1.1)
43 * [Annotated ES5 - Annex C](https://es5.github.io/#C)
47 * [no-shadow](no-shadow.md)