// FIXME: Have some sort of internally-cacheable way to find nodes of a certain type? So that different optimizer visitors don't need to filter the list of clauses over and over again...
functionleftIdentity(left){
// NOTE: This uses JSON.stringify, since that gives us fast escaping for free; which is important to prevent bugs and/or injection-related security issues in the serialized names
// Both the left identity and conditionType match, so this can be turned into an array
hasSeenPossibleArray=true;
}
// We store the entire original expression object, so that the new-node-generation code can pick out the expression metadata later. Since everything is grouped by identity and condition type, that code can just assume that the metadata of the first item in the list (if there's more than one) applies to *all* of the items in that list.
// FIXME: Improve matchValue to distinguish between "arm not specified at all" and "arm holds undefined as a specified value", to deal with things like accidental operations.anyOfExpressions
letexpressionOperation=matchValue.literal(type,{
"anyOfExpressions":operations.anyOf,
"allOfExpressions":operations.allOf
});
letinternalArrayType=matchValue(type,{
"anyOfExpressions":"anyOf",
"allOfExpressions":"allOf"
});
returnfunctionarrayifyPredicateList(node){
// FIXME: Also detect non-parameterizable cases like raw SQL!
lettracker=createExpressionTracker();
for(letitemofnode.items){
// Only regular expressions can be arrayified, not {all,any}OfExpressions, which will get visited by this optimizer later on anyway