This is a migrated thread and some comments may be shown as answers.

Compiling kendo.all.js with Closure Compiler

0 Answers 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 2
Matt asked on 07 May 2012, 07:27 PM
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.

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Matt
Top achievements
Rank 2
Share this question
or