From 5a5eec510bceb3509c099927fb2f1d93e9681be5 Mon Sep 17 00:00:00 2001 From: Golmote Date: Sat, 5 Sep 2015 17:14:03 +0200 Subject: [PATCH] Download page: don't add semicolon unless needed in generated code. Fix #273 --- download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.js b/download.js index e56e58710c..1a1da4007e 100644 --- a/download.js +++ b/download.js @@ -448,7 +448,7 @@ function buildCode(promises) { if(i < l) { var p = promises[i]; p.contentsPromise.then(function(contents) { - code[p.type] += contents + (p.type === 'js'? ';' : '') + '\n'; + code[p.type] += contents + (p.type === 'js' && !/;\s*$/.test(contents) ? ';' : '') + '\n'; i++; f(resolve); });