From a614c0d543c175d090905ce77fa7a69e8fbd9f0c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 23 Nov 2014 15:24:01 +0000 Subject: [PATCH] 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. --- boot/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 7110f9ce8..21a48458f 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -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) {