When merging JavaScript files, drupal_build_js_cache separates files with a semicolon. However, this is not always sufficient, particularly in the case that one or more javascript files do not have trailing newlines. For example, if the following two JavaScript files are concatenated, there will be an error processing the result:

--File One--
...
//last line of file has a comment, and there is no trailing newline

--File Two--
/* File starts off with a multiline comment
...

The result is that the first line of file two will be appended to the last line of file one, and the /* comment start will be missed, causing likely parse errors afterwards.

Patch to follow.

Comments

jbafford’s picture

Status: Active » Needs review
StatusFileSize
new843 bytes
new893 bytes
c960657’s picture

Status: Needs review » Reviewed & tested by the community

True. It will also make the aggregated files slightly easier to read.

dries’s picture

Version: 7.x-dev » 6.x-dev

Committed to CVS HEAD. Thanks.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.