mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-01 08:03:00 +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:
@@ -413,7 +413,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
|
|||||||
contextValues.push(value);
|
contextValues.push(value);
|
||||||
});
|
});
|
||||||
// Add the code prologue and epilogue
|
// 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
|
// Compile the code into a function
|
||||||
var fn;
|
var fn;
|
||||||
if($tw.browser) {
|
if($tw.browser) {
|
||||||
|
|||||||
Reference in New Issue
Block a user