-
Hi,
I am trying to use Google Closure to minify to see if I can get a smaller pack of all languages. But I have this error:
$ java -jar ~/var/src/google-closure/compiler.jar --js highlight.js --js languages/mel.js --js languages/dos.js --js languages/1c.js --js languages/avrasm.js --js languages/python.js --js languages/delphi.js --js languages/scala.js --js languages/sql.js --js languages/cs.js --js languages/css.js --js languages/django.js --js languages/javascript.js --js languages/parser3.js --js languages/perl.js --js languages/cpp.js --js languages/ruby.js --js languages/html-xml.js --js languages/lisp.js --js languages/apache.js --js languages/bash.js --js languages/profile.js --js languages/vbscript.js --js languages/renderman.js --js languages/ini.js --js languages/java.js --js languages/php.js --js languages/axapta.js --js languages/smalltalk.js --js languages/diff.js --js_output_file=highlight.pack.min.js languages/python.js:31: ERROR - Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all. contains: ['title', 'params',], ^ 1 error(s), 0 warning(s)I usually don't care about IE but I wouldn't code with the trailing commas even I do Python and since it's not a valid syntax, I think it should be fixed.
If you don't have time, I can do it for you. Your highlight.js is too important for me. :)
-
Oh, thanks! Those nasty commas always crop up from time to time... Fixed on trunk.
-
There is another comma in ruby.js:147. It's the last one.
The result from Google Closure wasn't good enough. 99K using default options, 91K using
ADVANCED_OPTIMIZATIONS, still larger than yuicompressor's 89K. And didn't work if I have all languages packed (I tried only python it works), could be Google Closure's problem, don't know. -
Missed one nginx.js:8.
-
Fixed both, thanks. Do you know any handy tools to check for those routinely?
-
JavaScript Lint? (jslint)
Or just use Google Closure?
PS. The larger size is because 1c.js. GC would convert it to ASCII. So a lot of \uxxxx. It's actually almost same size as YUI compressor's result. If advanced optimizations could work, it would be even smaller (around 76K without 1c.js). GC reported some warnings about highlight.js, I didn't know if that's cause. -
OK I'll look into Google Closure when I will wrap up a new version.
Внимание! Это довольно старый топик, посты в него не попадут в новые, и их никто не увидит. Пишите пост, если хотите просто дополнить топик, а чтобы задать новый вопрос — начните новый.
