6.0.0-beta1
8/6/25

[#14650] Javascript compression broken with closure-compiler v20170521
Summary Javascript compression broken with closure-compiler v20170521
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners
Requester arjen+horde (at) de-korte (dot) org
Created 05/24/2017 (2996 days ago)
Due
Updated 06/02/2017 (2987 days ago)
Assigned 05/26/2017 (2994 days ago)
Resolved 06/02/2017 (2987 days ago)
Github Issue Link
Github Pull Request
Milestone Horde_Core 2.29.1
Patch No

History
06/02/2017 08:17:59 AM Jan Schneider Comment #15 Reply to this comment
Thanks!
06/02/2017 08:17:50 AM Jan Schneider State ⇒ Resolved
Milestone ⇒ Horde_Core 2.29.1
 
06/02/2017 08:17:10 AM Jan Schneider Version ⇒
Queue ⇒ Horde Framework Packages
 
06/02/2017 08:12:51 AM Git Commit Comment #14 Reply to this comment
Changes have been made in Git (master):

commit b8484ba90ed9054b463f89f1469bd1643dfc3887
Author: Jan Schneider <jan@horde.org>
Date:   Fri Jun 2 10:08:37 2017 +0200

     [jan] Fix JavaScript minifying with recent Closure compilers (Bug #14650).

  framework/Core/package.xml | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/b8484ba90ed9054b463f89f1469bd1643dfc3887
06/02/2017 08:12:50 AM Git Commit Comment #13 Reply to this comment
Changes have been made in Git (master):

commit 7a52bd166682280905394d48fe711e8337b6062d
Author: Jan Schneider <jan@horde.org>
Date:   Fri Jun 2 10:07:23 2017 +0200

     Fix encoding (Bug #14650).

  framework/Core/js/date/date.js | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

http://github.com/horde/horde/commit/7a52bd166682280905394d48fe711e8337b6062d
06/02/2017 08:12:49 AM Git Commit Comment #12 Reply to this comment
Changes have been made in Git (master):

commit 439b28b60813d3f01e20fbe7e2a22f69ece550ab
Author: Jan Schneider <jan@horde.org>
Date:   Fri Jun 2 10:06:59 2017 +0200

     Fix duplicate key warning from Closure (Bug #14650).

  framework/Core/js/scriptaculous/effects.js | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

http://github.com/horde/horde/commit/439b28b60813d3f01e20fbe7e2a22f69ece550ab
06/02/2017 07:46:43 AM arjen+horde (at) de-korte (dot) org Comment #11
New Attachment: effects.js.patch Download
Reply to this comment
Fix for ERROR - Object literal contains illegal duplicate key 
"scaleMode", disallowed in strict mode

06/02/2017 07:44:46 AM arjen+horde (at) de-korte (dot) org Comment #10
New Attachment: date.js.patch Download
Reply to this comment
Fix for non-ASCII, non-UTF-8 characters in date/js/date.js
05/31/2017 09:28:43 PM arjen+horde (at) de-korte (dot) org Comment #9
New Attachment: horde-debug.log Download
Reply to this comment
Aaaaand ... see attached log. It turns out the new compiler is still 
not happy after all.

05/31/2017 09:09:58 PM arjen+horde (at) de-korte (dot) org Comment #8 Reply to this comment
Finally found the culprit. It chokes on a weird character in line 347 
of /horde/js/date/date.js. If I change 'Claus T?ndering' to 'Claus 
Tøndering', the file displays fine and makes the Closure Compiler 
happy again as well. So I guess it is just the weird character name in 
this comment line that is the problem.
05/31/2017 08:36:51 PM arjen+horde (at) de-korte (dot) org Comment #7 Reply to this comment
Nope, I don't use SElinux. No mention of this file in the audit.log 
(or any other log file either, except the horde.log). It's driving me 
nuts that I can't find out what is happening here.

05/31/2017 07:55:13 PM Jan Schneider Comment #6
State ⇒ Not A Bug
Reply to this comment
SELinux? Try ls -Z
05/31/2017 07:36:06 PM arjen+horde (at) de-korte (dot) org Comment #5 Reply to this comment
Replying to myself, I'm out of ideas. Looking at the file permissions, 
I see the following:

# ll /srv/www/htdocs/horde/js/date/{date,time}.js
-rw-r--r-- 1 root root 85569 30 mei 22:57 
/srv/www/htdocs/horde/js/date/date.js
-rw-r--r-- 1 root root  8675 30 mei 22:57 
/srv/www/htdocs/horde/js/date/time.js

According to this, both should be readable by the wwwrun user. 
However, when I attempt to 'cat' both files in the 
/horde/admin/cmdshell.php, the output of the first is empty (no 
output) and the latter will show the contents of the time.js file. 
What?!
05/30/2017 09:37:16 PM arjen+horde (at) de-korte (dot) org Comment #4
New Attachment: horde.log Download
Reply to this comment
See attached log. It looks like it indeed trips over 
/srv/www/htdocs/horde/js/date/date.js. Which is somewhat weird, since 
the file is world readable (including all directories leading up to 
it). Even stranger, the previous version of the Google Closure 
Compiler didn't have any problem with the same file (and same 
permissions).
05/26/2017 03:30:16 PM Jan Schneider Comment #3
State ⇒ Feedback
Reply to this comment
There is no general problem with that version, as you can test 
yourself with the unit test. There may be some problem in a certain JS 
file that Closure is tripping over though. You need to take a look at 
the logs to find out.
05/26/2017 03:28:49 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 3154844e43ab4ad2910d390f4af52fb7ffe43c6f
Author: Jan Schneider <jan@horde.org>
Date:   Fri May 26 17:24:06 2017 +0200

     Add test suite (Bug #14650).

  framework/JavascriptMinify/package.xml             |  34 ++++++-
  .../test/Horde/JavascriptMinify/AllTests.php       |   3 +
  .../test/Horde/JavascriptMinify/ClosureTest.php    |  67 ++++++++++++++
  .../test/Horde/JavascriptMinify/NullTest.php       |  37 ++++++++
  .../test/Horde/JavascriptMinify/TestBase.php       | 100 
+++++++++++++++++++++
  .../test/Horde/JavascriptMinify/UglifyjsTest.php   |  67 ++++++++++++++
  .../test/Horde/JavascriptMinify/YuiTest.php        |  59 ++++++++++++
  .../test/Horde/JavascriptMinify/bootstrap.php      |   3 +
  .../test/Horde/JavascriptMinify/conf.php.dist      |   6 ++
  .../test/Horde/JavascriptMinify/fixtures/one.js    |  17 ++++
  .../test/Horde/JavascriptMinify/fixtures/two.js    |  47 ++++++++++
  .../test/Horde/JavascriptMinify/phpunit.xml        |   1 +
  12 files changed, 439 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/3154844e43ab4ad2910d390f4af52fb7ffe43c6f
05/24/2017 12:11:24 PM arjen+horde (at) de-korte (dot) org Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Javascript compression broken with closure-compiler v20170521
Type ⇒ Bug
Queue ⇒ Horde Base
Reply to this comment
With the latest version (v20170521) of the Google closure compiler, 
the compressed *.js files are all empty. The previous version 
(v20170423) worked correctly.

Saved Queries