fix asynchronous state tracking in `ufuzz` (#4369)
authorAlex Lam S.L <alexlamsl@gmail.com>
Fri, 11 Dec 2020 21:19:56 +0000 (21:19 +0000)
committerGitHub <noreply@github.com>
Fri, 11 Dec 2020 21:19:56 +0000 (05:19 +0800)
test/ufuzz/index.js

index 93d4618..0b16a59 100644 (file)
@@ -516,10 +516,13 @@ function createAssignmentPairs(recurmax, noComma, stmtDepth, canThrow, varNames,
                     var key = index in keys ? keys[index] : rng(10) && createKey(recurmax, keys);
                     return key ? key + ": " + name : name;
                 }).join(", ")) + " }");
+                var save_async = async;
+                if (was_async != null) async = was_async;
                 values.unshift("{ " + addTrailingComma(pairs.values.map(function(value, index) {
                     var key = index in keys ? keys[index] : createKey(recurmax, keys);
                     return key + ": " + value;
                 }).join(", ")) + " }");
+                async = save_async;
             }
             break;
           default: