From 273c6020baa433e19404cadfd8311c7372bb03db Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 5 Apr 2020 15:12:46 +0100 Subject: expand `ufuzz` patterns (#3761) --- test/ufuzz/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/ufuzz') diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index 76a782ef..24bf86d1 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -704,7 +704,6 @@ function _createExpression(recurmax, noComma, stmtDepth, canThrow) { break; } VAR_NAMES.length = nameLenBefore; - if (canThrow && rng(8) == 0 && !/^new /.test(s[0])) s[s.length - 1] += "()"; return filterDirective(s).join("\n"); case p++: case p++: @@ -773,6 +772,12 @@ function _createExpression(recurmax, noComma, stmtDepth, canThrow) { case p++: case p++: case p++: + if (rng(16) == 0) { + var name = getVarName(); + var fn = name + "." + getDotKey(); + called[name] = true; + return name + " && " + "typeof " + fn + ' == "function" && --_calls_ >= 0 && ' + fn + "(" + createArgs(recurmax, stmtDepth, canThrow) + ")"; + } var name = rng(3) == 0 ? getVarName() : "f" + rng(funcs + 2); called[name] = true; return "typeof " + name + ' == "function" && --_calls_ >= 0 && ' + name + "(" + createArgs(recurmax, stmtDepth, canThrow) + ")"; -- cgit v1.2.3