reduce false positives from `function.toString()` (#2928)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sat, 17 Feb 2018 18:13:26 +0000 (02:13 +0800)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2018 18:13:26 +0000 (02:13 +0800)
test/sandbox.js

index 80cbc3b..c477a8a 100644 (file)
@@ -39,7 +39,11 @@ var FUNC_TOSTRING = [
     "            });",
 ] : [], [
     "        }",
-    '        return "function " + n + "() {...}";',
+    '        return "function " + n + "() {' + function() {
+        var s = "\7";
+        for (var i = 10; --i >= 0;) s += s;
+        return s;
+    }() + '}";',
     "    }",
     "}();",
 ]).join("\n");