From: Alex Lam S.L Date: Sun, 18 Feb 2018 19:55:33 +0000 (+0800) Subject: reduce false positives from labels (#2934) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2905fd625aa35eda0283dea25d3f5133f052d4db;p=UglifyJS.git reduce false positives from labels (#2934) --- diff --git a/test/sandbox.js b/test/sandbox.js index 2c2c21a8..d8238668 100644 --- a/test/sandbox.js +++ b/test/sandbox.js @@ -42,7 +42,7 @@ var FUNC_TOSTRING = [ " }", " var body = toString.call(this);", ' body = body.slice(body.indexOf("{") + 1, -1);', - ' if (/^(?:\\s|\\{|\\}|;|[0-9\\.]+|"[^"]*"|var [^=;]+|\\/\\/.*|\\/\\*[\\s\\S]*\\*\\/)*(?:$|return(?:;|\\n))/.test(body)) {', + ' if (/^(?:\\s|\\{|\\}|;|[0-9\\.]+|"[^"]*"|\\w+:|var [^=;]+|\\/\\/.*|\\/\\*[\\s\\S]*\\*\\/)*(?:$|return(?:;|\\n))/.test(body)) {', ' body = "";', " } else {", ' body = n + "' + function() {