aboutsummaryrefslogtreecommitdiff
path: root/test/sandbox.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-19 06:21:07 +0800
committerGitHub <noreply@github.com>2018-02-19 06:21:07 +0800
commitb5f0f4f3a1eef7792e71938eff1433e24389b56c (patch)
tree3c9b450e4c43ea0b832afd518eba9de728871eb9 /test/sandbox.js
parent2905fd625aa35eda0283dea25d3f5133f052d4db (diff)
downloadtracifyjs-b5f0f4f3a1eef7792e71938eff1433e24389b56c.tar.gz
tracifyjs-b5f0f4f3a1eef7792e71938eff1433e24389b56c.zip
reduce false positives from object literals (#2935)
Diffstat (limited to 'test/sandbox.js')
-rw-r--r--test/sandbox.js2
1 files changed, 1 insertions, 1 deletions
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() {