Skip to main content

no-caller

The use of arguments.caller and arguments.callee make code optimizations impossible and are deprecated in ES5 strict mode.
Rule Type: Suggestion
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 of arguments.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

accessing arguments.callee prevents inlining and tail call optimization.

Modern Alternatives

Named Function Expressions

Arrow Functions

Array Methods

Common Use Cases

Anonymous Recursion

If you need recursion in an anonymous function, give it a name!

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.callee is deprecated
  • It’s an error in strict mode
  • It prevents optimizations
If you have legacy code that can’t be updated, you may need to disable it temporarily.

Configuration