aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-12 20:29:39 +0000
committerGitHub <noreply@github.com>2021-01-13 04:29:39 +0800
commite84957e3dabeb676113da5d513cde07981bcfbaa (patch)
tree8a6633b9721cd24b4d5f4bcc7cfb972c59a04560
parentc11a7489085c5a9c6a2f82be0f3b356a5dffa5a9 (diff)
downloadtracifyjs-e84957e3dabeb676113da5d513cde07981bcfbaa.tar.gz
tracifyjs-e84957e3dabeb676113da5d513cde07981bcfbaa.zip
suppress invalid test generation in `ufuzz` (#4551)
-rw-r--r--test/ufuzz/index.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js
index edb98aa7..73e00efd 100644
--- a/test/ufuzz/index.js
+++ b/test/ufuzz/index.js
@@ -1485,18 +1485,26 @@ function _createSimpleBinaryExpr(recurmax, noComma, stmtDepth, canThrow) {
function createTypeofExpr(recurmax, stmtDepth, canThrow) {
switch (rng(8)) {
case 0:
- return "(typeof " + createVarName(MANDATORY, DONT_STORE) + ' === "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
+ return "(typeof " + createVar() + ' === "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
case 1:
- return "(typeof " + createVarName(MANDATORY, DONT_STORE) + ' !== "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
+ return "(typeof " + createVar() + ' !== "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
case 2:
- return "(typeof " + createVarName(MANDATORY, DONT_STORE) + ' == "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
+ return "(typeof " + createVar() + ' == "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
case 3:
- return "(typeof " + createVarName(MANDATORY, DONT_STORE) + ' != "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
+ return "(typeof " + createVar() + ' != "' + TYPEOF_OUTCOMES[rng(TYPEOF_OUTCOMES.length)] + '")';
case 4:
- return "(typeof " + createVarName(MANDATORY, DONT_STORE) + ")";
+ return "(typeof " + createVar() + ")";
default:
return "(typeof " + createExpression(recurmax, COMMA_OK, stmtDepth, canThrow) + ")";
}
+
+ function createVar() {
+ var save_async = async;
+ if (!async && avoid_vars.indexOf("await") >= 0) async = true;
+ var name = createVarName(MANDATORY, DONT_STORE);
+ async = save_async;
+ return name;
+ }
}
function createValue() {