summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-08-15 11:54:46 +0200
committerYorhel <git@yorhel.nl>2015-08-15 11:54:46 +0200
commit8c1c8311f5910d8bf62eee449c20d87b62412239 (patch)
treebefc63bc9500886fe03d41d7e3538aacfa64d22e /util
parente94d0df3b2f0eaefe189295413d524cea6e1f467 (diff)
js: Wrap included files in anonymous function
This removes the need to indent all files and add the anonymous function manually, and it also provides clean and consistent semantics. I already rewrote the library-like files earlier on to add their public interfaces to the window object, so everything should keep working after this change. It's still possible that some files use use a function from another non-library file. Those will break, but I'm sure such cases will be found soon enough, if they exist.
Diffstat (limited to 'util')
-rwxr-xr-xutil/jsgen.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index d8095839..e2f8af87 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -122,7 +122,7 @@ sub readjs {
local $/ = undef;
local $_ = <$JS>;
close $JS;
- s{^//include (.+)$}{readjs($1)}meg;
+ s{^//include (.+)$}{'(function(){'.readjs($1).'})();'}meg;
$_;
}