Some build techniques simply concatenate scripts instead of transpiling etc. And there is no telling how the previous script ended (or not). I seem to remember this is done to mitigate some issues that can arise from poorly written scripts that come before this one.
It's for avoiding syntax issues, when you import multiple self-invoking functions.