diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-27 21:49:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 21:49:08 +0800 |
commit | aa3f647656ce46469d20bd477b600ca09bc3f964 (patch) | |
tree | b94314587801e5dc5b0f5d7e0ba53c4321df5b13 | |
parent | c526da59a1a9b1a1c5689cfdcc840b36850ed250 (diff) | |
download | tracifyjs-aa3f647656ce46469d20bd477b600ca09bc3f964.tar.gz tracifyjs-aa3f647656ce46469d20bd477b600ca09bc3f964.zip |
ufuzz: workaround for Function.toString() v2 (#1700)
-rw-r--r-- | test/ufuzz.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/ufuzz.js b/test/ufuzz.js index 491526d7..c1ac8f4c 100644 --- a/test/ufuzz.js +++ b/test/ufuzz.js @@ -121,7 +121,20 @@ var TYPEOF_OUTCOMES = [ 'symbol', 'crap' ]; -var FUNC_TOSTRING = 'Function.prototype.toString=function(){return"function(){}"};'; +var FUNC_TOSTRING = [ + "Function.prototype.toString = function() {", + " var ids = [];", + " return function() {", + " var i = ids.indexOf(this);", + " if (i < 0) {", + " i = ids.length;", + " ids.push(this);", + " }", + ' return "[Function: __func_" + i + "__]";', + " }", + "}();", + "" +].join("\n"); function run_code(code) { var stdout = ""; |