@Scott it's fine, as long as we all get the real result not mentioned yet in
kangax article:

On Sat, Oct 24, 2009 at 9:57 PM, Shade <get...@gmail.com> wrote:

>
> That code would do the same thing, and create the same memory leak.
> However, it would allow you to fix it like this:
>
> var foo = function ext(o) {
>  // ...
> };
> ext = null; // squashes the IE memory leak with named function
> expressions
> return foo;
>

This code will create two variable references  in the same scope but we
don't need it.

Juryi is waiting dunno what to update the final solution, the one provided
by jdalton (maybe the reason he is trying to blame my IE Scope article
everywhere)

The way to solve that problem avoiding unnecessary nullify plus double named
funcitons/references (if we would like to write less obtaining the same
behavior without redundant variables/functions) is this:

var foo = function foo(){};
return foo;

a bit redundant but better than var foo = function bar(){}; since wehn we
need foo we just use foo, that's it.
no need to have two references in the same scope.

Leaks speaking, we have 189.256 with my suggestion VS 189.376 when you need
to nullify the reference

The difference increase with number of options or named expression we have
in the scope, accordingly with jdalton potentially 100000 ... nothing
problematic, but remember code size and no need to nullify anything.

The concept is identically applied, there is no difference between different
names and the same since resolution "layers" in JScript are well defined and
explained in Internet Explorer Scope Resolution.

This stuff has been described in another article where Juryi agreed about
above solution promising updates in the article.
(this is the last post of a trilogy plus the IE Scope Resolution:
http://webreflection.blogspot.com/2009/10/named-function-expressions-demystified_12.html
)

Regards


On Mon, Oct 26, 2009 at 1:03 PM, Scott Sauyet <scott.sau...@gmail.com>wrote:

>
> And I want to apologize for reopening the named function debate.
>
> All I meant to point out earlier was that in this case the named
> expression was not actually necessary, as it wasn't actually being
> used.  (As Andrea responded, it can be helpful for debugging though.)
>
>  -- Scott
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to