On Jan 5, 4:27 pm, "Kyle Simpson" <[email protected]> wrote:
> ?> There's a little more to it.
>
> > IE<9 actually creates 2 function objects when parsing NFE; not just leaks
> > identifier to the enclosing scope. It might seem irrelevant at first, but
> > if you consider that something like `var f = function g(){ ... } ` will
> > result in creation of 2 distinct function objects bound to `f` and `g`,
> > it's easy to imagine how this could lead to all kinds of lovely bugs (e.g.
> > when assigning to a property of function object; and having that property
> > on `f` but not `g`, or vice versa).
>
> In addition, the leakage of that extra identifier is a memory leak in IE <=
> 8. If you create a lot of those NFE's like that, you'll leak a noticeable
> amount of memory in IE.
>
> John David-Dalton suggested this pattern (I believe) which clears up the
> memory leakage:
>
> var abc = function def() { ... };
> ...
> // later, to make sure the memory is fully cleaned up:
> abc = def = null;
>
> But the fact that this was an issue all the way up through IE8 points out
> that NFE's are not a complete cure-all for losing arguments.callee, because
> they come with some unfortunate baggage in IE.

Did you send this to a wrong mailing list? :)

--
kangax

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to