arguments.callee and strict mode
Mark S. Miller
erights at google.com
Tue Mar 10 09:02:38 PDT 2009
On Tue, Mar 10, 2009 at 8:52 AM, Allen Wirfs-Brock <
Allen.Wirfs-Brock at microsoft.com> wrote:
> In reviewing the spec. I was reminded that arguments.callee is disabled
> within strict mode functions. Do you recall why you wanted to do this,
> other than general dislike of arguments.
POLA. A frequent and sensible pattern of use for "arguments" is to pass it
along to someone else to give them access to your arguments list. In typical
usage, it is not usually intended or desired to thereby give them access to
the function itself, not to give them the ability to alter your parameter
variables (hence the lack of joining).
> It occurs to me, that using arguments.callee is the only way to express
> recursion within a function created using the Function constructor and that
> use of the Function constructor (rather than eval) should probably be
> encouraged for dynamically constructing functions from source code.
> Why? I was thinking exactly the opposite: That we should encourage use of
eval() rather than the Function constructor for dynamic creation of
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es-discuss