BarryCarlyon / minify

Automatically exported from code.google.com/p/minify (personal copy)
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

JSMin fails when line begins with division operator #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.4 beta
PHP version: 5.3.3

What steps will reproduce the problem?
1. Try to minify a file that has a slash at the start of it (e.g., a math 
equation that spans multiple lines).  For example, see lines 114 and 116 in 
http://dev.openlayers.org/releases/OpenLayers-2.10/lib/OpenLayers/Layer/XYZ.js
2.
3.

Expected output:  Minified JavaScript Code

Actual output: '500 Internal Server Error' response from Minify

Did any unit tests FAIL? no

Please provide any additional information below. If this has to do with URI
rewriting, please include your DOCUMENT_ROOT, the

Original issue reported on code.google.com by mgl....@gmail.com on 10 Nov 2010 at 11:02

GoogleCodeExporter commented 9 years ago
Did you turn on Firephp logging and verify it's an exception in JSMin?
http://code.google.com/p/minify/wiki/Debugging#400_Bad_Request_errors

Original comment by mrclay....@gmail.com on 11 Nov 2010 at 12:42

GoogleCodeExporter commented 9 years ago
Here's what I get from the logs in FirePHP:

Minify: Exception in /var/www/min/XYZ.js: JSMin: Unterminated RegExp at byte 
3705: / (res * this.tileSize.w)); 

It's not a major problem, obviously, as I can just modify the file to not have 
lines that begin with a slash.

Original comment by mgl....@gmail.com on 11 Nov 2010 at 4:41

GoogleCodeExporter commented 9 years ago
FWIW JSLint complains about it: "Bad line breaking before '/'." but I don't if 
that's influenced by the spec or Crockford's preferences.

Original comment by mrclay....@gmail.com on 11 Nov 2010 at 6:16