#2246: Create local short named aliases to global references
-----------------------------------+----------------------------------------
 Reporter:  fredck                 |       Owner:              
     Type:  New Feature            |      Status:  new         
 Priority:  Normal                 |   Milestone:  CKEditor 3.0
Component:  Project : FCKpackager  |     Version:              
 Keywords:  Confirmed              |  
-----------------------------------+----------------------------------------
 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.

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/2246>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to