Skip to content Skip to sidebar Skip to footer

Can't Minify With Combres And Yui

I am not sure how to find out more about whats wrong with my .js file, but if I turn 'defaultDebugEnaled = true' then it works fine, but putting it to false makes me get this error

Solution 1:

"Missing formal parameter" means that a function definition is missing a parameter. For example

/**
 * @param x ...
 * @param y ...
 */
function f(x) {  // Only one formal parameter.
  ...
}

f(1, 2);  // Called with 2 actual parameters.

the function f is missing a formal parameter y.

EDIT:

https://github.com/wycats/handlebars.js/issues/93 discusses a similar issue and suggests the problem is that YUI compressor treats certain JS identifiers (incorrectly) as reserved words and issues this error when a reserved word is used as a formal parameter

$ java -jar lib/closurecompiler.jar --js js/handlebars.1.0.0.beta.3.js 
js/handlebars.1.0.0.beta.3.js:667: ERROR - Parse error. missing formal parameter
Handlebars.AST.BooleanNode = function(boolean) {

I have a version that seems to be working in my fork. Main change was to remove reserved word with s/boolean/bool/g Also linted the input .js files for consistency.


Solution 2:

This error can also appear when using parametres like this:

function functionName( markers, boolean )

In this case boolean will cause the error.


Solution 3:

I had this same problem yesterday (which turned out to be 'long' used a parameter - i just renamed to longitude) - and the best approach for me was to feed the JS manually to these two tools: http://www.javascriptlint.com/online_lint.php and an online YUI compressor http://refresh-sf.com/yui/

between the two it was easy to find the errors and verify that it would compress.


Post a Comment for "Can't Minify With Combres And Yui"