aboutsummaryrefslogtreecommitdiff
path: root/test/ufuzz
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-04-05 15:12:46 +0100
committerGitHub <noreply@github.com>2020-04-05 22:12:46 +0800
commit273c6020baa433e19404cadfd8311c7372bb03db (patch)
tree9e2858cd5ec0952714cb5ed7f4df3124d46de887 /test/ufuzz
parent1b07f640573494d1f8625f8926868caeaeaaaa9e (diff)
downloadtracifyjs-273c6020baa433e19404cadfd8311c7372bb03db.tar.gz
tracifyjs-273c6020baa433e19404cadfd8311c7372bb03db.zip
expand `ufuzz` patterns (#3761)
Diffstat (limited to 'test/ufuzz')
-rw-r--r--test/ufuzz/index.js7
1 files changed, 6 insertions, 1 deletions
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) + ")";