﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2246	Create local short named aliases to global references	Frederico Caldeira Knabben		"The packager should be able to scan a function for all global references made inside of it. A global reference is a name not declared inside the function scope with the ""var"" or ""function"" statements.

For example, suppose we have the following function:

{{{
function( param )
{
    if ( CKEDITOR.env.IE || CKEDITOR.tools.trim( param ) == '' )
        CKEDITOR.doStuff();

    CKEDITOR.doOtherStuff();

    if ( CKEDITOR.env.IE )
        alert( CKEDITOR );
   
    return CKEDITOR.tools.trim( CKEDITOR.doAgain() );
}
}}}

... it would end up like this:

{{{
function( A )
{
    var B = CKEDITOR;
    var C = B.env.IE,
        D = B.tools.trim;

    if ( C || D( A ) == '' )
        B.doStuff();

    B.doOtherStuff();

    if ( C )
        alert( B );
   
    return D( B.doAgain() );
}
}}}

Note that the code is smart enough to reuse the new names when creating other var names too."	New Feature	closed	Normal		Project : CKPackager		wontfix		
