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.
print-window-tiddler
Jermolene 2014-11-23 15:24:01 +00:00
rodzic 4134392841
commit a614c0d543
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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) {