reduce false positives from labels (#2934)

This commit is contained in:
Alex Lam S.L
2018-02-19 03:55:33 +08:00
committed by GitHub
parent 4facd94029
commit 2905fd625a

View File

@@ -42,7 +42,7 @@ var FUNC_TOSTRING = [
" }", " }",
" var body = toString.call(this);", " var body = toString.call(this);",
' body = body.slice(body.indexOf("{") + 1, -1);', ' 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 = "";', ' body = "";',
" } else {", " } else {",
' body = n + "' + function() { ' body = n + "' + function() {