1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-27 14:48:19 +00:00

Improve compatibility with JS modules

If a module ended with a single line comment `\\` then the appended
`;})();` was being ignored and eaten up as part of the comment.
This commit is contained in:
Jermolene 2014-11-23 15:24:01 +00:00
parent 4134392841
commit a614c0d543

View File

@ -413,7 +413,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
contextValues.push(value);
});
// Add the code prologue and epilogue
code = "(function(" + contextNames.join(",") + ") {(function(){\n" + code + ";})();\nreturn exports;\n})\n";
code = "(function(" + contextNames.join(",") + ") {(function(){\n" + code + "\n;})();\nreturn exports;\n})\n";
// Compile the code into a function
var fn;
if($tw.browser) {