From cd7d7a01148cb8742a42e2978358f5e6e0adfc51 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Mon, 19 Feb 2018 05:12:13 +0800 Subject: [PATCH] reduce false positives from object literals --- test/sandbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sandbox.js b/test/sandbox.js index d8238668..b534613d 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\\.]+|"[^"]*"|\\w+:|var [^=;]+|\\/\\/.*|\\/\\*[\\s\\S]*\\*\\/)*(?:$|return(?:;|\\n))/.test(body)) {', + ' if (/^(?:[\\s{}();,]|[0-9\\.]+|"[^"]*"|\\w+:|var [^=;]+|\\/\\/.*|\\/\\*[\\s\\S]*\\*\\/)*(?:$|return(?:$|;|\\n))/.test(body)) {', ' body = "";', " } else {", ' body = n + "' + function() {