From aa3f647656ce46469d20bd477b600ca09bc3f964 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 27 Mar 2017 21:49:08 +0800 Subject: [PATCH] ufuzz: workaround for Function.toString() v2 (#1700) --- test/ufuzz.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 = ""; -- 2.34.1