no-caller
The use ofarguments.caller and arguments.callee make code optimizations impossible and are deprecated in ES5 strict mode.
Rule Type: Suggestion
Fixable: No
Fixable: No
Why This Rule Exists
- Deprecated: Forbidden in ES5 strict mode
- Performance: Prevents JavaScript engine optimizations
- Security: Can leak function references
- Maintainability: Makes code harder to understand
Rule Details
This rule disallows the use ofarguments.caller and arguments.callee.
Examples
Incorrect Code
Correct Code
Understanding arguments.callee
What It Did
arguments.callee refers to the currently executing function:
Why It’s Bad
Modern Alternatives
Named Function Expressions
Arrow Functions
Array Methods
Common Use Cases
Anonymous Recursion
Strict Mode Errors
Y Combinator
Performance Impact
Migration Guide
Step 1: Find Usage
Step 2: Add Function Names
Step 3: Test
Ensure recursion still works correctly.When Not to Use It
This rule should almost never be disabled:arguments.calleeis deprecated- It’s an error in strict mode
- It prevents optimizations