Ajax Minifier Changelog

What's new in Ajax Minifier 5.12

Nov 20, 2014
  • Fix for issue #21164 - variable renaming issue when -evals:immediate switch is used.
  • Fix for issue #21292 - null-reference exception when using the scriptsharp source map generator.
  • Fix for issue #21494 - sourceMappingUrl comment not added when using the Minifier object.
  • remove empty CSS rules or @media directives when their blocks are empty.
  • add some more known global names
  • minor performance improvements.

New in Ajax Minifier 5.11 (Jul 2, 2014)

  • Fix for issue #21057 - don't strip spaces before CSS !important token.
  • Fix for issue #20912 - support for CSS :any and :matches pseudoclasses.

New in Ajax Minifier 5.10 (May 28, 2014)

  • Fix for Issue #20875 - echo switch doesn't work for CSS
  • CSS should honor the SASS source-file comments
  • JS should allow multi-line comment directives

New in Ajax Minifier 5.9 (Apr 29, 2014)

  • new -amd switch that automatically adds "define" and "require" to the known globals list, and removes duplicate named modules define("modulename",...) from the combined source file.
  • stand-alone tokens or tokens that are the only contents of a string literal will be examined, and if they start with CurrentCulture, the dotted path will be resolved against the thread's CultureInfo.CurrentCulture object and replace the token.

New in Ajax Minifier 5.8 (Mar 1, 2014)

  • Issue #20705 - add support for SharePoint Theming comments in CSS.
  • Issue #20719 - manifest processing was ignoring elements.
  • Issue #20739 - in an expression-level call to JSParser.Parse, do not convert commas to semicolons because they aren't statements, but actual subexpressions.

New in Ajax Minifier 5.7 (Jan 14, 2014)

  • Add support for "typed array" constructors.
  • Fix for issue #20611 - Chrome implemented a proposed errata for Media Queries that requires whitespace before the "and" conjunction. Make sure the CSS minifier doesn't strip it out.

New in Ajax Minifier 5.6 (Dec 19, 2013)

  • Fix for bug 20541 - in CSS strings, and ASCII-9 is not a "\t", ASCII-10 is not "\n", ASCII-13 is not "\r", and ASCII-12 is not "\f".
  • Fix bug 20517 - in CSS, invalid color hash values were parsed incorrectly and caused a slew of other irrelevant errors. Just log the invalid hash color and continue on.
  • Make the and elements in manifest files accept the legacy "enc" attribute name in addition to the newer "encoding" attribute. Changed the online documentation to reflect the new name.
  • throw invalid-switch errors when switches incompatible with -pretty are used together. (NOTE: the -pretty switch is a special switch that does not change the input other than to add whitespace to make it more readable, so any switches that cause the input to be modified cannot be used with it. Please use the -line switch to make modified code output on multiple lines.)
  • added the ability to use -pretty with JSON input, so you can use it to make JSON output returned from services a little easier to debug.

New in Ajax Minifier 5.5 (Dec 14, 2013)

  • Fix bug #20499, where the Append method was marked as internal. Also, the Manifest build task was always showing all errors and warnings; changed it to respect any -warn:N arguments in the manifest settings to be able to crank down the severity threshold.

New in Ajax Minifier 5.4 (Dec 4, 2013)

  • Fix potential infinite loop problem introduced in 5.3.
  • Add option to pretty-print JSON data.

