In several JavaScript libraries I saw this notation at the very beginning:
/**
* Library XYZ
*/
;(function () {
// ... and so on
While
The best answer was actually given in the question, so I will just write that down here for clarity:
The leading ; in front of immediately-invoked function expressions is there to prevent errors when appending the file during concatenation to a file containing an expression not properly terminated with a ;.
Best practice is to terminate your expressions with semicolons, but also use the leading semicolon as a safeguard.