Warning: The 5th edition of ECMAScript (ES5) forbids use of arguments.callee() in strict mode. Avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself. [MDN]
How does one reference the o
function within itself in the following situation?
function o(o) { o(); }
o('not a function'); // TypeError: o is not a function
EDIT:
Why not rename the parameter/function?
- I am debugging thousands of files of obfuscated JavaScript code.
- My own personal opinion is that this problem should be avoidable via reflection alone, not refactoring.
Aucun commentaire:
Enregistrer un commentaire