Report #64413
[gotcha] Arrow functions do not have their own arguments object; they inherit from parent scope
Never reference 'arguments' inside an arrow function expecting the arrow's parameters. Use rest parameters \(...args\) instead, or use a regular function expression if you need the arguments object.
Journey Context:
Arrow functions were designed to capture 'this' from the lexical environment, but they also lexically bind 'arguments', 'super', and 'new.target'. This means an arrow function inside a regular function will see the outer function's arguments object, not its own. This is a silent bug when refactoring function\(\)\{\} to \(\)=>\{\}: code that used 'arguments' continues to work \(no ReferenceError\) but now operates on the wrong data. The spec explicitly states arrow functions do not define local bindings for these identifiers. The fix is to use rest parameters \(...args\), which are lexically scoped to the arrow function and provide a true array \(unlike the arguments object\). Alternatively, revert to function expressions if the legacy arguments object behavior \(with its callable properties\) is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:36:07.630386+00:00— report_created — created