improve destructuring generation in ufuzz (#4428)
This commit is contained in:
@@ -521,24 +521,28 @@ function createAssignmentPairs(recurmax, stmtDepth, canThrow, nameLenBefore, was
|
|||||||
keys[index] = key;
|
keys[index] = key;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (was_async) avoid.push("await");
|
|
||||||
addAvoidVars(avoid);
|
|
||||||
var save_async = async;
|
var save_async = async;
|
||||||
|
if (was_async != null) {
|
||||||
async = false;
|
async = false;
|
||||||
|
if (save_async || was_async) avoid.push("await");
|
||||||
|
}
|
||||||
|
addAvoidVars(avoid);
|
||||||
|
var save_vars = nameLenBefore && VAR_NAMES.splice(nameLenBefore);
|
||||||
names.unshift("{ " + addTrailingComma(pairs.names.map(function(name, index) {
|
names.unshift("{ " + addTrailingComma(pairs.names.map(function(name, index) {
|
||||||
var key = index in keys ? keys[index] : rng(10) && createKey(recurmax, keys);
|
var key = index in keys ? keys[index] : rng(10) && createKey(recurmax, keys);
|
||||||
return key ? key + ": " + name : name;
|
return key ? key + ": " + name : name;
|
||||||
}).join(", ")) + " }");
|
}).join(", ")) + " }");
|
||||||
if (was_async) removeAvoidVars([ avoid.pop() ]);
|
if (was_async != null) {
|
||||||
if (was_async != null) async = was_async;
|
async = was_async;
|
||||||
var save_vars = nameLenBefore && VAR_NAMES.splice(nameLenBefore);
|
if (save_async || was_async) removeAvoidVars([ avoid.pop() ]);
|
||||||
|
}
|
||||||
values.unshift("{ " + addTrailingComma(pairs.values.map(function(value, index) {
|
values.unshift("{ " + addTrailingComma(pairs.values.map(function(value, index) {
|
||||||
var key = index in keys ? keys[index] : createKey(recurmax, keys);
|
var key = index in keys ? keys[index] : createKey(recurmax, keys);
|
||||||
return key + ": " + value;
|
return key + ": " + value;
|
||||||
}).join(", ")) + " }");
|
}).join(", ")) + " }");
|
||||||
if (save_vars) [].push.apply(VAR_NAMES, save_vars);
|
if (save_vars) [].push.apply(VAR_NAMES, save_vars);
|
||||||
async = save_async;
|
|
||||||
removeAvoidVars(avoid);
|
removeAvoidVars(avoid);
|
||||||
|
async = save_async;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user