The following variable redefinitions have been performed
Customise the level of compression
Remove white space
Remove line terminators
To leave specific variable names unaffected enter them, one per line, in the text area below:
ready, click the 'Compress' button in the top right.
Once the compression of your code has been completed it will be displayed on the output tab. At the top
there is also a summary of the compression ratio that has been achieved.
If you wish to start afresh with a new dictionary it can be cleared with the 'Clear' button in the top
right of the dictionary tab.
The are known issues with the following:
Regular expression literals
Expressions containing regular expression literals such as
var regexp = /^gr[ae]y$/i;
will be misinterpreted by the compressor. It is recommended that for
now you either replace regular expression literals with RegExp objects, e.g.
var regexp = new RegExp('gr[ae]y', 'i');
or alternatively could temporarily replace your regexp with a string, i.e.
var regexp = '/^gr[ae]y$/i';
perform the compression, then return the strings to regular expression literals.
Automatic semicolon insertion
element is encountered after a new line a semicolon will be automatically inserted before the offending
element. For example in the code
a = 1
b = 2
a = 1
;b = 2
a = 1b = 2
So don't rely on automatic semicolon insertion. Note, you probably use automatic semicolon insertion
without realising, for example, the following piece of code
CClass.prototype.MemberFn1 = function()
// do something
CClass.prototype.MemberFn2 = function()
// do something else
Some automatic semicolon insertion is handled and even taken advantage of by the compressor. Automatic
and similarly for the "--" operator, also for
and similarly for "break", "continue" and "throw" statements.
such an application, it was more just a fun exercise that I ended up doing after reading the ECMA script specification!