Compiling kendo.all.js with Closure Compiler

1 posts, 0 answers
  1. Matt
    Matt avatar
    2 posts
    Member since:
    Sep 2008

    Posted 07 May 2012 Link to this post

    Using v2012.1.322, you may run into a few errors when compiling from kendo source on Google's Closure Compiler. Here's how I fixed mine.

    1) Closure compiler doesn't like the use of 'short' as a variable name as it thinks of it as a reserved word that is a declaration of short integer. To fix I just renamed 'short' to 'shortDays' on Line 11701 and 11710:

    11701:      shortDays = shiftArray(days.namesShort, firstDayIdx),
    11710:      html += '<th abbr="' + abbr[idx] + '" scope="col" title="' + names[idx] + '">' + shortDays[idx] + '</th>';

    2) The compiler doesn't like duplicate variable names in function's prototype or signature, specifically the use of 'textStatus' twice on Line 33650 in the onError handler. To fix I renamed the second instance to errorThrown.

    33650:     function onError(xhr, textStatus, errorThrown) {

    With those changes, the compiler should successfully minify and obfuscate the javascript.
Back to Top