Issues

Issue #12 resolved

End the file with a semicolon

A. Jesse Jiryu Davis
created an issue

Hi, I had to append a semicolon to the file in order to handle cases where the file is combined with other Javascript files and the whole is minified (which is common in big web apps). The problem is that detect_timezone.js ends like:

{{{

!javascript

jzTimezoneDetector.olson.ambiguity_list = { 'America/Denver' : ['America/Denver','America/Mazatlan'], // etc ... } }}}

the next file in the combined Javascript may start like:

{{{

!javascript

(function() { / code here ... / })(); }}}

So the browser thinks I'm invoking jzTimezoneDetector.olson.ambiguity_list as a function, since it's followed by an open parenthesis.

Putting a semicolon at the end of the file fixes the error.

Comments (2)

  1. Log in to comment