New in Ajax Minifier 5.2 (Oct 1, 2013)

  • added -nosize switch to turn off the size- and gzip-calculations done after minification.
  • removed the comments in the build targets script for the old AjaxMin build task (discussion #458831).
  • Fixed an issue with extended Unicode characters encoded inside a string literal with adjacent \uHHHH\uHHHH sequences.
  • Fixed an IndexOutOfRange exception when encountering a CSS identifier that's a single underscore character (_).

New in Ajax Minifier 5.1 (Sep 17, 2013)

  • Reverted all the DLLs' "Platform Target" project settings to "Any CPU." The problem with putting them to "x86" is that a host application built to "Any CPU" or "x64" fails to load the DLL. So the EXEs will remain "x86"; only the DLLs are reverted to "Any CPU". This should fix Issue #20199.

New in Ajax Minifier 4.96 (Jul 13, 2013)

  • Fix for issue #19957: EXE should output the name of the file(s) being minified.
  • Discussion #449181: throw a Sev-2 warning when trailing commas are detected on an Array literal. Perfectly legal to do so, but the behavior ends up working differently on different browsers, so throw a cross-browser warning.
  • Add a few more known global names for improved ES6 compatibility
  • update Nuget package to version 2.5 and automatically add the AjaxMin.targets to your project when you update the package. This target will automatically build any files in your project with the extension .AjaxMin using the AjaxMinManifestTask.
  • get rid of multiple code paths and the maintenance nightmare of maintaining them separately for normal, echo, and preprocess-only. The preprocess-only path wasn't even parsing the input files.
  • if the length property is being applied to a string literal which has a known length, replace the property access with the actual length.
  • remove most custom exceptions, and remove the serialization code from the remaining one. Needed for WebGrease and its partially-trusted callers scenarios.

New in Ajax Minifier 4.95 (Jun 26, 2013)

  • update parser to allow for CSS3 calc( function to nest.
  • add recognition of -pponly (Preprocess-Only) switch in AjaxMinManifestTask build task.
  • Fix crashing bug in EXE when processing a manifest file using the -xml switch and an error message needs to be displayed (like a missing input file).
  • Create separate Clean and Bundle build tasks for working with manifest files (AjaxMinManifestCleanTask and AjaxMinBundleTask). Removed the IsCleanOperation from AjaxMinManifestTask -- use AjaxMinManifestCleanTask instead. Updated the provided .targets file as such.
  • Add ability for CSS parser to recognize CSS-style multi-line #SOURCE comments, since single-line comments aren't actually valid CSS syntax. Needed because the new bundling task needs to output valid CSS, since the results are exposed and not immediately consumed by the tool.

New in Ajax Minifier 4.94 (Jun 18, 2013)

  • add dstLine and dstCol attributes to the -Analyze output in XML mode.
  • un-combine leftover comma-separates expression statements after optimizations are complete so downstream tools don't stack-overflow on really deep comma trees.
  • add support for using a single source map generator instance with multiple runs of MinifyJavaScript, assuming that the results are concatenated to the same output file.

New in Ajax Minifier 4.92 (May 29, 2013)

  • Fixed issues around certain numeric literals that have member-operators applied to them.
  • InputFolder was being ignored by ManifestTask, leading to incorrect "missing input file" errors.

New in Ajax Minifier 4.91 (May 9, 2013)

  • Add optional "origin" property to manifest elements. Setting origin="external" on an input file makes the build process ignore all warnings for the given file.
  • Add the .NET 3.5 DLLs (AjaxMin.dll and AjaxMinTask.dll) to the NuGet package tools\net35 folder.
  • Add a "clean" step for the AjaxMinManifestTask so that output files specified in the manifest can be deleted in the build's clean process.

New in Ajax Minifier 4.90 (Apr 27, 2013)

  • Fix for Issue #19632 - when generating source maps, need to wrap the //@ sourceMappingURL=url comment inside a multiline comment to keep IE from thinking it's a conditional-compilation comment and throwing an error.
  • Fix for Issue #19639 - when using the -minify:no switch, don't optimize out empty blocks, and especially not empty else-clauses. The switch means don't modify the DOM, so DOM modifications should not be performed.

New in Ajax Minifier 4.89 (Apr 25, 2013)

  • Fix for second follow-up issue discovered in Issue #19459. Inner scopes known at compile time that reference a field in an outer scope that isn't known need to add that field to the avoid-names list before renaming their local variables, because we can't rename that outer variable (because it's in an unknown scope), and we don't want to accidentally reuse the name. Only an issue when the -evals:safeall switch is used, especially when minifying already-minified files.

New in Ajax Minifier 4.88 (Apr 20, 2013)

  • Fix for issue #19459 for the BUILD TASKS. When concatenating source files, append blank lines and semicolons as appropriate to make sure files are terminated properly.

New in Ajax Minifier 4.87 (Apr 13, 2013)

  • Fix for issue #19459 - need to insert semicolons between concatenated files if they don't already end with a semicolon. Potential Breaking Change To concatenate partial script files without getting semicolons added between them, add a single-line comment at the end of your partial script files, ending with a semicolon: //; The code is simply doing a text-comparison for the trailing semicolon (ignoring terminating whitespace), so this will be enough to signal AjaxMin to not add the semicolon and break the assembled partial code files.
  • Fix for issue #19559 - don't replace single-reference object literal variable declarations when the reference is within an iteration statement.
  • Somehow the "unreferenced variable" warnings were previously accidentally disabled and I didn't notice; reinstating those warnings.

New in Ajax Minifier 4.86 (Mar 30, 2013)

  • Fix file concatenation issues

New in Ajax Minifier 4.85 (Mar 22, 2013)

  • JavaScript:
  • Don't lose important comments at the end of block or functions (issue #19416).
  • fix bad optimization of Array shift calls that are the only reference to a variable initialized with an array literal (issue #19440).
  • created separate EmptyStatement node instead of using an empty block.
  • ignore important comments that would otherwise interfere with the normal parsing of the source code.
  • CSS:
  • don't strip off units for zero-value Angles, Times, Frequencies, or Resolutions.

New in Ajax Minifier 4.84 (Feb 12, 2013)

  • Fixed a bug whereby passing a null or empty string to the CssParser.Parse(string) method would throw an exception. The command-line or task paths for executing the code were not affected by the bug.

New in Ajax Minifier 4.83 (Feb 7, 2013)

  • Fixed issue #19309 - regexp literals with the "g" global flag cannot be treated as constants as they contain state that is used in subsequent exec() calls. Don't move them from a variable to an in-place literal.
  • Fixed issue #19296 - ///#DEBUG blocks were getting removed unless the DEBUG preprocessor define existed, and totally ignored the StripDebugStatements CodeSettings flag. Legacy builds switched off that property, so people broke when upgrading. Changed the logic to leave those comments in if either the DEBUG preprocessor define exists OR the StripDebugStatements flag is false. Default is still to remove.
  • Fixed issue where throw statements could possibly line-break between the throw keyword and its operand (not allowed in JS syntax) when the -line:N switch is used to break lines after they have crossed the N-character threshold.
  • comments containing "@preserve" or "@license" should be treated as important comments and not removed. This is an alternative way to create important comments, beyond the current /*! ... */ and //! ... formats.

New in Ajax Minifier 4.82 (Feb 6, 2013)

  • Fixing a bug around invalid JS (for the current ES5 specs): function declarations at other than source-element scopes. Technically it's invalid to put a function declaration within, say, an if-block; but browsers allow it -- unfortunately they treat them differently since it's not a spec'd scenario. Some declare the name immediately as if it were at the source element level; some don't declare the name until the declaration is "executed." The difference could lead to hard-to-debug cross-browser issues.
  • AjaxMin was updated a while back to support the upcoming ES6 spec, which calls for block-level scoping of lexical elements, including function declarations. So it will be perfectly valid to declare a function within an if-statement -- but the declaration will only be scoped to that block and not visible outside it. The end result is that if someone writes some JavaScript to the current browsers thinking their function declaration will be scoped to the variable scope, AjaxMin will break that code upon minification by renaming it to something that doesn't collide within the lexical scope -- but might collide in the variable scope, clobbering values.
  • Updated AjaxMin such that it maintains a linkage to the variable scope so the lexical function declaration won't collide with another variable-scope field during renaming. Also added a low-sev warning about the situation, since most people aren't coding ES6 yet anyway. Will have to revisit later; maybe add a JS version switch for ES5 vs ES6.

New in Ajax Minifier 4.81 (Jan 22, 2013)

  • Fixed issue where the AjaxMin build task was ignoring any -enc switches applied to the task and only outputting as UTF-8 with no BOM.

New in Ajax Minifier 4.80 (Jan 16, 2013)

  • Fix for issue #19190 in the AjaxManifestTask build task: the manifest file itself should be treated as an input file and modification to it should cause output to be regenerated during build.

New in Ajax Minifier 4.79 (Jan 15, 2013)

  • Fix for Issue #19055 - Manifest XML file didn't accept .RESX resources, just .RESOURCES.
  • Fix for issue 19087 - used to throw an error if it encountered a CSS3 @charset rule anywhere other than the exact first character in the file. Now it's a little more forgiving if the first few characters are BOM characters. Also, it will now continue to process the input properly, and throw a lesser-severity error that is more descriptive of what is actually going on (@charset not at start of file).
  • Fix a crashing issue when the input JS ended in an empty and unterminated string delimiter.
  • Fixed the context of the returned overall parsed script block; the end point was incorrect (didn't include the proper line/column numbers).
  • Various ongoing code-analysis maintenance fixes (too much complexity in many methods).
  • moved the source project to Visual Studio 2012; had to migrate the setup project to WiX, since the old VS Setup projects are no longer supported in VS2012.

New in Ajax Minifier 4.78 (Dec 8, 2012)

  • Fix for issue #18924 - using -pretty option left in ///#DEBUG blocks.
  • Fix for issue #18980 - bad += optimization caused bug in resulting code. Optimization has been removed pending further review.

New in Ajax Minifier 4.77 (Dec 7, 2012)

  • Look for and strip "IDENT:nomunge" minification hints that define fields that should not be automatically renamed within the current scope (multiple IDENT:nomunge pairs can be specified in a single string literal if comma-separated). Will only work if the field is actually defined within the current scope (can't be used to not rename an outer field, for instance; will be ignored in those cases). Minification hints are expression statements that are composed of a single string literal similar to directive prologues, but can appear anywhere in the code. Not specifying an IDENT or specifying an asterisk (*) as the IDENT will cause all fields defined in the current scope to not be automatically renamed. Example: "myarg:nomunge" as a statement in a function with an argument named "myarg" would cause myarg not to be renamed to n (or whatever).
  • previously threw sev-4 warnings if semicolon-insertion rules were encountered. Suppress those warnings if the next character is a } or EOF.

New in Ajax Minifier 4.76 (Dec 3, 2012)

  • Fixed a typo in ObjectLiteralProperty.IsConstant that caused all object literals to be treated like they were constants, and possibly moved around in the code when they shouldn't be.

New in Ajax Minifier 4.74 (Nov 12, 2012)

  • fix for issue #18836 - sometimes throws null-reference errors in ActivationObject.AnalyzeScope method.
  • add back the Context object's 8-parameter constructor, since someone has code that's using it.
  • throw a low-pri warning if an expression statement is == or ===; warn that the developer may have meant an assignment (=).
  • if window.XXXX or window"XXXX" is encountered, add XXXX (as long as it's a valid JavaScript identifier) to the known globals so subsequent references to XXXX won't throw an "undefined global" error.
  • throw lint-style lowest-pri warnings for statements that don't end in a semicolon and rely on semicolon-insertion rules to kick in.
  • If TermSemicolons settings is true, insert a semicolon between any concatenated files before minifying.
  • if an integer constant has the dot-operator applied to it, don't wrap it in parens; just force the decimal-point to be output.
  • add a kill-switch to turn off the removal of unreferenced variables.
  • fix bug in manifest task where it was throwing an exception if there are no .AJAXMIN files in the project.

New in Ajax Minifier 4.73 (Oct 30, 2012)

  • Fix issue in Discussion #401101 (unreferenced var in a for-in statement was getting removed).
  • add the grouping operator to the parsed output so that unminified parsed code is closer to the original. Will still strip unneeded parens later, if minifying.
  • more cleaning of references as they are minified out of the code.

New in Ajax Minifier 4.72 (Oct 24, 2012)

  • Fix for Issue #18819 - bad optimization of return/assign operator.

New in Ajax Minifier 4.70 (Oct 13, 2012)

  • Fixed issue described in discussion #399087: variable references within case values weren't getting resolved.

New in Ajax Minifier 4.69 (Oct 10, 2012)

  • Fix for issue #18766: build task should not build the output if it's newer than all the input files.
  • Fix for Issue #18764: build taks -res switch not working.
  • update build task to concatenate input source and then minify, rather than minify and then concatenate.
  • include resource string-replacement root name in the assumed globals list.
  • Stop replacing new Date().getTime() with +new Date -- the latter is smaller, but turns out it executes up to 45% slower.
  • add CSS support for single-line comments.

New in Ajax Minifier 4.68 (Oct 8, 2012)

  • Fixes for issues:
  • 17110 - added support for -moz-calc or -webkit-calc to previous fix for calc support.
  • 18652 - if being run under Mono runtime, don't mistake UNIX-style paths for command-line switches.
  • 18659 - added capability to specify JS settings for CSS files that have JS embedded in expressions.
  • Other changes:
  • add DLL support for -pponly switch. Add support for -js:expr, -js:evt, and -js:json to allow easy parsing for expressions, event handlers, and JSON code.
  • fixed error-handling code that was hiding some errors and promoting warnings to errors when they shouldn't.
  • separate scanner logic and parser logic. Scanner now only scans token and performs pre-processing evaluation, so it only has one code-path whether scanning JS or doing pre-process only. Parser performs the parsing tasks like ignoring whitespace and comments, conditional-compilation, pp-only, etc.
  • separate parsing from resolving from analyzing. Variable resolution was being handled partly in the parser, partly in the AST nodes themselves, and partly in the tree analyzing phase. Now parser just parses, and there is a separate resolution phase. This fixes the problem where people don't want to modify the AST, but still need variable resolution.
  • beginning ES6 compliance with support for ES6 let- and const-statements, along with their associated block-level scoping rules.
  • combine multiple input files, then minify the group, rather than minifying each file independently and combining the results. Error messages still point to proper line/col in the individual input source files.
  • remove the PowerShell scripts from the Nuget package that attempted to add the task DLL to the project files.
  • properly handle invalid numeric literal sequences; also add support for ES6 binary and octal numeric literals.
  • made it so using the -minify:false switch (or MinifyCode setting) actually does what people expect: parse the code, skip the AST modification step, and output valid JavaScript.

New in Ajax Minifier 4.67 (Sep 14, 2012)

  • Fix issue #18629 - incorrectly handling null characters in string literals and not throwing an error when outside string literals.
  • update for Issue #18600 - forgot to make the ///#DEBUG= directive also set a known-global for the given debug namespace.
  • removed the kill-switch for disregarding preprocessor define-comments (///#IF and the like) and created a separate CodeSettings.IgnorePreprocessorDefines property for those who really need to turn that off. Some people had been setting -kill:-1 to turn off as much minification as possible, but then getting both branches of their ///#IF-///#ELSE code in the output.
  • as part of issue #18629, tried to add more code to prevent infinite loops (even though versions 4.50+ stopped hanging on the code provided in that issue).

New in Ajax Minifier 4.66 (Sep 8, 2012)

  • DLLs are back to being named AjaxMin.dll.
  • EXEs are renamed to AjaxMinifier.exe. Yes, yes; I know: making the same dumb mistake again. But I really can't go back to them colliding with each other. Too many people were linking with the DLLs, which is what they are designed for, but hopefully not a lot of people are linking to the EXE. If you are, you're probably not doing it in a chained-dependency manner. Besides, the nuget package doesn't even have the EXE in it.
  • Fixed issue #18600: case-sensitivity issue with the -debug switch's boolean value, and make debug namespaces automatically part of the known globals space.
  • made the default text encoding when outputting to the console ASCII, because the console can't seem to display the default UTF-8. When outputting to a file, the default is still UTF-8. And if you don't want ASCII to the console, you can still use the -enc:out switch to set it to whatever you want (even UTF-8).
  • Fix Issue #18603: the build tasks do not write the output files if there were errors, but they will if there were warnings.
  • In fixing the previous issue, I noticed that all of the errors were being reported as warnings, so I fixed that. Anything with a Severity less than 2 (0 or 1) is now correctly reported as an error.
  • changed the SwitchParser class to accept commas OR semicolons wherever delimited lists were previously only accepting commas. This is so build tasks can do things like Switches="-define:$(DefineConstants)" and not have to massage the data to be comma-delimited.
  • added separate .NET 2.0, .NET 3.5, and .NET 4.0 DLLs to the nuget package so the consumer can use the appropriate one for the framework they are using.
  • I have also added the AjaxMinTask.dll and targets to the nuget package's TOOLS folder, for those who want to use AjaxMin to minimize their JS and CSS in their project's build process.

New in Ajax Minifier 4.65 (Sep 6, 2012)

  • Fixed null-reference error in the build task constructor.

New in Ajax Minifier 4.64 (Sep 5, 2012)

  • This release keeps the .net 2.0 version named AjaxMin.dll. The new .net 3.5 and .net 4.0 versions are named AjaxMinLibrary.dll. If an existing project is expecting the old name, they should continue to pick up the .net 2.0 version (since the previous version was .net 2.0 anyway). Libraries that were quick on the draw and updated to pick up the new versions will continue to pick up the new versions - if they are .net 3.5 or .net 4.0.

New in Ajax Minifier 4.62 (Aug 24, 2012)

  • Fix for issue #18525 - escaped characters in CSS identifiers get double-escaped if the character immediately after the backslash is not normally allowed in an identifier.
  • fixed symbol problem with nuget package. 4.62 should have nuget symbols available again.

New in Ajax Minifier 4.61 (Aug 23, 2012)

  • had to rename the DLL. It is no longer AjaxMin.dll, but AjaxMinLibrary.dll. I was getting strong-name collisions between the executable and the DLL and needed to make sure the name of the assemblies are different.
  • this release is compiled to the .NET 4.0 runtime. No one objected when I posted a discussion about doing this, so if you try it and say, "oh, nuts -- I need an earlier runtime!" please let me know because I'm building a series of variations and probably already have what you need. I just didn't want to inflate the MSI with extra binaries if no one really cares about them.
  • I've changed the CLOBBER behavior that I have really hated all this time. SO: by default now AjaxMin will overwrite existing files if the read-only bit is not set. If the read-only bit is set and you still want to over-write it, use the -CLOBBER parameter. If you don't want to overwrite existing files ever, use the -NOCLOBBER flag.
  • Fixed an odd issue where an optimization resulted in incorrect JavaScript if the MinifyNumericLiterals kill-switch was turned on.
  • No longer throws an error if the source uses reserved words for property names in object literals. The language spec says that's okay, but some browsers can't handle that. So instead of an error, it's now throwing a severity-2 cross-browser warning.

New in Ajax Minifier 4.60 (Aug 16, 2012)

  • Allow for CSS3 grid-column and grid-row repeat syntax.
  • Provide option for -analyze scope-report output to be in XML for easier programmatic processing; also allow for report to be saved to a separate output file.

New in Ajax Minifier 4.59 (Aug 3, 2012)

  • change the default input and output encodings to UTF-8. Should still read ASCII input files just fine, but if your build/product depends on the output being an ASCII file and having extended characters encoded in the output using the \uXXXX syntax rather than simple UTF-8 sequences, then you will need to add -enc:out ascii to your AjaxMin build switches to output as ASCII. Most people seem to be expecting UTF-8 to be the default for both input and output.
  • Fix issue #18304: catch variables defined between a child scope referencing an outer variable above the catch scope need to resolve correctly.
  • fix an issue where the -enc:out switch wasn't being honored when using -xml switch.
  • adjust usage text to be more consistent in syntax and in-line with the online documentation.
  • when using JSCombinedFileName and/or CssCombinedFileName properties in the build task, minify the input files first, then concatenate the results (rather concatenating the source and minifying) so error line/column numbers still correspond to the actual input files.
  • minor tweaks and adjustments to pretty-print multiline output.
  • ability to clear or add debug namespaces from within the source via ///#DEBUG= preprocessor comments, in addition to the -debug switch.

New in Ajax Minifier 4.53 (May 25, 2012)

  • fix issue #18106, where member operators on numeric literals caused the member part to be duplicated when not minifying numeric literals
  • ADD NEW FEATURE: ability to create source map files! The first mapfile format to be supported is the Script# format. Use the new -map filename switch to create map files when building your sources.

New in Ajax Minifier 4.52 (May 16, 2012)

  • Make preprocessor comment-statements nestable; add the ///#IFNDEF statement. (Discussion #355785)
  • Don't throw an error for old-school JScript event handlers, and don't rename them if they aren't global functions.

New in Ajax Minifier 4.51 (May 16, 2012)

  • Added a CSS settings field that can be changed from the CSS parser expecting a full CSS Stylesheet syntax or just a list of declarations, for instance: when passing in the value of an HTML style attribute.

New in Ajax Minifier 4.50 (May 2, 2012)

  • Add support for const statements.

New in Ajax Minifier 4.49 (May 2, 2012)

  • don't move function declarations to the top of the scope if they are within conditional-compilation comments.
  • don't ever rename named function expressions if they are defined within the global scope, because IE puts their fields in the containing scope, not the function expression itself (as the language specs and all other browsers so).
  • If the -fnames:lock switch is used, make sure that the function expression name is also locked in the parent scope, for the same reason as above.
  • allow the training \9 IE hack in CSS files if the property value is a color hash.
  • optimize any manually-written if-shortcut expression statements: if a statement is !expr&&a(); we can change it to expr||a(); if it's smaller.

New in Ajax Minifier 4.48 (Apr 19, 2012)

  • Remove more superfluous classes
  • make sure expression statement starting with an object literal is enclosed in parentheses.
  • bug fix: if final line of file is single-line conditional-comment, don't lose that comment (disc #351241)
  • bug fix: fix issue where sometimes a global variable that is assigned a named function expression of the same name gets incorrectly automatically renamed -- IF the global variable is referenced inside some other function later on in the file.

New in Ajax Minifier 4.47 (Apr 19, 2012)

  • Properly output escaped characters in CSS identifiers
  • throw an EOF error when parsing a CSS selector that doesn't end in a declaration block
  • chased down a stack-overflow issue with really large JS sources. Needed to flatten out the AST tree for adjacent expression statements that the application merges into a single expression statement, or that already contain large, comma-separated expressions in the original source.
  • fix issue #17569: tie together the -debug switch with the DEBUG define (and vice-versa).

New in Ajax Minifier 4.46 (Apr 19, 2012)

  • fix for issue #17390: add "$super" to the default "no rename" list so minifying the Prototype library doesn't break it. Can always be overridden with the settings if needed.
  • added another code optimization for if(cond)continue statements within loops.
  • minor reporting tweak (-a option): noticed that function declarations were being reported as "unreachable" if the -minify:0 or -p options were used, because when we aren't minifying, the code to check for referenced functions isn't being run. Temporarily removed that function description when not minifying; looking into getting that code run all the time.

New in Ajax Minifier 4.45 (Apr 19, 2012)

  • Added a CustomNode class for users of the DLL version who wish to add custom nodes to the AST tree and optionally have them output JS code to the final results. Derive from CustomNode and implement the ToCode method.
  • tweaked the -line option. No longer need to put -line:,M to get multi-line output with no line-length limit; can leave off the comma and just do -line:M
  • Added a few more optimizations for if-statements.
  • Added another place where while-statements will be transformed into for-statements.

New in Ajax Minifier 4.44 (Apr 19, 2012)

  • Issue #17256 - do not assume logical-not of < operator is >=, and > operator is

New in Ajax Minifier 4.43 (Apr 19, 2012)

  • Fix for Issue #17225: I had previously missed a case where identifiers may be constructed using ASP.NET blocks (when using the -aspnet:1 switch).

New in Ajax Minifier 4.42 (Apr 19, 2012)

  • Fix for issue #17202 - #rrggbb color values should not be abbreviated to #rgb within progid value parameters.
  • Minor fix to allow for the IE-only hack of adding \9 at the end of a property value when the last value is a percentage (worked for identifiers and other dimension values before, but it was inserting a space between the % and \9).

New in Ajax Minifier 4.41 (Apr 19, 2012)

  • Fix for issue #17110: support for CSS3 calc(, min(, and max( functions.
  • Fix for issue #16850: add kill bit for moving in-operators into for-statements, even if properly parenthesized (work-around for Opera 11 bug).

New in Ajax Minifier 4.40 (Dec 21, 2011)

  • Fix for issue #17034: when minifying multiple CSS files with the comment-hacks setting, only the first file was keeping its comment hacks because the code was changing the settings object. Needed to make sure the settings object was restored to it's original state each time.

New in Ajax Minifier 4.30 (Oct 6, 2011)

  • Pulled the command-line processing code into a separate class that can be used in the DLL version to set the CodeSettings object. Not all command-line options are supported by the DLL, however. Any switches having to do with file input/output (-out, -res, etc) is handled only by the EXE to preserve security sandboxing.
  • Treat the UNICODE Byte-Order Mark (BOM) as whitespace, as per spec. Also, the ZWNJ and ZWJ characters should be allowed as identifier parts.
  • Couple bug fixes.

New in Ajax Minifier 4.27 (Aug 24, 2011)

  • Fixed issue #16429 - significant parentheses being stripped around new-operator constructor-expressions.
  • Continue throwing an error if a keyword is used as a variable name, but don't barf on the output.
  • Make the "ignore error codes" feature case-INsensitive ("JS1021" or "js1021")
  • Remove unnecessary parentheses around literal targets of [] and () operators.

New in Ajax Minifier 4.26 (Jul 27, 2011)

  • Fix an issue where object literals using keywords as property names (not strictly valid JavaScript, but it works in some browsers) caused problems. Now will still generate an error, but will produce valid output. Also added ability to suppress given errors codes. So for instance, if you wanted to suppress the error thrown by using keywords for property names in object literals, you can add -ignore:JS1028 to your command-line. The error code list is comma-separated (eg: -ignore:JS1028,JS1284). Also provide IgnoreErrorList property to CodeSettings so users of the DLL can also specify error codes to ignore.

New in Ajax Minifier 4.24 (Jul 6, 2011)

  • Fixed issue #16216 - ajaxmin throws exception when it can't tell whether the input is JS or CSS.

New in Ajax Minifier 4.20 (May 12, 2011)

  • Fixed issue #15852 - adding spaces between simple selectors where no spaces should be.
  • Fixed issue where trailing comma was being removed from item list in array literal.
  • Fixed issue where trailing comma in object literal list was causing error to be thrown incorrectly.
  • Added a common ContextError object to the CSS and JS parser event arguments to simplify error handling.
  • Refactored AST nodes to only have one class with yield statements, thereby reducing executable size.

New in Ajax Minifier 4.19 (May 5, 2011)

  • Made the JavaScript preprocessor be case-insensitive with its identifiers.
  • Bumped some "errors" down to warning status, as they aren't actual errors in the code but rather things developers should avoid doing.
  • The build task (and the MSI) now requires only .NET 3.5 (down from .NET 4), so it will work in Visual Studio 2008.
  • Fixed the error-handling of the build task. Errors are errors, and warnings are warnings; errors will fail the build.
  • Added TreatWarningsAsErrors property on the build task object, in case developer wants to fail the build on any warnings.
  • Error messages generated by the build task are formatted such that double-clicking on them in the Error List window will open the appropriate file and set the caret at the proper line and column position.

New in Ajax Minifier 4.15 (Mar 19, 2011)

  • Fixed issues with the duplicate-literal combination logic (-literals:combine).
  • Also fixed bogus "already defined" warnings when moving var-statement(s) into the initializer of a following for-statement.