aboutsummaryrefslogtreecommitdiff
path: root/test/sandbox.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-17 04:35:03 +0800
committerGitHub <noreply@github.com>2018-02-17 04:35:03 +0800
commite529f54e90c2ff63f043333c50e6c96f6b3c7e6d (patch)
treee0039fafeae27837b5194f18aeeb7871a3571615 /test/sandbox.js
parentd626e9bf19108177aba438ce81649af9f373bac0 (diff)
downloadtracifyjs-e529f54e90c2ff63f043333c50e6c96f6b3c7e6d.tar.gz
tracifyjs-e529f54e90c2ff63f043333c50e6c96f6b3c7e6d.zip
reduce `function`-related false positives (#2925)
Diffstat (limited to 'test/sandbox.js')
-rw-r--r--test/sandbox.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/sandbox.js b/test/sandbox.js
index c660353c..80cbc3bf 100644
--- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -24,9 +24,8 @@ function strip_func_ids(text) {
var FUNC_TOSTRING = [
"[ Array, Boolean, Error, Function, Number, Object, RegExp, String].forEach(function(f) {",
" f.toString = Function.prototype.toString;",
- " f.valueOf = Function.prototype.valueOf;",
"});",
- "Function.prototype.toString = Function.prototype.valueOf = function() {",
+ "Function.prototype.toString = function() {",
" var id = 100000;",
" return function() {",
" var n = this.name;",
@@ -40,10 +39,9 @@ var FUNC_TOSTRING = [
" });",
] : [], [
" }",
- ' return "[Function: " + n + "]";',
+ ' return "function " + n + "() {...}";',
" }",
"}();",
- 'Object.defineProperty(Function.prototype, "valueOf", { enumerable: false });',
]).join("\n");
exports.run_code = function(code) {
var stdout = "";