Consider not using 'arguments.callee' and arguments.caller' |
Consider not using 'arguments.callee' and 'arguments.caller', these have been deprecated to allow for code optimisations in JavaScript. Consider replacing with a recursive callback were required
CheckId | SPC058902 |
---|---|
TypeName | DeprecatedCodeCallerAndCallee |
Severity | Warning |
Type | JavaScriptFile |
Bad Practice
function foo(n) {
if (n <= 0) {
return;
}
arguments.callee(n - 1);
}
if (n <= 0) {
return;
}
arguments.callee(n - 1);
}
Good Practice
function foo(n) {
if (n <= 0) {
return;
}
foo(n - 1);
}
if (n <= 0) {
return;
}
foo(n - 1);
}
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.