diff --git a/src/asl/asl-graph.ts b/src/asl/asl-graph.ts index e38c8745..47729eb4 100644 --- a/src/asl/asl-graph.ts +++ b/src/asl/asl-graph.ts @@ -2,7 +2,8 @@ import { assertNever } from "../assert"; import { SynthError, ErrorCodes } from "../error-code"; import type { Expr } from "../expression"; import { FunctionlessNode } from "../node"; -import { anyOf, invertBinaryOperator } from "../util"; +import { anyOf, formatJsonPath, invertBinaryOperator } from "../util"; +import { ASLOptimizer } from "./optimizer"; import { isState, isChoiceState, @@ -31,6 +32,15 @@ import { ASL } from "./synth"; * ASL Graph is completely stateless. */ export namespace ASLGraph { + export interface ASLOptions { + /** + * Options for the ASL Optimizer. + * + * Default: Suggested + */ + optimization?: ASLOptimizer.OptimizeOptions; + } + /** * Used by integrations as a placeholder for the "Next" property of a task. * @@ -523,30 +533,15 @@ export namespace ASLGraph { getStateNames: ( parentName: string, states: ASLGraph.SubState - ) => Record + ) => Record, + options?: ASLOptions ): States { const namedStates = internal(startState, states, { localNames: {} }); - /** - * Find any choice states that can be joined with their target state. - * TODO: generalize the optimization statements. - */ - const updatedStates = joinChainedChoices( + return ASLOptimizer.optimizeGraph( startState, - /** - * Remove any states with no effect (Pass, generally) - * The incoming states to the empty states are re-wired to the outgoing transition of the empty state. - */ - removeEmptyStates(startState, namedStates) - ); - - const reachableStates = findReachableStates(startState, updatedStates); - - // only take the reachable states - return Object.fromEntries( - Object.entries(updatedStates).filter(([name]) => - reachableStates.has(name) - ) + Object.fromEntries(namedStates), + options?.optimization ); function internal( @@ -585,243 +580,6 @@ export namespace ASLGraph { } } - /** - * Given a directed adjacency matrix, return a `Set` of all reachable states from the start state. - */ - function findReachableStates( - startState: string, - states: Record - ) { - const visited = new Set(); - - // starting from the start state, find all reachable states - depthFirst(startState); - - return visited; - - function depthFirst(stateName: string) { - if (visited.has(stateName)) return; - visited.add(stateName); - const state = states[stateName]!; - visitTransition(state, depthFirst); - } - } - - function removeEmptyStates( - startState: string, - stateEntries: [string, State][] - ): [string, State][] { - /** - * Find all {@link Pass} states that do not do anything. - */ - const emptyStates = Object.fromEntries( - stateEntries.filter((entry): entry is [string, Pass] => { - const [name, state] = entry; - return ( - name !== startState && - isPassState(state) && - !!state.Next && - !( - state.End || - state.InputPath || - state.OutputPath || - state.Parameters || - state.Result || - state.ResultPath - ) - ); - }) - ); - - const emptyTransitions = computeEmptyStateToUpdatedTransition(emptyStates); - - // return the updated set of name to state. - return stateEntries.flatMap(([name, state]) => { - if (name in emptyTransitions) { - return []; - } - - return [ - [ - name, - visitTransition(state, (transition) => - transition in emptyTransitions - ? emptyTransitions[transition]! - : transition - ), - ], - ]; - }); - - /** - * Find the updated next value for all of the empty states. - * If the updated Next cannot be determined, do not remove the state. - */ - function computeEmptyStateToUpdatedTransition( - emptyStates: Record - ) { - return Object.fromEntries( - Object.entries(emptyStates).flatMap(([name, { Next }]) => { - const newNext = Next ? getNext(Next, []) : Next; - - /** - * If the updated Next value for this state cannot be determined, - * do not remove the state. - * - * This can because the state has no Next value (Functionless bug) - * or because all of the states in a cycle are empty. - */ - if (!newNext) { - return []; - } - - return [[name, newNext]]; - - /** - * When all states in a cycle are empty, the cycle will be impossible to exit. - * - * Note: This should be a rare case and is not an attempt to find any non-terminating logic. - * ex: `for(;;){}` - * Adding most conditions, incrementors, or bodies will not run into this issue. - * - * ```ts - * { - * 1: { Type: "???", Next: 2 }, - * 2: { Type: "Pass", Next: 3 }, - * 3: { Type: "Pass", Next: 4 }, - * 4: { Type: "Pass", Next: 2 } - * } - * ``` - * - * State 1 is any state that transitions to state 2. - * State 2 transitions to empty state 3 - * State 3 transitions to empty state 4 - * State 4 transitions back to empty state 2. - * - * Empty Pass states provide no value and will be removed. - * Empty Pass states can never fail and no factor can change where it goes. - * - * This is not an issue for other states which may fail or inject other logic to change the next state. - * Even the Wait stat could be used in an infinite loop if the machine is terminated from external source. - * - * If this happens, return undefined. - */ - function getNext( - transition: string, - seen: string[] = [] - ): string | undefined { - if (seen?.includes(transition)) { - return undefined; - } - return transition in emptyStates - ? getNext( - emptyStates[transition]!.Next!, - seen ? [...seen, transition] : [transition] - ) - : transition; - } - }) - ); - } - } - - /** - * A {@link Choice} state that points to another {@link Choice} state can adopt the target state's - * choices and Next without adding an additional transition. - * - * 1 - * if a -> 2 - * if b -> 3 - * else -> 4 - * 2 - * if c -> 3 - * else -> 4 - * 3 - Task - * 4 - * if e -> 5 - * else -> 6 - * 5 - Task - * 6 - Task - * - * => - * - * 1 - * if a && c -> 3 (1 and 2) - * if a && e -> 5 (1 and 4) - * if b -> 3 - * if e -> 5 (4) - * else -> 6 (4's else) - * 2 - remove (if nothing else points to it) - * 3 - Task - * 4 - remove (if nothing else points to it) - * 5 - Task - * 6 - Task - */ - function joinChainedChoices( - startState: string, - stateEntries: [string, State][] - ) { - const stateMap = Object.fromEntries(stateEntries); - - const updatedStates: Record = {}; - - depthFirst(startState); - - // we can assume that all null states have been updated by here. - return updatedStates as Record; - - function depthFirst(state: string): State | null { - if (state in updatedStates) return updatedStates[state]!; - const stateObj = stateMap[state]!; - if (!isChoiceState(stateObj)) { - updatedStates[state] = stateObj; - visitTransition(stateObj, (next) => { - depthFirst(next); - }); - // no change - return stateObj; - } - // set self to null to 1) halt circular references 2) avoid circular merges between choices. - // if #2 happens, that choice will always fail as state cannot change between transitions. - updatedStates[state] = null; - const branches = stateObj.Choices.flatMap((branch) => { - const { Next: branchNext, ...branchCondition } = branch; - const nextState = depthFirst(branchNext); - // next state should only by null when there is a circular reference between choices - if (!nextState || !isChoiceState(nextState)) { - return [branch]; - } else { - const nextBranches = nextState.Choices.map( - ({ Next, ...condition }) => { - // for each branch in the next state, AND with the current branch and assign the next state's Next. - return { ...ASL.and(branchCondition, condition), Next }; - } - ); - return nextState.Default - ? [...nextBranches, { ...branchCondition, Next: nextState.Default }] - : nextBranches; - } - }); - const defaultState = stateObj.Default - ? depthFirst(stateObj.Default) - : undefined; - - const [defaultValue, defaultBranches] = - !defaultState || !isChoiceState(defaultState) - ? [stateObj.Default, []] - : [defaultState.Default, defaultState.Choices]; - - const mergedChoice = { - ...stateObj, - Choices: [...branches, ...defaultBranches], - Default: defaultValue, - }; - - updatedStates[state] = mergedChoice; - return mergedChoice; - } - } - /** * Visit each transition in each state. * Use the callback to update the transition name. @@ -1593,7 +1351,7 @@ export namespace ASLGraph { element: ASLGraph.LiteralValue | ASLGraph.LiteralValue, targetJsonPath: ASLGraph.JsonPath ): Condition { - const accessed = ASLGraph.accessConstant(targetJsonPath, element, true); + const accessed = ASLGraph.accessConstant(targetJsonPath, element); if (ASLGraph.isLiteralValue(accessed)) { return accessed.value === undefined @@ -1610,15 +1368,10 @@ export namespace ASLGraph { */ export function accessConstant( value: ASLGraph.Output, - field: ASLGraph.LiteralValue | ASLGraph.LiteralValue, - element: boolean + field: ASLGraph.LiteralValue | ASLGraph.LiteralValue ): ASLGraph.JsonPath | ASLGraph.LiteralValue { if (ASLGraph.isJsonPath(value)) { - return ASLGraph.isLiteralNumber(field) - ? { jsonPath: `${value.jsonPath}[${field.value}]` } - : element - ? { jsonPath: `${value.jsonPath}['${field.value}']` } - : { jsonPath: `${value.jsonPath}.${field.value}` }; + return { jsonPath: formatJsonPath([field.value], value.jsonPath) }; } if (ASLGraph.isLiteralValue(value) && value.value) { diff --git a/src/asl/optimizer.ts b/src/asl/optimizer.ts new file mode 100644 index 00000000..7b310206 --- /dev/null +++ b/src/asl/optimizer.ts @@ -0,0 +1,1856 @@ +import { assertNever } from "../assert"; +import { + anyOf, + jsonPathStartsWith, + normalizeJsonPath, + formatJsonPath, + replaceJsonPathPrefix, + escapeRegExp, +} from "../util"; +import { + States, + isPassState, + isTaskState, + isMapTaskState, + isParallelTaskState, + isChoiceState, + isFailState, + isSucceedState, + isWaitState, + Catch, + State, + Parameters, + Condition, + Pass, +} from "./states"; +import { ASL, visitTransition } from "./synth"; + +/** + * Operations that can help "optimize" an ASL state machine. + */ +export namespace ASLOptimizer { + /** + * Traverses the graph and removes any nodes unreachable from the start state. + */ + export function removeUnreachableStates( + startState: string, + states: States + ): States { + const reachableStates = findReachableStates(startState, states); + + // only take the reachable states + return Object.fromEntries( + Object.entries(states).filter(([name]) => reachableStates.has(name)) + ); + } + + /** + * Given a directed adjacency matrix, return a `Set` of all reachable states from the start state. + */ + function findReachableStates( + startState: string, + states: Record + ) { + const visited = new Set(); + + // starting from the start state, find all reachable states + depthFirst(startState); + + return visited; + + function depthFirst(stateName: string) { + if (visited.has(stateName)) { + return; + } + visited.add(stateName); + const state = states[stateName]!; + visitTransition(state, depthFirst); + } + } + + /** + * Find all {@link Pass} states that do not do anything. + */ + function findEmptyStates(startState: string, states: States): string[] { + return Object.entries(states) + .filter((entry): entry is [string, Pass] => { + const [name, state] = entry; + return ( + name !== startState && + isPassState(state) && + !!state.Next && + !( + state.End || + state.InputPath || + state.OutputPath || + state.Parameters || + state.Result || + state.ResultPath + ) + ); + }) + .map(([name]) => name); + } + + /** + * A variable is assigned from one to another + */ + interface Assignment { + kind: "Assignment"; + from: string; + to: string; + } + + function isAssignment(usage: VariableUsage): usage is Assignment { + return usage.kind === "Assignment"; + } + + /** + * A variable is assigned to a property in a map. + */ + interface PropertyAssignment { + kind: "PropAssignment"; + from: string; + to: string; + props: string[]; + } + + function isPropertyAssignment( + usage: VariableUsage + ): usage is PropertyAssignment { + return usage.kind === "PropAssignment"; + } + + /** + * When a variable is used in an intrinsic function. + * Similar to {@link Assignment}, + * but highlights that this is not a 1:1 assignment. + * + * { + * "Parameters": { + * "string.$": "States.Array($.var1)" + * }, + * ResultPath: "$.var2" + * } + * => + * from: "$.var1" + * to: "$.var2" + */ + interface IntrinsicUsage { + kind: "Intrinsic"; + from: string; + props: string[]; + to: string; + } + + function isIntrinsicUsage(usage: VariableUsage): usage is IntrinsicUsage { + return usage.kind === "Intrinsic"; + } + + /** + * Variables found in a json path filter. + */ + interface FilterUsage { + kind: "Filter"; + from: string; + to: string; + } + + function isFilterUsage(usage: VariableUsage): usage is FilterUsage { + return usage.kind === "Filter"; + } + + /** + * Variables found in a json path filter in a parameters object. + */ + interface FilterPropAssignment { + kind: "FilterPropAssignment"; + from: string; + props: string[]; + to: string; + } + + function isFilterPropAssignment( + usage: VariableUsage + ): usage is FilterPropAssignment { + return usage.kind === "FilterPropAssignment"; + } + + /** + * A variable is the output of a opaque state. + * + * For example, the output of a task that invoked a lambda function. + */ + interface StateOutput { + kind: "StateOutput"; + stateType: "Map" | "Parallel" | "Catch" | "Task"; + to: string; + } + + function isStateOutput(usage: VariableUsage): usage is StateOutput { + return usage.kind === "StateOutput"; + } + + /** + * When a variable is used to return from a sub-graph; + * + * ```ts + * return heap0; + * ``` + */ + interface ReturnUsage { + kind: "ReturnUsage"; + from: string; + } + + function isReturnUsage(usage: VariableUsage): usage is ReturnUsage { + return usage.kind === "ReturnUsage"; + } + + /** + * A input path is the input to an opaque state. + * + * For example, an input to a Task which invokes a lambda function. + */ + interface StateInput { + kind: "StateInput"; + stateType: "Map" | "Task"; + from: string; + } + + function isStateInput(usage: VariableUsage): usage is StateInput { + return usage.kind === "StateInput"; + } + + /** + * A input path is the input to an opaque state. + * + * For example, an input to a Task which invokes a lambda function. + */ + interface StateInputProps { + kind: "StateInputProps"; + stateType: "Map" | "Task" | "Parallel"; + from: string; + props: string[]; + } + + function isStateInputProps(usage: VariableUsage): usage is StateInputProps { + return usage.kind === "StateInputProps"; + } + + /** + * When a variable is set using a constant value. + */ + interface LiteralAssignment { + kind: "LiteralAssignment"; + value: Parameters; + to: string; + } + + function isLiteralAssignment( + usage: VariableUsage + ): usage is LiteralAssignment { + return usage.kind === "LiteralAssignment"; + } + + interface LiteralPropAssignment { + kind: "LiteralPropAssignment"; + value: Parameters; + to: string; + props: string[]; + } + + function isLiteralPropAssignment( + usage: VariableUsage + ): usage is LiteralPropAssignment { + return usage.kind === "LiteralPropAssignment"; + } + + /** + * When a variable is used in a conditional statement. + */ + interface ConditionUsage { + kind: "Condition"; + from: string; + } + + function isConditionUsage(usage: VariableUsage): usage is ConditionUsage { + return usage.kind === "Condition"; + } + + type VariableUsage = + | Assignment + | PropertyAssignment + | LiteralAssignment + | LiteralPropAssignment + | ConditionUsage + | IntrinsicUsage + | FilterUsage + | FilterPropAssignment + | StateOutput + | StateInput + | StateInputProps + | ReturnUsage; + + type StateVariableUsage = VariableUsage & { + state: string; + }; + + interface VariableStats { + variable: string; + assigns: { + id: number; + index: number; + usage: StateVariableUsage; + }[]; + usage: { + id: number; + index: number; + usage: StateVariableUsage; + }[]; + } + + const isVariableAssignment = anyOf( + isAssignment, + isLiteralPropAssignment, + isLiteralAssignment, + isStateOutput, + isIntrinsicUsage, + isFilterUsage, + isFilterPropAssignment + ); + + function isAssignmentTo(variable: string, usage: VariableUsage) { + return ( + isVariableAssignment(usage) && jsonPathStartsWith(usage.to, variable) + ); + } + + const isVariableUsage = anyOf( + isAssignment, + isIntrinsicUsage, + isStateInput, + isStateInputProps, + isConditionUsage, + isPropertyAssignment, + isFilterUsage, + isFilterPropAssignment, + isReturnUsage + ); + + function isUsageOf(variable: string, usage: VariableUsage) { + return isVariableUsage(usage) && jsonPathStartsWith(usage.from, variable); + } + + function analyzeVariables( + startState: string, + states: States + ): { + variableUsages: StateVariableUsage[]; + variableNames: string[]; + stats: VariableStats[]; + } { + const variableUsages: StateVariableUsage[] = []; + const variableNames = new Set(); + const visited = new Set(); + + const topo = topoSort(startState, states); + + depthFirst(startState); + + const variableNamesArray = [...variableNames]; + // grab all of the variable prefixes. + const variableNamePrefixes = [ + ...new Set( + variableNamesArray + // ignore the root `$` + .filter((v) => v !== "$") + .map((v) => normalizeJsonPath(v)[0]!) + .map((v) => formatJsonPath([v])) + ), + ]; + + const variableUsageWithId = variableUsages.map((u, i) => ({ + id: i, + index: topo.findIndex((t) => t[0] === u.state), + usage: u, + })); + + const stats = variableNamePrefixes.map((v) => ({ + variable: v, + assigns: variableUsageWithId.filter(({ usage }) => + isAssignmentTo(v, usage) + ), + usage: variableUsageWithId.filter(({ usage }) => isUsageOf(v, usage)), + })); + + return { variableUsages, variableNames: [...variableNames], stats }; + + function depthFirst(stateName: string) { + if (visited.has(stateName)) return; + visited.add(stateName); + const state = states[stateName]!; + variableUsages.push( + ...getVariableUsage(state).map((usage) => ({ + ...usage, + state: stateName, + })) + ); + const names = getVariableNamesFromState(state); + names.forEach((n) => variableNames.add(n)); + visitTransition(state, depthFirst); + } + } + + function getVariableUsage(state: State): VariableUsage[] { + const usages: VariableUsage[] = (() => { + if (isPassState(state)) { + if (state.ResultPath) { + if (state.Result !== undefined) { + return [ + { + kind: "LiteralAssignment", + to: state.ResultPath, + value: state.Result, + }, + ]; + } else if (state.InputPath) { + if ( + state.InputPath.includes("?(") || + state.InputPath.includes(":") + ) { + return extractVariableReferences(state.InputPath).map((v) => ({ + kind: "Filter", + from: v, + to: state.ResultPath as string, + })); + } + return [ + { + kind: "Assignment", + from: state.InputPath, + to: state.ResultPath, + }, + ]; + } else if (state.Parameters) { + return parametersAssignment( + state.Parameters, + false, + state.ResultPath + ); + } + } + return []; + } else if (isTaskState(state)) { + return [ + ...(state.InputPath + ? [ + { + kind: "StateInput" as const, + stateType: "Task" as const, + from: state.InputPath, + }, + ] + : []), + ...(state.ResultPath + ? [ + { + kind: "StateOutput" as const, + stateType: "Task" as const, + to: state.ResultPath, + }, + ] + : []), + ...(state.Parameters + ? parametersAssignment(state.Parameters, false, "[[task]]") + : []), + ...catchAssignment(state.Catch), + ]; + } else if (isMapTaskState(state)) { + if (state.ResultPath) { + return [ + { kind: "StateOutput", stateType: "Map", to: state.ResultPath }, + ...catchAssignment(state.Catch), + ...(state.Parameters + ? parametersAssignment(state.Parameters, false, "[[map]]") + : []), + ...(state.ItemsPath + ? [ + { + kind: "StateInput" as const, + stateType: "Map" as const, + from: state.ItemsPath, + }, + ] + : []), + ]; + } + return []; + } else if (isParallelTaskState(state)) { + if (state.ResultPath) { + return [ + { + kind: "StateOutput", + stateType: "Parallel", + to: state.ResultPath, + }, + ...catchAssignment(state.Catch), + ...(state.Parameters + ? parametersAssignment(state.Parameters, false, "[[parallel]]") + : []), + ]; + } + return []; + } else if (isChoiceState(state)) { + const vars = state.Choices.flatMap(choiceUsage); + return [...new Set(vars)].map((v) => ({ + kind: "Condition", + from: v, + })); + } else if ( + isFailState(state) || + isSucceedState(state) || + isWaitState(state) + ) { + return []; + } + return assertNever(state); + })(); + + if ( + "End" in state && + state.End && + "ResultPath" in state && + state.ResultPath + ) { + return [ + ...usages, + { + kind: "ReturnUsage" as const, + from: state.ResultPath, + }, + ]; + } + return usages; + + function choiceUsage(condition: Condition): string[] { + const vars = new Set(); + for (const key in condition) { + if (key === "Variable") { + vars.add(condition.Variable!); + } else if (key === "And" || key === "Or") { + const conds = (condition.And! ?? condition.Or!) as Condition[]; + conds.flatMap(choiceUsage).map((v) => vars.add(v)); + } else if (key === "Not") { + return choiceUsage(condition.Not!); + } else if (key.endsWith("Path")) { + // @ts-ignore + vars.add(condition[key]!); + } + } + return [...vars]; + } + + function catchAssignment(_catch?: Catch[]): StateOutput[] { + return _catch + ? _catch + .filter( + (_catch): _catch is Catch & { ResultPath: string } => + !!_catch.ResultPath + ) + .map(({ ResultPath }) => ({ + kind: "StateOutput", + stateType: "Catch", + to: ResultPath, + })) + : []; + } + + /** + * { + * Parameters: { + * "a.$": "$.value" + * }, + * ResultPath: "$.out" + * } + * => + * ["$.value", "$.out.a"] + */ + function parametersAssignment( + parameters: Parameters, + containsJsonPath: boolean, + resultPath: string | "[[task]]" | "[[map]]" | "[[parallel]]", + _props?: string[] + ): ( + | PropertyAssignment + | LiteralPropAssignment + | IntrinsicUsage + | FilterPropAssignment + | StateInputProps + )[] { + const props: string[] = _props ?? []; + if (!parameters) { + return []; + } + if (typeof parameters === "object") { + if (Array.isArray(parameters)) { + return [ + { + kind: "LiteralPropAssignment", + to: resultPath, + value: parameters, + props, + }, + ]; + } else { + return Object.entries(parameters).flatMap(([key, param]) => { + const jsonPath = key.endsWith(".$"); + return parametersAssignment(param, jsonPath, resultPath, [ + ...props, + jsonPath ? key.substring(0, key.length - 2) : key, + ]); + }); + } + } + if (!containsJsonPath) { + // don't need to return anything for literal state inputs. + if ( + resultPath === "[[task]]" || + resultPath === "[[map]]" || + resultPath === "[[parallel]]" + ) { + return []; + } + return [ + { + kind: "LiteralPropAssignment", + to: resultPath, + value: parameters, + props, + }, + ]; + } + if (typeof parameters === "string") { + if (parameters.startsWith("States.")) { + return extractVariableReferences(parameters).map((x) => ({ + kind: "Intrinsic", + from: x, + to: resultPath, + props, + })); + } else if (parameters.includes("?(") || parameters.includes(":")) { + return extractVariableReferences(parameters).map((x) => ({ + kind: "FilterPropAssignment", + from: x, + to: resultPath, + props, + })); + } + } + // if the value is json path, it will not be a boolean or string + return [ + resultPath === "[[task]]" || + resultPath === "[[map]]" || + resultPath === "[[parallel]]" + ? { + kind: "StateInputProps", + from: parameters as string, + props, + stateType: + resultPath === "[[task]]" + ? "Task" + : resultPath === "[[parallel]]" + ? "Parallel" + : "Map", + } + : { + kind: "PropAssignment", + from: parameters as string, + to: resultPath, + props, + }, + ]; + } + + /** + * Pull variable references out of intrinsic functions and json path filters. + * + * States.Array($.var) => $.var + * $.arr[?(['value'] == $.var)] => $.arr, $.var + */ + function extractVariableReferences(jsonPath: string) { + return jsonPath.match(/(\$\.?[^,)]+)+/g) ?? []; + } + } + + function getVariableNamesFromState(state: State): string[] { + const names = ((state) => { + if ( + isTaskState(state) || + isMapTaskState(state) || + isParallelTaskState(state) + ) { + return [ + state.ResultPath, + ...(state.Catch?.map((c) => c.ResultPath) ?? []), + ]; + } else if (isPassState(state)) { + return [state.ResultPath]; + } else if ( + isSucceedState(state) || + isFailState(state) || + isChoiceState(state) || + isWaitState(state) + ) { + return []; + } + return assertNever(state); + })(state); + + return names.filter((n): n is string => !!n); + } + + export const DefaultOptimizeOptions: OptimizeOptions = { + optimizeVariableAssignments: true, + removeUnreachableStates: true, + joinConsecutiveChoices: true, + removeNoOpStates: true, + }; + + export interface OptimizeOptions { + /** + * Attempts to collapse assignments that provide no functional value. + * + * Collapses assignments created by the interpreter and the input source. + * + * ```ts + * const a = "a" + * const b = a; + * => + * const b = "a" + * ``` + */ + optimizeVariableAssignments: boolean; + /** + * Traverses the graph transitions and removes any states that cannot be reached. + * Unreachable states will fail on deployment to AWS Step Functions. + * + * Note: If this optimization is turned off, it is likely the output ASL will fail. + * Functionless creates some unreachable that this logic is expected to remove. + * Only turn this off if you intend to preform similar logic or use the ASL for another + * purpose than AWS Step Functions. + */ + removeUnreachableStates: boolean; + /** + * When {@link Choice} states are chained together, they can be simplified by merging the branches together. + * + * ```ts + * if(a) { + * if(b) { + * } else { + * } + * } + * + * => + * + * ```ts + * if(a && b) {} + * else(a) {} + * ``` + * + * In ASL this may remove unnecessary state transitions without any impact on the logic. + * + * Note: This could make the ASL itself larger when the same Choice is merged into multiple calling choices. + * Turn off at the cost of adding more state transitions. + */ + joinConsecutiveChoices: boolean; + /** + * The Functionless transpiler and sometimes user can can create states that don't do anything. + * + * Functionless does this to make the transpilation logic simpler by adding empty, targetable named nodes. + * + * This optimization flag finds all {@link Pass} states that do nothing but transition to another state and removes it from the graph. + * + * The previous and next states are then wired together with no impact on the logic. + */ + removeNoOpStates: boolean; + } + + export function optimizeGraph( + startState: string, + states: States, + _options?: Partial + ): States { + const options = { + ...DefaultOptimizeOptions, + ..._options, + }; + + const reducedGraph = reduceGraph(startState, states, options); + + // finally run remove unreachable states (when enabled) to ensure any isolated sub-graphs are removed. + return options.removeUnreachableStates + ? removeUnreachableStates(startState, reducedGraph) + : reducedGraph; + } + + /** + * Run optimizations that reduce the number of states in the graph + */ + function reduceGraph( + startState: string, + states: States, + options: OptimizeOptions + ): States { + const collapsedStates = options.joinConsecutiveChoices + ? joinChainedChoices(startState, states) + : states; + + const [unusedAssignmentStates, updatedStates] = + options.optimizeVariableAssignments + ? optimizeVariableAssignment(startState, collapsedStates) + : [[], collapsedStates]; + + const noOpStates = options.removeNoOpStates + ? findEmptyStates(startState, updatedStates) + : []; + + const removedStates = [...noOpStates, ...unusedAssignmentStates]; + + const removedTransitions = computeRemovedStateToUpdatedTransition( + new Set(removedStates), + updatedStates + ); + + // return the updated set of name to state. + return Object.fromEntries( + Object.entries(updatedStates).flatMap(([name, state]) => { + if (name in removedTransitions) { + return []; + } + + return [ + [ + name, + visitTransition(state, (transition) => + transition in removedTransitions + ? removedTransitions[transition]! + : transition + ), + ], + ]; + }) + ); + + /** + * Find the updated next value for all of the empty states. + * If the updated Next cannot be determined, do not remove the state. + */ + function computeRemovedStateToUpdatedTransition( + removedStates: Set, + states: States + ) { + return Object.fromEntries( + [...removedStates] + // assume removed states have Next for now + .map((s): [string, State & Pick] => [ + s, + states[s]! as State & Pick, + ]) + .flatMap(([name, { Next }]) => { + const newNext = Next ? getNext(Next, []) : Next; + + /** + * If the updated Next value for this state cannot be determined, + * do not remove the state. + * + * This can because the state has no Next value (Functionless bug) + * or because all of the states in a cycle are empty. + */ + if (!newNext) { + return []; + } + + return [[name, newNext]]; + + /** + * When all states in a cycle are empty, the cycle will be impossible to exit. + * + * Note: This should be a rare case and is not an attempt to find any non-terminating logic. + * ex: `for(;;){}` + * Adding most conditions, incrementors, or bodies will not run into this issue. + * + * ```ts + * { + * 1: { Type: "???", Next: 2 }, + * 2: { Type: "Pass", Next: 3 }, + * 3: { Type: "Pass", Next: 4 }, + * 4: { Type: "Pass", Next: 2 } + * } + * ``` + * + * State 1 is any state that transitions to state 2. + * State 2 transitions to empty state 3 + * State 3 transitions to empty state 4 + * State 4 transitions back to empty state 2. + * + * Empty Pass states provide no value and will be removed. + * Empty Pass states can never fail and no factor can change where it goes. + * + * This is not an issue for other states which may fail or inject other logic to change the next state. + * Even the Wait stat could be used in an infinite loop if the machine is terminated from external source. + * + * If this happens, return undefined. + */ + function getNext( + transition: string, + seen: string[] = [] + ): string | undefined { + if (seen?.includes(transition)) { + return undefined; + } + return removedStates.has(transition) + ? getNext( + // assuming the removes states have Next + (states[transition]! as State & Pick).Next!, + seen ? [...seen, transition] : [transition] + ) + : transition; + } + }) + ); + } + } + + /** + * Attempts to re-write and collapse variable usage and assignments are unnecessary. + * + * @returns states with assignments that are unused, updates graph states (with the unused ones) + */ + function optimizeVariableAssignment( + startState: string, + states: States + ): [string[], States] { + const { stats } = analyzeVariables(startState, states); + + // sort the stats by the location of the first assignment. + const sortStats = stats.sort((first, second) => { + return firstAssignIndex(first) - firstAssignIndex(second); + + function firstAssignIndex(stats: VariableStats) { + return stats.assigns.length === 0 + ? 0 + : Math.min(...stats.assigns.map((s) => s.index)); + } + }); + + const [statsMap, updatedStates] = sortStats.reduce( + ([statsMap, states], sourceVariable) => { + return ( + tryRemoveVariable( + statsMap[sourceVariable.variable]!, + statsMap, + states + ) ?? [statsMap, states] + ); + }, + [Object.fromEntries(stats.map((s) => [s.variable, s])), states] + ); + + const unusedAssignments = Object.values(statsMap).filter( + (s) => s.usage.length === 0 + ); + + const unusedAssignmentStates = unusedAssignments.flatMap((u) => + u.assigns.flatMap((a) => { + if (isStateOutput(a.usage) || a.usage.state === startState) { + // state outputs should not be removed as they can still have effects. + // Also do not remove the start states of sub-graphs. + // Instead we will update their result path to be null + // @ts-ignore + updatedStates[a.usage.state] = { + ...updatedStates[a.usage.state], + ResultPath: null, + }; + return []; + } + return [a.usage.state]; + }) + ); + + return [unusedAssignmentStates, updatedStates]; + } + + /** + * Given a variable name, attempt to remove it from the graph by updating its usage(s) + * without changing the behavior of the graph. + * + * @return - the updated graph states and variable states after removing the variable or nothing if there was no change. + */ + function tryRemoveVariable( + sourceVariable: VariableStats, + statsMap: Record, + states: States + ): [Record, States] | undefined { + /** + * The source assignment is the location at which the current variable is assigned a value. + * + * ```ts + * const b = a; // source <-- + * const c = b; // target + * ``` + * + * For now, all optimization only support a single assignment of the target variable. + * + * Also only support for simple source assignment. + * + * ```ts + * const b = "a"; // LiteralAssignment + * const c = b; // Assignment + * + * ``` + * + */ + const [sourceAssign, ...otherAssign] = sourceVariable.assigns ?? []; + if ( + otherAssign.length > 0 || + !sourceAssign || + !( + isAssignment(sourceAssign.usage) || + isLiteralAssignment(sourceAssign.usage) + ) + ) { + return; + } + + /** + * For now, all optimizations only support a single usage of the current variable. + * + * The target usage is the point at which the current variable is assigned to another variable. + * + * ```ts + * const b = a; // source + * const c = b; // target <-- + * ``` + */ + const [targetUsage, ...otherUsages] = sourceVariable.usage ?? []; + if (otherUsages.length > 0 || !targetUsage) { + // only update variables with a single assignment + return; + } + + /** + * The state at the {@link targetUsage} which we will try to update. + */ + const state = states[targetUsage.usage.state]!; + + /** + * Assignment of a literal or variable to another variable. + * + * ```ts + * const a = "a" // source - literal + * const b = a; // target - assignment + * // => + * const b = "a"; + * ``` + * + * ```ts + * const a = x; // source - literal + * const b = a; // target - assignment + * // => + * const b = x; + * ``` + */ + if (isAssignment(targetUsage.usage)) { + if (!isPassState(state)) { + return; + } + + if (isLiteralAssignment(sourceAssign.usage)) { + const value = accessLiteralAtJsonPathSuffix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.value + ); + + return [ + updateVariableUsage(targetUsage, { + ...targetUsage.usage, + kind: "LiteralAssignment", + value, + }), + { + ...states, + [targetUsage.usage.state]: { + ...state, + Result: undefined, + InputPath: undefined, + Parameters: value, + }, + }, + ]; + } else { + /** + * if the "from" variable we intend to update the prop assignment with will be + * assigned to after the source assignment and before the target assignment, skip. + */ + if ( + isMutatedInRange( + sourceAssign.usage.from, + sourceAssign.index, + targetUsage.index + ) + ) { + return; + } + + const updatedFrom = replaceJsonPathPrefix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.from + ); + + return [ + /** + * Update the target's stats to contain the new assign and remove the old one. + */ + updateVariableUsage(targetUsage, { + ...targetUsage.usage, + from: updatedFrom, + }), + { + ...states, + [targetUsage.usage.state]: { + ...state, + Parameters: undefined, + Result: undefined, + /** + * Search assignment to value should be a prefix of the old `usage.from`. + * Maintain the tail of the `usage.from`, but replace the prefix with `sourceAssign.usage.from` + * Value: $.source[0] + * Search Value: $.source + * Replace Value: $.from + * => $.from[0] + */ + InputPath: updatedFrom, + }, + }, + ]; + } + return; + } else if ( + isPropertyAssignment(targetUsage.usage) || + isStateInputProps(targetUsage.usage) + ) { + /** + * Assignment of a literal or variable to property on a pass, task, map, or parallel state. + * + * ```ts + * const a = "a" // source - literal + * const b = { + * c: a // target - prop assignment + * }; + * // => + * const b = { + * c: "a" + * }; + * ``` + * + * ```ts + * const a = x; // source - literal + * const b = { + * c: // target - prop assignment + * }; + * // => + * const b = { + * c: x + * }; + * ``` + */ + if ( + !( + isPassState(state) || + isParallelTaskState(state) || + isMapTaskState(state) || + isTaskState(state) + ) || + !state.Parameters || + typeof state.Parameters !== "object" || + Array.isArray(state.Parameters) + ) { + return; + } + + if (isLiteralAssignment(sourceAssign.usage)) { + const value = accessLiteralAtJsonPathSuffix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.value + ); + + return [ + updateVariableUsage( + targetUsage, + isPropertyAssignment(targetUsage.usage) + ? { + ...targetUsage.usage, + kind: "LiteralPropAssignment", + value, + } + : undefined + ), + { + ...states, + [targetUsage.usage.state]: { + ...state, + Parameters: updateParameters( + targetUsage.usage.props, + state.Parameters!, + value, + false + ), + }, + }, + ]; + } else { + /** + * if the "from" variable we intend to update the prop assignment with will be + * assigned to after the source assignment and before the target assignment, skip. + */ + if ( + isMutatedInRange( + sourceAssign.usage.from, + sourceAssign.index, + targetUsage.index + ) + ) { + return; + } + + /** + * Search assignment to value should be a prefix of the old `usage.from`. + * Maintain the tail of the `usage.from`, but replace the prefix with `sourceAssign.usage.from` + * Value: $.source[0] + * Search Value: $.source + * Replace Value: $.from + * => $.from[0] + */ + const updatedFrom = replaceJsonPathPrefix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.from + ); + + return [ + updateVariableUsage(targetUsage, { + ...targetUsage.usage, + from: updatedFrom, + }), + // update the state's parameter to contain the new input variable. + { + ...states, + [targetUsage.usage.state]: { + ...state, + Parameters: updateParameters( + targetUsage.usage.props, + state.Parameters!, + updatedFrom, + true + ), + }, + }, + ]; + } + return; + } else if (isIntrinsicUsage(targetUsage.usage)) { + /** + * Use of a literal or variable to property in an intrinsic function. + * Note: intrinsic properties must be in Parameter objects. + * + * ```ts + * const a = "a" // source - literal + * const b = { + * c: `format ${a}` // target - intrinsic + * }; + * // => + * const b = { + * c: `format a` + * }; + * ``` + * + * ```ts + * const a = x; // source - literal + * const b = { + * c: `format ${a}` // target - intrinsic + * }; + * // => + * const b = { + * c: `format ${x}` // target - intrinsic + * }; + * ``` + */ + if ( + !( + isPassState(state) || + isParallelTaskState(state) || + isMapTaskState(state) || + isTaskState(state) + ) || + !state.Parameters || + typeof state.Parameters !== "object" || + Array.isArray(state.Parameters) + ) { + return; + } + + /** + * Update the target's stats to contain the new assign and remove the old one. + */ + if (isLiteralAssignment(sourceAssign.usage)) { + const value = accessLiteralAtJsonPathSuffix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.value + ); + + if (typeof value === "object" && value !== null) { + return; + } + + // literals are inlined into the intrinsic function, remove the assignment + statsMap = updateVariableUsage(targetUsage); + + const from = targetUsage.usage.from; + + return [ + updateVariableUsage(targetUsage), + { + ...states, + [targetUsage.usage.state]: { + ...state, + Parameters: updateParameters( + targetUsage.usage.props, + state.Parameters!, + (original) => { + const intrinsic = original; + if (typeof intrinsic !== "string") { + throw new Error( + "Expected intrinsic property value to be a string." + ); + } + return replaceJsonPathInIntrinsic( + intrinsic, + from, + formatValue(value) + ); + }, + true + ), + }, + }, + ]; + + function formatValue(value: any): string { + return typeof value === "string" + ? `'${value}'` + : // handles arrays and null which may exist as a Parameter value + Array.isArray(value) + ? `States.Array(${value.map(formatValue).join(",")})` + : `${value}`; + } + } else { + /** + * if the "from" variable we intend to update the prop assignment with will be + * assigned to after the source assignment and before the target assignment, skip. + */ + if ( + isMutatedInRange( + sourceAssign.usage.from, + sourceAssign.index, + targetUsage.index + ) + ) { + return; + } + + const updatedFrom = replaceJsonPathPrefix( + (targetUsage.usage).from, + sourceAssign.usage.to, + sourceAssign.usage.from + ) + .split("$") + .join("$$"); + + return [ + updateVariableUsage(targetUsage, { + ...targetUsage.usage, + // update the from + from: updatedFrom, + }), + { + ...states, + [targetUsage.usage.state]: { + ...state, + Parameters: updateParameters( + targetUsage.usage.props, + state.Parameters!, + (original) => { + const intrinsic = original; + if (typeof intrinsic !== "string") { + throw new Error( + "Expected intrinsic property value to be a string." + ); + } + const originalFrom = (targetUsage.usage).from; + // States.Format($.heap0) => States.Format($.v) + // States.Format($.heap0) => States.Format("someString") + // States.Format($.heap0) => States.Format(0) + return replaceJsonPathInIntrinsic( + intrinsic, + originalFrom, + updatedFrom + ); + }, + true + ), + }, + }, + ]; + } + return; + } else if (isStateInput(targetUsage.usage)) { + /** + * Use of a literal or variable to property in a task/map input. + * Note: this is a special case because: + * 1. Task does not support Result as input, only Parameters (literal) or InputPath (reference) + * 2. Map's reference input is the ItemsPath and does not support literal inputs for the array input + * 3. Neither Map nor Task have a named output (to), only an input (from) as both are black boxes. + * + * ```ts + * const a = arr // source - assignment + * a.map(x => {}); // target - state input + * // => + * arr.map(x => {}); + * ``` + * + * ```ts + * const a = "a"; // source - literal + * func(a); // target - state input + * // => + * func("a"); + * ``` + * + * ```ts + * const a = x; // source - assignment + * func(x); // target - state input + * // => + * func(x); + * ``` + */ + if (!(isMapTaskState(state) || isTaskState(state))) { + return; + } + + if (isLiteralAssignment(sourceAssign.usage)) { + const value = accessLiteralAtJsonPathSuffix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.value + ); + + // map items cannot be a literal + if (state.Type === "Map") { + return; + } + + return [ + // the state takes a literal, clear the usage. + updateVariableUsage(targetUsage), + { + ...states, + [targetUsage.usage.state]: { + ...state, + InputPath: undefined, + Parameters: value, + }, + }, + ]; + } else { + /** + * if the "from" variable we intend to update the prop assignment with will be + * assigned to after the source assignment and before the target assignment, skip. + */ + if ( + isMutatedInRange( + sourceAssign.usage.from, + sourceAssign.index, + targetUsage.index + ) + ) { + return; + } + + const updatedFrom = replaceJsonPathPrefix( + targetUsage.usage.from, + sourceAssign.usage.to, + sourceAssign.usage.from + ); + + return [ + updateVariableUsage(targetUsage, { + ...targetUsage.usage, + from: updatedFrom, + }), + { + ...states, + [targetUsage.usage.state]: + state.Type === "Map" + ? { + ...state, + ItemsPath: sourceAssign.usage.from, + } + : { + ...state, + InputPath: updatedFrom, + }, + }, + ]; + } + return; + } else if ( + isFilterUsage(targetUsage.usage) || + isFilterPropAssignment(targetUsage.usage) || + isReturnUsage(targetUsage.usage) + ) { + // TODO: support more cases. + return; + } else if ( + isLiteralAssignment(targetUsage.usage) || + isLiteralPropAssignment(targetUsage.usage) || + isStateOutput(targetUsage.usage) || + isConditionUsage(targetUsage.usage) + ) { + // nothing else to simplify here. + return; + } else { + return assertNever(targetUsage.usage); + } + + /** + * Determines if a variable is mutated between the (topologically sorted) node indices given. + * + * a = "a" + * source = a + * a = "b" // mutated in range + * target = a + * a = "c" // mutated out of range. + */ + function isMutatedInRange( + variable: string, + startNodeIndex: number, + endNodeIndex: number + ) { + const variableStats = statsMap[jsonPathPrefix(variable)]; + return ( + variableStats?.assigns.some( + (a) => a.index > startNodeIndex && a.index < endNodeIndex + ) ?? false + ); + } + + function jsonPathPrefix(jsonPath: string) { + return formatJsonPath([normalizeJsonPath(jsonPath)[0]!]); + } + + function updateVariableUsage( + originalUsage: typeof statsMap[string]["assigns"][number], + updatedUsage?: StateVariableUsage + ): typeof statsMap { + // all variables in the stats map should be the prefix of the json path. + const originalTo = + "to" in originalUsage.usage && originalUsage.usage.to + ? jsonPathPrefix(originalUsage.usage.to) + : undefined; + const originalFrom = + "from" in originalUsage.usage && originalUsage.usage.from + ? jsonPathPrefix(originalUsage.usage.from) + : undefined; + const updatedTo = + updatedUsage && "to" in updatedUsage && updatedUsage.to + ? jsonPathPrefix(updatedUsage.to) + : undefined; + const updatedFrom = + updatedUsage && "from" in updatedUsage && updatedUsage.from + ? jsonPathPrefix(updatedUsage.from) + : undefined; + + const uniqueTargets = [ + ...new Set([originalTo, originalFrom, updatedTo, updatedFrom]), + ].filter((s): s is string => !!s); + + const newUsage = updatedUsage + ? { + ...originalUsage, + usage: updatedUsage, + } + : undefined; + + return { + ...statsMap, + ...Object.fromEntries( + uniqueTargets.map((variable) => { + const usage = statsMap[variable] ?? { + variable, + assigns: [], + usage: [], + }; + + return [ + variable, + { + ...usage, + assigns: [ + ...usage.assigns.filter((a) => a.id !== originalUsage.id), + ...(newUsage && variable === updatedTo ? [newUsage] : []), + ], + usage: [ + ...usage.usage.filter((a) => a.id !== originalUsage.id), + ...(newUsage && variable === updatedFrom ? [newUsage] : []), + ], + }, + ]; + }) + ), + }; + } + + function accessLiteralAtJsonPathSuffix( + originalJsonPath: string, + prefixJsonPath: string, + value: any + ) { + if (jsonPathStartsWith(originalJsonPath, prefixJsonPath)) { + const normOriginal = normalizeJsonPath(originalJsonPath); + const normPrefix = normalizeJsonPath(prefixJsonPath); + + return access(normOriginal.slice(normPrefix.length), value); + } + + function access(segments: (string | number)[], value: any): any { + const [segment, ...tail] = segments; + if (segment === undefined) { + return value; + } else if (!value) { + throw new Error("Expected object or array literal, found: " + value); + } else if (typeof value === "object") { + if (Array.isArray(value)) { + const index = Number(segment); + if (Number.isNaN(index)) { + throw new Error( + "Expected number to access an array literal literal, found: " + + segment + ); + } + return access(tail, value[index]); + } else { + return value[segment]; + } + } + throw new Error("Expected object or array to access."); + } + } + + function updateParameters( + /** + * Json path prefix to skip in the json path. + * + * Prefix: $.output.param + * JsonPath: $.output.param.param2.param3 + * + * { + * Parameters: { + * param2: { param3: value } + * }, + * ResultPath: $.output.param + * } + */ + props: string[], + originalParameters: Record, + value: Parameters | ((value: Parameters) => Parameters), + isValueJsonPath: boolean + ): Record { + const [segment, ...tail] = props; + if (typeof segment !== "string") { + throw new Error("Parameters objects should only contain string keys"); + } + if (props.length === 1) { + const paramClone = { ...originalParameters }; + const updatedValue = + typeof value === "function" + ? value(paramClone[`${segment}.$`] ?? paramClone[segment] ?? null) + : value; + delete paramClone[`${segment}.$`]; + delete paramClone[segment]; + if (isValueJsonPath) { + return { + ...paramClone, + [`${segment}.$`]: updatedValue, + }; + } else { + return { + ...paramClone, + [segment]: updatedValue, + }; + } + } else { + const _params = originalParameters[segment]; + if (!_params || typeof _params !== "object" || Array.isArray(_params)) { + throw new Error( + "Something went wrong when updating parameter object. Expected structure to stay the same." + ); + } + return { + ...originalParameters, + [segment]: updateParameters(tail, _params, value, isValueJsonPath), + }; + } + } + } + + /** + * A {@link Choice} state that points to another {@link Choice} state can adopt the target state's + * choices and Next without adding an additional transition. + * + * 1 + * if a -> 2 + * if b -> 3 + * else -> 4 + * 2 + * if c -> 3 + * else -> 4 + * 3 - Task + * 4 + * if e -> 5 + * else -> 6 + * 5 - Task + * 6 - Task + * + * => + * + * 1 + * if a && c -> 3 (1 and 2) + * if a && e -> 5 (1 and 4) + * if b -> 3 + * if e -> 5 (4) + * else -> 6 (4's else) + * 2 - remove (if nothing else points to it) + * 3 - Task + * 4 - remove (if nothing else points to it) + * 5 - Task + * 6 - Task + */ + function joinChainedChoices(startState: string, stateMap: States) { + const updatedStates: Record = {}; + + depthFirst(startState); + + // we can assume that all null states have been updated by here. + return updatedStates as Record; + + function depthFirst(state: string): State | null { + if (state in updatedStates) return updatedStates[state]!; + const stateObj = stateMap[state]!; + if (!isChoiceState(stateObj)) { + updatedStates[state] = stateObj; + visitTransition(stateObj, (next) => { + depthFirst(next); + }); + // no change + return stateObj; + } + // set self to null to 1) halt circular references 2) avoid circular merges between choices. + // if #2 happens, that choice will always fail as state cannot change between transitions. + updatedStates[state] = null; + const branches = stateObj.Choices.flatMap((branch) => { + const { Next: branchNext, ...branchCondition } = branch; + const nextState = depthFirst(branchNext); + // next state should only by null when there is a circular reference between choices + if (!nextState || !isChoiceState(nextState)) { + return [branch]; + } else { + const nextBranches = nextState.Choices.map( + ({ Next, ...condition }) => { + // for each branch in the next state, AND with the current branch and assign the next state's Next. + return { ...ASL.and(branchCondition, condition), Next }; + } + ); + return nextState.Default + ? [...nextBranches, { ...branchCondition, Next: nextState.Default }] + : nextBranches; + } + }); + const defaultState = stateObj.Default + ? depthFirst(stateObj.Default) + : undefined; + + const [defaultValue, defaultBranches] = + !defaultState || !isChoiceState(defaultState) + ? [stateObj.Default, []] + : [defaultState.Default, defaultState.Choices]; + + const mergedChoice = { + ...stateObj, + Choices: [...branches, ...defaultBranches], + Default: defaultValue, + }; + + updatedStates[state] = mergedChoice; + return mergedChoice; + } + } + + /** + * Topologically sort a connected directed graph. + */ + function topoSort( + startState: string, + states: States + ): [stateName: string, state: State][] { + const marks: Record = {}; + let nodes: [stateName: string, state: State][] = []; + + visit(startState); + + return nodes; + function visit(state: string) { + const stateMark = marks[state]; + if (stateMark === false) { + // cycle + return; + } else if (stateMark === true) { + return; + } + const stateObj = states[state]!; + + marks[state] = false; + + visitTransition(stateObj, visit); + marks[state] = true; + nodes = [[state, stateObj], ...nodes]; + } + } +} + +function replaceJsonPathInIntrinsic( + intrinsic: string, + jsonPath: string, + value: string +) { + // States.Format($.heap0) => States.Format($.v) + // States.Format($.heap0) => States.Format("someString") + // States.Format($.heap0) => States.Format(0) + return intrinsic.replace( + new RegExp(escapeRegExp(jsonPath) + "(?=\\.|\\)|,|\\[)", "g"), + value + ); +} diff --git a/src/asl/synth.ts b/src/asl/synth.ts index 8b420b24..93861c0b 100644 --- a/src/asl/synth.ts +++ b/src/asl/synth.ts @@ -129,30 +129,33 @@ import { } from "../statement"; import { StepFunctionError } from "../step-function"; import { - UniqueNameGenerator, - DeterministicNameGenerator, anyOf, + DeterministicNameGenerator, evalToConstant, + formatJsonPath, isPromiseAll, + UniqueNameGenerator, } from "../util"; import { visitEachChild } from "../visit"; import { ASLGraph } from "./asl-graph"; +import { ASLOptimizer } from "./optimizer"; import { - States, + Parameters, + Choice, CommonFields, - isTaskState, + Condition, + Fail, + isChoiceState, isMapTaskState, isParallelTaskState, + isTaskState, MapTask, - StateMachine, Pass, - Choice, - Fail, + State, + StateMachine, + States, Succeed, Wait, - Parameters, - Condition, - State, } from "./states"; /** @@ -297,6 +300,15 @@ const FUNCTIONLESS_CONTEXT_NAME = "fnl_context"; */ const FUNCTIONLESS_CONTEXT_JSON_PATH = `$.${FUNCTIONLESS_CONTEXT_NAME}`; +export interface ASLOptions { + /** + * Options for the ASL Optimizer. + * + * @default ASLOptimizer.DefaultOptimizeOptions + */ + optimization?: ASLOptimizer.OptimizeOptions; +} + /** * Amazon States Language (ASL) Generator. */ @@ -348,7 +360,8 @@ export class ASL { constructor( readonly scope: Construct, readonly role: aws_iam.IRole, - decl: FunctionLike + decl: FunctionLike, + private options?: ASLOptions ) { this.decl = decl = visitEachChild(decl, function normalizeAST(node): | FunctionlessNode @@ -551,7 +564,8 @@ export class ASL { : this.createUniqueStateName(`${name}__${parentName}`), ]) ); - } + }, + this.options ), }; } @@ -646,7 +660,7 @@ export class ASL { const initializer: ASLGraph.SubState | ASLGraph.NodeState = (() => { /**ForInStmt - * Assign the value to $.0__[variableName]. + * Assign the value to $.fnls__0__[variableName]. * Assign the index to the variable decl. If the variable decl is an identifier, it may be carried beyond the ForIn. */ if (isForInStmt(stmt)) { @@ -681,7 +695,7 @@ export class ASL { assignValue: { Type: "Pass", InputPath: `${tempArrayPath}[0].item`, - ResultPath: `$.0__${initializerName}`, + ResultPath: `$.fnls__0__${initializerName}`, Next: ASLGraph.DeferNext, }, }, @@ -2045,8 +2059,7 @@ export class ASL { } return ASLGraph.accessConstant( output, - ASLGraph.literalValue(expr.name.name), - false + ASLGraph.literalValue(expr.name.name) ); }); } else { @@ -2251,7 +2264,6 @@ export class ASL { Exclude | any[]> >; }); - return this.assignJsonPathOrIntrinsic( ASLGraph.intrinsicArray(...items), undefined, @@ -3870,14 +3882,17 @@ export class ASL { ? ref.name.name : undefined; - if (!propName) { + if ( + !propName || + !(typeof propName === "string" || typeof propName === "number") + ) { // step function does not support variable property accessors // this will probably fail in the filter to ASLGraph implementation too // however, lets let ASLGraph try and fail if needed. return undefined; } - return `${value}['${propName}']`; + return formatJsonPath([propName], value); } } } else if (isPropAccessExpr(expr)) { @@ -4626,8 +4641,11 @@ export class ASL { return false; }) ) { - // the array element is assigned to $.0__[name] - return { jsonPath: `$.0__${this.getIdentifierName(access.element)}` }; + // the array element is assigned to $.fnls__0__[name] + // https://twitter.com/sussmansa/status/1542777348616990720?s=20&t=p5GiGf58znNQmhj1zEOIqg + return { + jsonPath: `$.fnls__0__${this.getIdentifierName(access.element)}`, + }; } } @@ -4660,7 +4678,7 @@ export class ASL { ASLGraph.isLiteralString(elementOutput) || ASLGraph.isLiteralNumber(elementOutput) ) { - return ASLGraph.accessConstant(arrayOutput, elementOutput, true); + return ASLGraph.accessConstant(arrayOutput, elementOutput); } throw new SynthError( ErrorCodes.StepFunctions_Invalid_collection_access, @@ -5054,7 +5072,13 @@ export class ASL { ? propertyNameExpr.value : undefined; - if (!propertyName || typeof propertyName !== "string") { + if ( + !propertyName || + !( + typeof propertyName === "string" || + typeof propertyName === "number" + ) + ) { throw new SynthError( ErrorCodes.StepFunctions_property_names_must_be_constant ); @@ -5062,7 +5086,7 @@ export class ASL { if (ASLGraph.isJsonPath(value)) { return { - jsonPath: `${value.jsonPath}['${propertyName}']`, + jsonPath: formatJsonPath([propertyName], value.jsonPath), }; } else if (ASLGraph.isLiteralObject(value)) { return { @@ -5939,5 +5963,44 @@ function toStateName(node?: FunctionlessNode): string { return assertNever(node); } +/** + * Visit each transition in each state. + * Use the callback to update the transition name. + */ +export function visitTransition( + state: State, + cb: (next: string) => string | undefined | void +): State { + const cbOrNext = (next: string) => cb(next) ?? next; + if ("End" in state && state.End !== undefined) { + return state; + } + if (isChoiceState(state)) { + return { + ...state, + Choices: state.Choices.map((choice) => ({ + ...choice, + Next: cbOrNext(choice.Next), + })), + Default: state.Default ? cbOrNext(state.Default) : undefined, + }; + } else if ("Catch" in state) { + return { + ...state, + Catch: state.Catch?.map((_catch) => ({ + ..._catch, + Next: _catch.Next ? cbOrNext(_catch.Next) : _catch.Next, + })), + Next: state.Next ? cbOrNext(state.Next) : state.Next, + }; + } else if (!("Next" in state)) { + return state; + } + return { + ...state, + Next: state.Next ? cbOrNext(state.Next) : state.Next, + }; +} + // to prevent the closure serializer from trying to import all of functionless. export const deploymentOnlyModule = true; diff --git a/src/step-function.ts b/src/step-function.ts index cc23c967..8d9b58bd 100644 --- a/src/step-function.ts +++ b/src/step-function.ts @@ -11,6 +11,7 @@ import { Construct } from "constructs"; import { ApiGatewayVtlIntegration } from "./api"; import { AppSyncVtlIntegration } from "./appsync"; import { ASL, ASLGraph, Retry, StateMachine, States } from "./asl"; +import { ASLOptions } from "./asl/synth"; import { assertDefined } from "./assert"; import { FunctionLike } from "./declaration"; import { ErrorCodes, SynthError } from "./error-code"; @@ -1482,7 +1483,9 @@ export interface StepFunctionProps extends Omit< aws_stepfunctions.StateMachineProps, "definition" | "stateMachineType" - > {} + > { + asl?: ASLOptions; +} /** * An {@link ExpressStepFunction} is a callable Function which executes on the managed @@ -2016,6 +2019,7 @@ function getStepFunctionArgs< isFunctionLike(args[0]) || isErr(args[0]) || typeof args[0] === "function" ? {} : args[0]; + const func = validateFunctionLike( args.length > 1 ? args[1] : args[0], "StepFunction" @@ -2032,13 +2036,14 @@ function synthesizeStateMachine( stateMachineType: aws_stepfunctions.StateMachineType; } ): [StateMachine, aws_stepfunctions.StateMachine] { + const { asl, ..._props } = props; const machine = new aws_stepfunctions.StateMachine(scope, id, { - ...props, + ..._props, definition: new aws_stepfunctions.Pass(scope, "dummy"), }); try { - const definition = new ASL(scope, machine.role, decl).definition; + const definition = new ASL(scope, machine.role, decl, asl).definition; const resource = machine.node.findChild( "Resource" diff --git a/src/util.ts b/src/util.ts index 2c0917ba..5c8ad85e 100644 --- a/src/util.ts +++ b/src/util.ts @@ -412,3 +412,163 @@ export const invertBinaryOperator = (op: BinaryOp): BinaryOp => { return op; } }; + +/** + * return the segments of a json path, excluding the "$". + * + * $.a['b'][0] => ["a", "b", 0] + * + * TODO: find a json parser that doesn't suck: https://twitter.com/sussmansa/status/1562523469094330369 + */ +export function normalizeJsonPath(jsonPath: string): (string | number)[] { + return ( + jsonPath.match(/(\.[a-zA-Z0-9_\$]*|\[\'?[^'\]]*\'?\])/g)?.map((seg) => { + if (seg.startsWith(".")) { + return seg.substring(1); + } else if (seg.startsWith("['")) { + return seg.substring(2, seg.length - 2); + } else if (seg.startsWith("[")) { + return Number(seg.substring(1, seg.length - 1)); + } else { + throw new Error("Invalid json path: " + jsonPath); + } + }) ?? [] + ); +} + +/** + * @see jsonPathStartsWith + */ +function jsonPathSegmentStartsWith( + p1: (string | number)[], + p2: (string | number)[] +): boolean { + if (p1.length === 0) { + return p2.length === 0; + } else if (p2.length === 0) { + return true; + } + return p1[0] === p2[0] && jsonPathSegmentStartsWith(p1.slice(1), p2.slice(1)); +} + +/** + * Determines if a normalized json path is the prefix of another normalized json path. + * + * ```ts + * jsonPathStartsWith($.var, $['var']); // true + * jsonPathStartsWith($.var, $.var1); // false + * jsonPathStartsWith($.var.abc.y, $.var); // true + * jsonPathStartsWith($.var, $.var.abc); // false + * jsonPathStartsWith($.var['abc'], $.var.abc); // false + * ``` + */ +export function jsonPathStartsWith(path1: string, prefix: string): boolean { + const path1Segs = normalizeJsonPath(path1); + const path2Segs = normalizeJsonPath(prefix); + + return ( + path1Segs.length >= path2Segs.length && + jsonPathSegmentStartsWith(path1Segs, path2Segs) + ); +} + +/** + * Determines if two normalized json paths are exactly equal. + * + * $.var === $['var'] + * $.var !== $.var1 + * $.var === $.var + */ +export function jsonPathEquals(path1: string, path2: string): boolean { + const path1Segs = normalizeJsonPath(path1); + const path2Segs = normalizeJsonPath(path2); + + return ( + path1Segs.length === path2Segs.length && + jsonPathSegmentStartsWith(path1Segs, path2Segs) + ); +} + +/** + * Formats a series of json path segments into a value json path. + * + * Attempts to determine if a segment can be represented using dot notation or element access notation. + * + * ['var1', 'var 2', 0] + * => $.var1['var2'][0] + * + * @param prefix - Default: $., when provided acts as the prefix to the resulting json path. `[prefix].segment1['segment 2'][0]` + */ +export function formatJsonPath( + segments: (string | number)[], + prefix?: string +): string { + const _prefix = prefix ?? "$"; + const [segment, ...tail] = segments; + if (segment === undefined) { + return _prefix; + } else if (typeof segment === "number") { + // $[0] + return formatJsonPath(tail, `${_prefix}[${segment}]`); + } else { + return formatJsonPath( + tail, + `${_prefix}${ + segment.match(/[a-zA-Z][a-zA-Z0-9_]*/) + ? // $.var + `.${segment}` + : // $['var with $$$ stuff in it'] + `['${segment}']` + }` + ); + } +} + +/** + * Like {@link String.replace}, but works on complete json path segments, + * supports json path of any form, and only replaces the prefix of the json path. + * + * The output is a re-formatted jsonPath using {@link formatJsonPath}. + * + * When the search value is not found, the value is returned. + * + * Search Value: $.prefix + * Replace Value: $.newPrefix + * Target: $.prefix.suffix + * + * => $.newPrefix.suffix + * + * Search Value: $['prefix'] + * Replace Value: $.newPrefix + * Target: $.prefix.suffix + * + * => $.newPrefix.suffix + * + * Search Value: $.prefix + * Replace Value: $['new Prefix'] + * Target: $.prefix['suffix'][0] + * + * => $['new Prefix'].suffix[0] + */ +export function replaceJsonPathPrefix( + value: string, + searchValue: string, + replaceValue: string +) { + const normValue = normalizeJsonPath(value); + const normSearchValue = normalizeJsonPath(searchValue); + + // search [1,2], value: [1,2,3] + if (jsonPathSegmentStartsWith(normValue, normSearchValue)) { + // format([3], replaceValue) + return formatJsonPath( + normValue.slice(normSearchValue.length), + replaceValue + ); + } + return value; +} + +export function escapeRegExp(str: string) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string +} diff --git a/test/__snapshots__/step-function.localstack.test.ts.snap b/test/__snapshots__/step-function.localstack.test.ts.snap index 77394817..1010c124 100644 --- a/test/__snapshots__/step-function.localstack.test.ts.snap +++ b/test/__snapshots__/step-function.localstack.test.ts.snap @@ -16,7 +16,7 @@ exports[`$AWS.SDK.DynamoDB.describeTable 1`] = ` }, "return tableInfo.Table.TableArn": { "End": true, - "InputPath": "$.tableInfo.Table.TableArn", + "InputPath": "$.heap0.Table.TableArn", "ResultPath": "$", "Type": "Pass", }, @@ -50,22 +50,16 @@ exports[`Boolean coerce 1`] = ` "falseBoolean": false, "falseNumber": false, "falseString": false, - "falsyVar.$": "$.heap3", + "falsyVar.$": "$.heap2", "trueBoolean": true, "trueNumber": true, "trueObject": true, "trueString": true, - "truthyVar.$": "$.heap1", + "truthyVar.$": "$.heap0", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNumber 1": { - "InputPath": "$.heap0", - "Next": "Boolean(input.nv)", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "3__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNumber": { "InputPath": "$.heap2", "Next": "1__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNumber", @@ -191,7 +185,7 @@ exports[`Boolean coerce 1`] = ` "Type": "Pass", }, "false__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNu": { - "Next": "1__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNumber 1", + "Next": "Boolean(input.nv)", "Result": false, "ResultPath": "$.heap0", "Type": "Pass", @@ -304,7 +298,7 @@ exports[`Boolean coerce 1`] = ` "Type": "Pass", }, "true__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNum": { - "Next": "1__return {trueString: Boolean("1"), trueBoolean: Boolean(true), trueNumber 1", + "Next": "Boolean(input.nv)", "Result": true, "ResultPath": "$.heap0", "Type": "Pass", @@ -317,18 +311,6 @@ exports[`Number coerce 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu": { - "InputPath": "$.heap10.num", - "Next": "null 1", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu": { - "InputPath": "$.heap12.num", - "Next": "input.nan 1", - "ResultPath": "$.heap13", - "Type": "Pass", - }, "15__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu": { "InputPath": "$.heap14.num", "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", @@ -344,60 +326,30 @@ exports[`Number coerce 1`] = ` "nanString": null, "nanStringUnaryPlus": null, "nanTrueString": null, - "nanVar.$": "$.heap7", - "nanVarUnaryPlus.$": "$.heap15", + "nanVar.$": "$.heap6.num", + "nanVarUnaryPlus.$": "$.heap14.num", "oneBoolean": 1, "oneBooleanUnaryPlus": 1, "oneNumber": 1, "oneNumberUnaryPlus": 1, "oneString": 1, "oneStringUnaryPlus": 1, - "oneVar.$": "$.heap1", - "oneVarUnaryPlus.$": "$.heap9", + "oneVar.$": "$.heap0.num", + "oneVarUnaryPlus.$": "$.heap8.num", "zeroBoolean": 0, "zeroBooleanUnaryPlus": 0, - "zeroNull.$": "$.heap5", - "zeroNullUnaryPlus.$": "$.heap13", + "zeroNull.$": "$.heap4.num", + "zeroNullUnaryPlus.$": "$.heap12.num", "zeroNumber": 0, "zeroNumberUnaryPlus": 0, "zeroString": 0, "zeroStringUnaryPlus": 0, - "zeroVar.$": "$.heap3", - "zeroVarUnaryPlus.$": "$.heap11", + "zeroVar.$": "$.heap2.num", + "zeroVarUnaryPlus.$": "$.heap10.num", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1": { - "InputPath": "$.heap0.num", - "Next": "input.zero", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num": { - "InputPath": "$.heap2.num", - "Next": "null", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num": { - "InputPath": "$.heap4.num", - "Next": "input.nan", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num": { - "InputPath": "$.heap6.num", - "Next": "input.one", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num": { - "InputPath": "$.heap8.num", - "Next": "input.zero 1", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Number", "Parameters": { @@ -411,7 +363,7 @@ exports[`Number coerce 1`] = ` }, "assign__input.nan": { "InputPath": "$.input.nan", - "Next": "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.one", "ResultPath": "$.heap6.num", "Type": "Pass", }, @@ -423,37 +375,37 @@ exports[`Number coerce 1`] = ` }, "assign__input.one": { "InputPath": "$.input.one", - "Next": "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.zero 1", "ResultPath": "$.heap8.num", "Type": "Pass", }, "assign__input.zero": { "InputPath": "$.input.zero", - "Next": "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "null", "ResultPath": "$.heap2.num", "Type": "Pass", }, "assign__input.zero 1": { "InputPath": "$.input.zero", - "Next": "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "null 1", "ResultPath": "$.heap10.num", "Type": "Pass", }, "assign__null": { "InputPath": "$.fnl_context.null", - "Next": "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.nan", "ResultPath": "$.heap4.num", "Type": "Pass", }, "assign__null 1": { "InputPath": "$.fnl_context.null", - "Next": "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "input.nan 1", "ResultPath": "$.heap12.num", "Type": "Pass", }, "assign__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber": { "InputPath": "$.input.one", - "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1", + "Next": "input.zero", "ResultPath": "$.heap0.num", "Type": "Pass", }, @@ -461,7 +413,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.one", "Variable": "$.heap6.num", }, ], @@ -483,7 +435,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.zero 1", "Variable": "$.heap8.num", }, ], @@ -494,7 +446,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "null", "Variable": "$.heap2.num", }, ], @@ -505,7 +457,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "null 1", "Variable": "$.heap10.num", }, ], @@ -516,7 +468,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.nan", "Variable": "$.heap4.num", }, ], @@ -527,7 +479,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "input.nan 1", "Variable": "$.heap12.num", }, ], @@ -538,7 +490,7 @@ exports[`Number coerce 1`] = ` "Choices": [ { "IsNumeric": true, - "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1", + "Next": "input.zero", "Variable": "$.heap0.num", }, ], @@ -1122,7 +1074,7 @@ exports[`Number coerce 1`] = ` }, "null__input.nan": { "InputPath": "$.fnl_context.null", - "Next": "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.one", "ResultPath": "$.heap6.num", "Type": "Pass", }, @@ -1134,42 +1086,42 @@ exports[`Number coerce 1`] = ` }, "null__input.one": { "InputPath": "$.fnl_context.null", - "Next": "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.zero 1", "ResultPath": "$.heap8.num", "Type": "Pass", }, "null__input.zero": { "InputPath": "$.fnl_context.null", - "Next": "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "null", "ResultPath": "$.heap2.num", "Type": "Pass", }, "null__input.zero 1": { "InputPath": "$.fnl_context.null", - "Next": "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "null 1", "ResultPath": "$.heap10.num", "Type": "Pass", }, "null__null": { "InputPath": "$.fnl_context.null", - "Next": "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.nan", "ResultPath": "$.heap4.num", "Type": "Pass", }, "null__null 1": { "InputPath": "$.fnl_context.null", - "Next": "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "input.nan 1", "ResultPath": "$.heap12.num", "Type": "Pass", }, "null__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: ": { "InputPath": "$.fnl_context.null", - "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1", + "Next": "input.zero", "ResultPath": "$.heap0.num", "Type": "Pass", }, "one__input.nan": { - "Next": "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.one", "Result": 1, "ResultPath": "$.heap6.num", "Type": "Pass", @@ -1181,37 +1133,37 @@ exports[`Number coerce 1`] = ` "Type": "Pass", }, "one__input.one": { - "Next": "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.zero 1", "Result": 1, "ResultPath": "$.heap8.num", "Type": "Pass", }, "one__input.zero": { - "Next": "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "null", "Result": 1, "ResultPath": "$.heap2.num", "Type": "Pass", }, "one__input.zero 1": { - "Next": "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "null 1", "Result": 1, "ResultPath": "$.heap10.num", "Type": "Pass", }, "one__null": { - "Next": "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.nan", "Result": 1, "ResultPath": "$.heap4.num", "Type": "Pass", }, "one__null 1": { - "Next": "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "input.nan 1", "Result": 1, "ResultPath": "$.heap12.num", "Type": "Pass", }, "one__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: N": { - "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1", + "Next": "input.zero", "Result": 1, "ResultPath": "$.heap0.num", "Type": "Pass", @@ -1290,7 +1242,7 @@ exports[`Number coerce 1`] = ` "Type": "Choice", }, "zero__input.nan": { - "Next": "7__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.one", "Result": 0, "ResultPath": "$.heap6.num", "Type": "Pass", @@ -1302,37 +1254,37 @@ exports[`Number coerce 1`] = ` "Type": "Pass", }, "zero__input.one": { - "Next": "9__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.zero 1", "Result": 0, "ResultPath": "$.heap8.num", "Type": "Pass", }, "zero__input.zero": { - "Next": "3__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "null", "Result": 0, "ResultPath": "$.heap2.num", "Type": "Pass", }, "zero__input.zero 1": { - "Next": "11__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "null 1", "Result": 0, "ResultPath": "$.heap10.num", "Type": "Pass", }, "zero__null": { - "Next": "5__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num", + "Next": "input.nan", "Result": 0, "ResultPath": "$.heap4.num", "Type": "Pass", }, "zero__null 1": { - "Next": "13__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Nu", + "Next": "input.nan 1", "Result": 0, "ResultPath": "$.heap12.num", "Type": "Pass", }, "zero__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: ": { - "Next": "1__return {oneString: Number("1"), oneBoolean: Number(true), oneNumber: Num 1", + "Next": "input.zero", "Result": 0, "ResultPath": "$.heap0.num", "Type": "Pass", @@ -1356,12 +1308,6 @@ exports[`String coerce 1`] = ` "Default": "format__1__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Type": "Choice", }, - "1__[[input.val]]": { - "InputPath": "$.heap8.out", - "Next": "[[input.val]] 1", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "1__return {stringString: String("1"), stringBoolean: String(true), stringNu": { "End": true, "Parameters": { @@ -1369,41 +1315,23 @@ exports[`String coerce 1`] = ` "stringArray.$": "$.heap16.str", "stringBoolean": "true", "stringEmpty": "", - "stringNull.$": "$.heap5", + "stringNull.$": "$.heap4.str", "stringNumber": "1", "stringObject": "[object Object]", "stringObjectWithRef": "[object Object]", "stringString": "1", - "stringStringVar.$": "$.heap3", - "stringVar.$": "$.heap1", + "stringStringVar.$": "$.heap2.str", + "stringVar.$": "$.heap0.str", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {stringString: String("1"), stringBoolean: String(true), stringNu 1": { - "InputPath": "$.heap0.str", - "Next": "input.str", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "2__["a", ["b"], [[input.val]], [], {}, {a: input.val}]": { - "InputPath": "$.heap10.out", - "Next": "3__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "3__["a", ["b"], [[input.val]], [], {}, {a: input.val}]": { "Next": "4__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Result": [], "ResultPath": "$.heap12", "Type": "Pass", }, - "3__return {stringString: String("1"), stringBoolean: String(true), stringNu": { - "InputPath": "$.heap2.str", - "Next": "null", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "4__["a", ["b"], [[input.val]], [], {}, {a: input.val}]": { "Next": "5__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Result": {}, @@ -1418,12 +1346,6 @@ exports[`String coerce 1`] = ` "ResultPath": "$.heap14", "Type": "Pass", }, - "5__return {stringString: String("1"), stringBoolean: String(true), stringNu": { - "InputPath": "$.heap4.str", - "Next": "["a", ["b"], [[input.val]], [], {}, {a: input.val}]", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "return {stringString: String("1"), stringBoolean: String(true), stringNumbe", "Parameters": { @@ -1436,7 +1358,7 @@ exports[`String coerce 1`] = ` "Type": "Pass", }, "["a", ["b"], [[input.val]], [], {}, {a: input.val}]": { - "Next": "[[input.val]]", + "Next": "[input.val]", "Result": [ "b", ], @@ -1446,29 +1368,23 @@ exports[`String coerce 1`] = ` "["a", ["b"], [[input.val]], [], {}, {a: input.val}] 1": { "Next": "1__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Parameters": { - "out.$": "States.Array('a',$.heap6,$.heap11,$.heap12,$.heap13,$.heap14)", + "out.$": "States.Array('a',$.heap6,$.heap10.out,$.heap12,$.heap13,$.heap14)", }, "ResultPath": "$.heap15", "Type": "Pass", }, - "[[input.val]]": { - "InputPath": "$.input.val", - "Next": "[input.val]", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "[[input.val]] 1": { - "Next": "2__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", + "Next": "3__["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Parameters": { - "out.$": "States.Array($.heap9)", + "out.$": "States.Array($.heap8.out)", }, "ResultPath": "$.heap10", "Type": "Pass", }, "[input.val]": { - "Next": "1__[[input.val]]", + "Next": "[[input.val]] 1", "Parameters": { - "out.$": "States.Array($.heap7)", + "out.$": "States.Array($.input.val)", }, "ResultPath": "$.heap8", "Type": "Pass", @@ -1481,19 +1397,19 @@ exports[`String coerce 1`] = ` }, "assign__input.str": { "InputPath": "$.input.str", - "Next": "3__return {stringString: String("1"), stringBoolean: String(true), stringNu", + "Next": "null", "ResultPath": "$.heap2.str", "Type": "Pass", }, "assign__null": { "InputPath": "$.fnl_context.null", - "Next": "5__return {stringString: String("1"), stringBoolean: String(true), stringNu", + "Next": "["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "ResultPath": "$.heap4.str", "Type": "Pass", }, "assign__return {stringString: String("1"), stringBoolean: String(true), str": { "InputPath": "$.input.val", - "Next": "1__return {stringString: String("1"), stringBoolean: String(true), stringNu 1", + "Next": "input.str", "ResultPath": "$.heap0.str", "Type": "Pass", }, @@ -1506,7 +1422,7 @@ exports[`String coerce 1`] = ` "Type": "Pass", }, "format__input.str": { - "Next": "3__return {stringString: String("1"), stringBoolean: String(true), stringNu", + "Next": "null", "Parameters": { "str.$": "States.JsonToString($.input.str)", }, @@ -1514,7 +1430,7 @@ exports[`String coerce 1`] = ` "Type": "Pass", }, "format__null": { - "Next": "5__return {stringString: String("1"), stringBoolean: String(true), stringNu", + "Next": "["a", ["b"], [[input.val]], [], {}, {a: input.val}]", "Parameters": { "str.$": "States.JsonToString($.fnl_context.null)", }, @@ -1522,7 +1438,7 @@ exports[`String coerce 1`] = ` "Type": "Pass", }, "format__return {stringString: String("1"), stringBoolean: String(true), str": { - "Next": "1__return {stringString: String("1"), stringBoolean: String(true), stringNu 1", + "Next": "input.str", "Parameters": { "str.$": "States.JsonToString($.input.val)", }, @@ -1573,40 +1489,22 @@ exports[`access 1`] = ` "1__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ": { "End": true, "Parameters": { - "a.$": "$.heap0", - "b.$": "$.heap1", - "d.$": "$.heap2", - "e.$": "$.heap3", - "g.$": "$.heap5", + "a.$": "$.obj.x", + "b.$": "$.obj.x", + "d.$": "$.obj['1']", + "e": 1, + "g.$": "$.heap4", "h.$": "$.heap6", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: 1": { - "InputPath": "$.obj.x", - "Next": "2__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "2__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ": { - "InputPath": "$.obj['1']", - "Next": "3__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "3__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ": { - "InputPath": "$.arr[0]", "Next": "obj.n ?? "c"", + "Parameters": 1, "ResultPath": "$.heap3", "Type": "Pass", }, - "5__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ": { - "InputPath": "$.heap4", - "Next": "obj.n ?? "d"", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "obj = {1: "a", x: "b"}", "Parameters": { @@ -1618,7 +1516,7 @@ exports[`access 1`] = ` "Type": "Pass", }, "arr = [1]": { - "Next": "return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: obj", + "Next": "3__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ", "Result": [ 1, ], @@ -1626,7 +1524,7 @@ exports[`access 1`] = ` "Type": "Pass", }, "false__obj.n ?? "c"": { - "Next": "5__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ", + "Next": "obj.n ?? "d"", "Result": "c", "ResultPath": "$.heap4", "Type": "Pass", @@ -1684,15 +1582,9 @@ exports[`access 1`] = ` "Default": "false__obj.n ?? "d"", "Type": "Choice", }, - "return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: obj": { - "InputPath": "$.obj.x", - "Next": "1__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "true__obj.n ?? "c"": { "InputPath": "$.obj.n", - "Next": "5__return {a: obj.x, b: obj.x, d: obj["1"], e: arr[0], g: obj.n ?? "c", h: ", + "Next": "obj.n ?? "d"", "ResultPath": "$.heap4", "Type": "Pass", }, @@ -1710,92 +1602,75 @@ exports[`assignment 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { + "1__h = [z, y, y = "a", y = "b" , y, y]": { + "InputPath": "$.y", + "Next": "y = "a"", + "ResultPath": "$.heap6", + "Type": "Pass", + }, + "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { "End": true, "Parameters": { - "a.$": "$.heap12", - "b.$": "$.heap13", - "c.$": "$.heap14", - "d.$": "$.heap15", - "e.$": "$.heap16", - "f.$": "$.heap17", - "g.$": "$.heap18", - "h.$": "$.heap19", - "i.$": "$.i", + "a.$": "$.a", + "b.$": "$.b", + "c.$": "$.c", + "d.$": "$.d", + "e.$": "$.e", + "f.$": "$.f", + "g.$": "$.g", + "h.$": "$.heap9.out", + "i.$": "$.heap12.string", + "jj.$": "$.jj", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i} 1": { + "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj} 1": { "InputPath": "$.b", - "Next": "2__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "2__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { - "InputPath": "$.c", - "Next": "3__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", + "Next": "2__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", "ResultPath": "$.heap14", "Type": "Pass", }, - "3__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}": { - "InputPath": "$.z", - "Next": "4__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "3__h = [y, y = "a", y = "b" , y, y]": { - "InputPath": "$.y", - "Next": "4__h = [y, y = "a", y = "b" , y, y]", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "3__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { - "InputPath": "$.d", - "Next": "4__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", + "2__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.c", + "Next": "3__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", "ResultPath": "$.heap15", "Type": "Pass", }, - "4__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}": { - "InputPath": "$.z", - "Next": "z === "b"", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "4__h = [y, y = "a", y = "b" , y, y]": { - "InputPath": "$.y", - "Next": "[y, y = "a", y = "b" , y, y]", - "ResultPath": "$.heap7", + "3__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.d", + "Next": "4__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap16", "Type": "Pass", }, - "4__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { + "4__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { "InputPath": "$.e", - "Next": "5__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", - "ResultPath": "$.heap16", + "Next": "5__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap17", "Type": "Pass", }, - "5__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { + "5__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { "InputPath": "$.f", - "Next": "6__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", - "ResultPath": "$.heap17", + "Next": "6__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap18", "Type": "Pass", }, - "6__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}": { - "InputPath": "$.heap3", - "Next": "g", - "ResultPath": "$.heap4", + "6__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.g", + "Next": "7__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap19", "Type": "Pass", }, - "6__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { - "InputPath": "$.g", - "Next": "7__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", - "ResultPath": "$.heap18", + "7__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.heap9.out", + "Next": "8__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap20", "Type": "Pass", }, - "7__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { - "InputPath": "$.h", - "Next": "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", - "ResultPath": "$.heap19", + "8__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.heap12.string", + "Next": "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", + "ResultPath": "$.heap21", "Type": "Pass", }, "Initialize Functionless Context": { @@ -1808,12 +1683,12 @@ exports[`assignment 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "[y, y = "a", y = "b" , y, y]": { - "Next": "h", + "[z, y, y = "a", y = "b" , y, y]": { + "Next": "x = "0"", "Parameters": { - "out.$": "States.Array($.heap5,'a',$.heap6,$.heap7)", + "out.$": "States.Array($.z,$.heap6,'a',$.y,$.y)", }, - "ResultPath": "$.heap8", + "ResultPath": "$.heap9", "Type": "Pass", }, "a = "2"": { @@ -1823,7 +1698,7 @@ exports[`assignment 1`] = ` "Type": "Pass", }, "a = 1": { - "Next": "d = a", + "Next": "jj = j", "Result": 1, "ResultPath": "$.a", "Type": "Pass", @@ -1890,7 +1765,7 @@ exports[`assignment 1`] = ` "Type": "Pass", }, "false__z === "b"": { - "Next": "6__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}", + "Next": "g", "Result": false, "ResultPath": "$.heap3", "Type": "Pass", @@ -1900,12 +1775,12 @@ exports[`assignment 1`] = ` "Parameters": { "a.$": "$.heap0", "b": "a", - "c.$": "$.heap1", + "c.$": "$.z", "o": { "z.$": "$.z", }, - "t.$": "$.heap4", - "z.$": "$.heap2", + "t.$": "$.heap3", + "z.$": "$.z", }, "ResultPath": "$.g", "Type": "Pass", @@ -1916,56 +1791,44 @@ exports[`assignment 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "h": { - "InputPath": "$.heap8.out", - "Next": "x = "0"", - "ResultPath": "$.h", - "Type": "Pass", - }, - "h = [y, y = "a", y = "b" , y, y]": { - "InputPath": "$.y", - "Next": "y = "a"", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "hello x x = "1" x = "3" , "2"x": { "Next": "i", "Parameters": { - "string.$": "States.Format('hello {} 1 2 {}',$.heap9,$.heap10)", + "string.$": "States.Format('hello {} 1 2 {}',$.heap10,$.x)", }, - "ResultPath": "$.heap11", + "ResultPath": "$.heap12", "Type": "Pass", }, "i": { - "InputPath": "$.heap11.string", - "Next": "return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}", + "InputPath": "$.heap12.string", + "Next": "return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}", "ResultPath": "$.i", "Type": "Pass", }, "i = hello x x = "1" x = "3" , "2"x": { "InputPath": "$.x", "Next": "x = "1"", - "ResultPath": "$.heap9", + "ResultPath": "$.heap10", "Type": "Pass", }, - "return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i}": { + "jj = j": { "InputPath": "$.a", - "Next": "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i} 1", - "ResultPath": "$.heap12", + "Next": "d = a", + "ResultPath": "$.jj", + "Type": "Pass", + }, + "return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj}": { + "InputPath": "$.a", + "Next": "1__return {a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, jj: jj} 1", + "ResultPath": "$.heap13", "Type": "Pass", }, "true__z === "b"": { - "Next": "6__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}", + "Next": "g", "Result": true, "ResultPath": "$.heap3", "Type": "Pass", }, - "x": { - "InputPath": "$.x", - "Next": "hello x x = "1" x = "3" , "2"x", - "ResultPath": "$.heap10", - "Type": "Pass", - }, "x = "0"": { "Next": "i = hello x x = "1" x = "3" , "2"x", "Result": "0", @@ -1979,13 +1842,13 @@ exports[`assignment 1`] = ` "Type": "Pass", }, "x = "3"": { - "Next": "x", + "Next": "hello x x = "1" x = "3" , "2"x", "Result": "3", "ResultPath": "$.x", "Type": "Pass", }, "y = """: { - "Next": "h = [y, y = "a", y = "b" , y, y]", + "Next": "z = "c"", "Result": "", "ResultPath": "$.y", "Type": "Pass", @@ -1997,7 +1860,7 @@ exports[`assignment 1`] = ` "Type": "Pass", }, "y = "b"": { - "Next": "3__h = [y, y = "a", y = "b" , y, y]", + "Next": "[z, y, y = "a", y = "b" , y, y]", "Result": "b", "ResultPath": "$.y", "Type": "Pass", @@ -2015,11 +1878,17 @@ exports[`assignment 1`] = ` "Type": "Pass", }, "z = "b"": { - "Next": "3__g = {a: z, b: z = "a", c: z = "b" , z, z: z, t: z === "b", o: {z: z}}", + "Next": "z === "b"", "Result": "b", "ResultPath": "$.z", "Type": "Pass", }, + "z = "c"": { + "Next": "1__h = [z, y, y = "a", y = "b" , y, y]", + "Result": "c", + "ResultPath": "$.z", + "Type": "Pass", + }, "z === "b"": { "Choices": [ { @@ -2651,7 +2520,7 @@ exports[`binary and unary comparison 1`] = ` { "IsPresent": true, "Next": "true__"a" in input.obj", - "Variable": "$.input.obj['a']", + "Variable": "$.input.obj.a", }, ], "Default": "false__"a" in input.obj", @@ -2662,7 +2531,7 @@ exports[`binary and unary comparison 1`] = ` { "IsPresent": true, "Next": "true__"b" in input.obj", - "Variable": "$.input.obj['b']", + "Variable": "$.input.obj.b", }, ], "Default": "false__"b" in input.obj", @@ -2946,832 +2815,256 @@ exports[`binary and unary comparison 1`] = ` "Default": "false__1 >= 1", "Type": "Choice", }, - "101__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap100", - "Next": "input.a === input.a", - "ResultPath": "$.heap101", - "Type": "Pass", - }, - "103__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap102", - "Next": "true !== true", - "ResultPath": "$.heap103", - "Type": "Pass", - }, - "105__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap104", - "Next": "input.a !== true", - "ResultPath": "$.heap105", - "Type": "Pass", - }, - "107__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap106", - "Next": "false !== input.a", - "ResultPath": "$.heap107", - "Type": "Pass", - }, - "109__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap108", - "Next": "input.a !== input.a", - "ResultPath": "$.heap109", - "Type": "Pass", - }, - "111__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap110", - "Next": "null === null", - "ResultPath": "$.heap111", - "Type": "Pass", - }, - "113__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap112", - "Next": "input.nv === null", - "ResultPath": "$.heap113", - "Type": "Pass", - }, - "115__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap114", - "Next": "input.v === input.nv", - "ResultPath": "$.heap115", - "Type": "Pass", - }, - "117__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap116", - "Next": "input.nv === input.nv", - "ResultPath": "$.heap117", - "Type": "Pass", - }, - "119__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap118", - "Next": "null !== null", - "ResultPath": "$.heap119", - "Type": "Pass", - }, - "11__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap10", - "Next": ""val2" !== input.v", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "121__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap120", - "Next": "input.nv !== null", - "ResultPath": "$.heap121", - "Type": "Pass", - }, - "123__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap122", - "Next": "input.v !== input.nv", - "ResultPath": "$.heap123", - "Type": "Pass", - }, - "125__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap124", - "Next": "input.nv !== input.nv", - "ResultPath": "$.heap125", - "Type": "Pass", - }, - "127__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap126", - "Next": ""a" in input.obj", - "ResultPath": "$.heap127", - "Type": "Pass", - }, - "129__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap128", - "Next": ""b" in input.obj", - "ResultPath": "$.heap129", - "Type": "Pass", - }, - "131__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap130", - "Next": "!false", - "ResultPath": "$.heap131", - "Type": "Pass", - }, - "133__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap132", - "Next": "!input.a", - "ResultPath": "$.heap133", - "Type": "Pass", - }, - "135__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap134", - "Next": "!input.nv", - "ResultPath": "$.heap135", - "Type": "Pass", - }, - "137__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap136", - "Next": "!input.n", - "ResultPath": "$.heap137", - "Type": "Pass", - }, - "139__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap138", - "Next": "!input.x", - "ResultPath": "$.heap139", - "Type": "Pass", - }, - "13__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap12", - "Next": "input.v !== input.v", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "141__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap140", - "Next": "!input.obj", - "ResultPath": "$.heap141", - "Type": "Pass", - }, - "143__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap142", - "Next": "input.v === undefined", - "ResultPath": "$.heap143", - "Type": "Pass", - }, - "145__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap144", - "Next": "input.v == undefined", - "ResultPath": "$.heap145", - "Type": "Pass", - }, - "147__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap146", - "Next": "input.v !== undefined", - "ResultPath": "$.heap147", - "Type": "Pass", - }, - "149__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap148", - "Next": "input.v != undefined", - "ResultPath": "$.heap149", - "Type": "Pass", - }, - "151__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap150", - "Next": "input.nv === undefined", - "ResultPath": "$.heap151", - "Type": "Pass", - }, - "153__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap152", - "Next": "input.nv == undefined", - "ResultPath": "$.heap153", - "Type": "Pass", - }, - "155__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap154", - "Next": "input.nv === undefined 1", - "ResultPath": "$.heap155", - "Type": "Pass", - }, - "157__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap156", - "Next": "input.nv == undefined 1", - "ResultPath": "$.heap157", - "Type": "Pass", - }, - "159__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap158", - "Next": "input.und === undefined", - "ResultPath": "$.heap159", - "Type": "Pass", - }, - "15__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap14", - "Next": ""a" < "a"", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "161__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap160", - "Next": "input.und == undefined", - "ResultPath": "$.heap161", - "Type": "Pass", - }, - "163__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap162", - "Next": "input.und !== undefined", - "ResultPath": "$.heap163", - "Type": "Pass", - }, - "165__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap164", - "Next": "input.und != undefined", - "ResultPath": "$.heap165", - "Type": "Pass", - }, - "167__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap166", - "Next": "input.v === undefined 1", - "ResultPath": "$.heap167", - "Type": "Pass", - }, - "169__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap168", - "Next": "input.v == undefined 1", - "ResultPath": "$.heap169", - "Type": "Pass", - }, - "171__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap170", - "Next": "input.und === null", - "ResultPath": "$.heap171", - "Type": "Pass", - }, - "173__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap172", - "Next": "input.und == null", - "ResultPath": "$.heap173", - "Type": "Pass", - }, - "175__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap174", - "Next": "input.und !== null", - "ResultPath": "$.heap175", - "Type": "Pass", - }, - "177__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap176", - "Next": "input.und != null", - "ResultPath": "$.heap177", - "Type": "Pass", - }, - "179__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap178", - "Next": "input.und === "hello"", - "ResultPath": "$.heap179", - "Type": "Pass", - }, - "17__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap16", - "Next": "input.v < "val2"", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "181__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap180", - "Next": "input.und == "hello"", - "ResultPath": "$.heap181", - "Type": "Pass", - }, - "183__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap182", - "Next": "input.und !== "hello"", - "ResultPath": "$.heap183", - "Type": "Pass", - }, - "185__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap184", - "Next": "input.und != "hello"", - "ResultPath": "$.heap185", - "Type": "Pass", - }, - "187__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap186", - "Next": "input.nv === "hello"", - "ResultPath": "$.heap187", - "Type": "Pass", - }, - "189__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap188", - "Next": "input.nv == "hello"", - "ResultPath": "$.heap189", - "Type": "Pass", - }, - "191__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap190", - "Next": "input.nv !== "hello"", - "ResultPath": "$.heap191", - "Type": "Pass", - }, - "193__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap192", - "Next": "input.nv != "hello"", - "ResultPath": "$.heap193", - "Type": "Pass", - }, - "195__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap194", - "Next": "input.undN === 1", - "ResultPath": "$.heap195", - "Type": "Pass", - }, - "197__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap196", - "Next": "input.undN == 1", - "ResultPath": "$.heap197", - "Type": "Pass", - }, - "199__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap198", - "Next": "input.undN !== 1", - "ResultPath": "$.heap199", - "Type": "Pass", - }, - "19__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap18", - "Next": ""val2" < input.v", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "1__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in": { "End": true, "Parameters": { - "constantBooleanEquals.$": "$.heap97", - "constantBooleanNotEquals.$": "$.heap105", + "constantBooleanEquals.$": "$.heap96", + "constantBooleanNotEquals.$": "$.heap104", "constantInConstant": true, - "constantInVar.$": "$.heap129", - "constantNot.$": "$.heap133", - "constantNotInVar.$": "$.heap131", - "constantNullEquals.$": "$.heap113", - "constantNullNotEquals.$": "$.heap121", - "constantNumberEquals.$": "$.heap49", - "constantNumberGreater.$": "$.heap81", - "constantNumberGreaterEquals.$": "$.heap89", - "constantNumberLess.$": "$.heap65", - "constantNumberLessEquals.$": "$.heap73", - "constantNumberNotEquals.$": "$.heap57", - "constantStringEquals.$": "$.heap1", - "constantStringGreater.$": "$.heap33", - "constantStringGreaterEquals.$": "$.heap41", - "constantStringLess.$": "$.heap17", - "constantStringLessEquals.$": "$.heap25", - "constantStringNotEquals.$": "$.heap9", - "constantToVarBooleanEquals.$": "$.heap99", - "constantToVarBooleanNotEquals.$": "$.heap107", - "constantToVarNullEquals.$": "$.heap115", - "constantToVarNullNotEquals.$": "$.heap123", - "constantToVarNumberEquals.$": "$.heap51", - "constantToVarNumberGreater.$": "$.heap83", - "constantToVarNumberGreaterEquals.$": "$.heap91", - "constantToVarNumberLess.$": "$.heap67", - "constantToVarNumberLessEquals.$": "$.heap75", - "constantToVarNumberNotEquals.$": "$.heap59", - "constantToVarStringEquals.$": "$.heap3", - "constantToVarStringGreater.$": "$.heap35", - "constantToVarStringGreaterEquals.$": "$.heap43", - "constantToVarStringLess.$": "$.heap19", - "constantToVarStringLessEquals.$": "$.heap27", - "constantToVarStringNotEquals.$": "$.heap11", - "nullEqualEqualsUndefined.$": "$.heap153", - "nullEqualEqualsUndefinedVar.$": "$.heap217", - "nullEqualsUndefined.$": "$.heap155", - "nullEqualsUndefinedVar.$": "$.heap219", - "nullNotEqualEqualsUndefined.$": "$.heap157", - "nullNotEqualEqualsUndefinedVar.$": "$.heap221", - "nullNotEqualsUndefined.$": "$.heap159", - "nullNotEqualsUndefinedVar.$": "$.heap223", - "nullVarEqualEqualsNumber.$": "$.heap205", - "nullVarEqualEqualsNumberVar.$": "$.heap265", - "nullVarEqualEqualsString.$": "$.heap189", - "nullVarEqualEqualsStringVar.$": "$.heap249", - "nullVarEqualsNumber.$": "$.heap207", - "nullVarEqualsNumberVar.$": "$.heap267", - "nullVarEqualsString.$": "$.heap191", - "nullVarEqualsStringVar.$": "$.heap251", - "nullVarNotEqualEqualsNumber.$": "$.heap209", - "nullVarNotEqualEqualsNumberVar.$": "$.heap269", - "nullVarNotEqualEqualsString.$": "$.heap193", - "nullVarNotEqualEqualsStringVar.$": "$.heap253", - "nullVarNotEqualsNumber.$": "$.heap211", + "constantInVar.$": "$.heap128", + "constantNot.$": "$.heap132", + "constantNotInVar.$": "$.heap130", + "constantNullEquals.$": "$.heap112", + "constantNullNotEquals.$": "$.heap120", + "constantNumberEquals.$": "$.heap48", + "constantNumberGreater.$": "$.heap80", + "constantNumberGreaterEquals.$": "$.heap88", + "constantNumberLess.$": "$.heap64", + "constantNumberLessEquals.$": "$.heap72", + "constantNumberNotEquals.$": "$.heap56", + "constantStringEquals.$": "$.heap0", + "constantStringGreater.$": "$.heap32", + "constantStringGreaterEquals.$": "$.heap40", + "constantStringLess.$": "$.heap16", + "constantStringLessEquals.$": "$.heap24", + "constantStringNotEquals.$": "$.heap8", + "constantToVarBooleanEquals.$": "$.heap98", + "constantToVarBooleanNotEquals.$": "$.heap106", + "constantToVarNullEquals.$": "$.heap114", + "constantToVarNullNotEquals.$": "$.heap122", + "constantToVarNumberEquals.$": "$.heap50", + "constantToVarNumberGreater.$": "$.heap82", + "constantToVarNumberGreaterEquals.$": "$.heap90", + "constantToVarNumberLess.$": "$.heap66", + "constantToVarNumberLessEquals.$": "$.heap74", + "constantToVarNumberNotEquals.$": "$.heap58", + "constantToVarStringEquals.$": "$.heap2", + "constantToVarStringGreater.$": "$.heap34", + "constantToVarStringGreaterEquals.$": "$.heap42", + "constantToVarStringLess.$": "$.heap18", + "constantToVarStringLessEquals.$": "$.heap26", + "constantToVarStringNotEquals.$": "$.heap10", + "nullEqualEqualsUndefined.$": "$.heap152", + "nullEqualEqualsUndefinedVar.$": "$.heap216", + "nullEqualsUndefined.$": "$.heap154", + "nullEqualsUndefinedVar.$": "$.heap218", + "nullNotEqualEqualsUndefined.$": "$.heap156", + "nullNotEqualEqualsUndefinedVar.$": "$.heap220", + "nullNotEqualsUndefined.$": "$.heap158", + "nullNotEqualsUndefinedVar.$": "$.heap222", + "nullVarEqualEqualsNumber.$": "$.heap204", + "nullVarEqualEqualsNumberVar.$": "$.heap264", + "nullVarEqualEqualsString.$": "$.heap188", + "nullVarEqualEqualsStringVar.$": "$.heap248", + "nullVarEqualsNumber.$": "$.heap206", + "nullVarEqualsNumberVar.$": "$.heap266", + "nullVarEqualsString.$": "$.heap190", + "nullVarEqualsStringVar.$": "$.heap250", + "nullVarNotEqualEqualsNumber.$": "$.heap208", + "nullVarNotEqualEqualsNumberVar.$": "$.heap268", + "nullVarNotEqualEqualsString.$": "$.heap192", + "nullVarNotEqualEqualsStringVar.$": "$.heap252", + "nullVarNotEqualsNumber.$": "$.heap210", "nullVarNotEqualsNumberVar.$": "$.heap270", - "nullVarNotEqualsString.$": "$.heap195", - "nullVarNotEqualsStringVar.$": "$.heap255", - "objNotPresentFalse.$": "$.heap143", - "undefinedVarEqualEqualsNull.$": "$.heap173", - "undefinedVarEqualEqualsNullVar.$": "$.heap233", - "undefinedVarEqualEqualsNumber.$": "$.heap197", - "undefinedVarEqualEqualsNumberVar.$": "$.heap257", - "undefinedVarEqualEqualsString.$": "$.heap181", - "undefinedVarEqualEqualsStringVar.$": "$.heap241", - "undefinedVarEqualEqualsUndefined.$": "$.heap161", - "undefinedVarEqualEqualsUndefinedVar.$": "$.heap225", - "undefinedVarEqualsNull.$": "$.heap175", - "undefinedVarEqualsNullVar.$": "$.heap235", - "undefinedVarEqualsNumber.$": "$.heap199", - "undefinedVarEqualsNumberVar.$": "$.heap259", - "undefinedVarEqualsString.$": "$.heap183", - "undefinedVarEqualsStringVar.$": "$.heap243", - "undefinedVarEqualsUndefined.$": "$.heap163", - "undefinedVarEqualsUndefinedVar.$": "$.heap227", - "undefinedVarNotEqualEqualsNull.$": "$.heap177", - "undefinedVarNotEqualEqualsNullVar.$": "$.heap237", - "undefinedVarNotEqualEqualsNumber.$": "$.heap201", - "undefinedVarNotEqualEqualsNumberVar.$": "$.heap261", - "undefinedVarNotEqualEqualsString.$": "$.heap185", - "undefinedVarNotEqualEqualsStringVar.$": "$.heap245", - "undefinedVarNotEqualEqualsUndefined.$": "$.heap165", - "undefinedVarNotEqualEqualsUndefinedVar.$": "$.heap229", - "undefinedVarNotEqualsNull.$": "$.heap179", - "undefinedVarNotEqualsNullVar.$": "$.heap239", - "undefinedVarNotEqualsNumber.$": "$.heap203", - "undefinedVarNotEqualsNumberVar.$": "$.heap263", - "undefinedVarNotEqualsString.$": "$.heap187", - "undefinedVarNotEqualsStringVar.$": "$.heap247", - "undefinedVarNotEqualsUndefined.$": "$.heap167", - "undefinedVarNotEqualsUndefinedVar.$": "$.heap231", - "varEqualEqualsUndefined.$": "$.heap145", - "varEqualEqualsUndefinedVar.$": "$.heap169", - "varEqualsUndefined.$": "$.heap147", - "varEqualsUndefinedVar.$": "$.heap171", - "varNot.$": "$.heap135", - "varNotEqualEqualsUndefined.$": "$.heap149", - "varNotEqualEqualsUndefinedVar.$": "$.heap213", - "varNotEqualsUndefined.$": "$.heap151", - "varNotEqualsUndefinedVar.$": "$.heap215", - "varNotNullFalse.$": "$.heap139", - "varNotPresentFalse.$": "$.heap141", - "varNotPresentTrue.$": "$.heap137", - "varToConstantBooleanEquals.$": "$.heap101", - "varToConstantBooleanNotEquals.$": "$.heap109", - "varToConstantNullEquals.$": "$.heap117", - "varToConstantNullNotEquals.$": "$.heap125", - "varToConstantNumberEquals.$": "$.heap53", - "varToConstantNumberGreater.$": "$.heap85", - "varToConstantNumberGreaterEquals.$": "$.heap93", - "varToConstantNumberLess.$": "$.heap69", - "varToConstantNumberLessEquals.$": "$.heap77", - "varToConstantNumberNotEquals.$": "$.heap61", - "varToConstantStringEquals.$": "$.heap5", - "varToConstantStringGreater.$": "$.heap37", - "varToConstantStringGreaterEquals.$": "$.heap45", - "varToConstantStringLess.$": "$.heap21", - "varToConstantStringLessEquals.$": "$.heap29", - "varToConstantStringNotEquals.$": "$.heap13", - "varToVarBooleanEquals.$": "$.heap103", - "varToVarBooleanNotEquals.$": "$.heap111", - "varToVarNullEquals.$": "$.heap119", - "varToVarNullNotEquals.$": "$.heap127", - "varToVarNumberEquals.$": "$.heap55", - "varToVarNumberGreaterE.$": "$.heap87", - "varToVarNumberGreaterEquals.$": "$.heap95", - "varToVarNumberLess.$": "$.heap71", - "varToVarNumberLessEquals.$": "$.heap79", - "varToVarNumberNotEquals.$": "$.heap63", - "varToVarStringEquals.$": "$.heap7", - "varToVarStringGreaterE.$": "$.heap39", - "varToVarStringGreaterEquals.$": "$.heap47", - "varToVarStringLess.$": "$.heap23", - "varToVarStringLessEquals.$": "$.heap31", - "varToVarStringNotEquals.$": "$.heap15", + "nullVarNotEqualsString.$": "$.heap194", + "nullVarNotEqualsStringVar.$": "$.heap254", + "objNotPresentFalse.$": "$.heap142", + "undefinedVarEqualEqualsNull.$": "$.heap172", + "undefinedVarEqualEqualsNullVar.$": "$.heap232", + "undefinedVarEqualEqualsNumber.$": "$.heap196", + "undefinedVarEqualEqualsNumberVar.$": "$.heap256", + "undefinedVarEqualEqualsString.$": "$.heap180", + "undefinedVarEqualEqualsStringVar.$": "$.heap240", + "undefinedVarEqualEqualsUndefined.$": "$.heap160", + "undefinedVarEqualEqualsUndefinedVar.$": "$.heap224", + "undefinedVarEqualsNull.$": "$.heap174", + "undefinedVarEqualsNullVar.$": "$.heap234", + "undefinedVarEqualsNumber.$": "$.heap198", + "undefinedVarEqualsNumberVar.$": "$.heap258", + "undefinedVarEqualsString.$": "$.heap182", + "undefinedVarEqualsStringVar.$": "$.heap242", + "undefinedVarEqualsUndefined.$": "$.heap162", + "undefinedVarEqualsUndefinedVar.$": "$.heap226", + "undefinedVarNotEqualEqualsNull.$": "$.heap176", + "undefinedVarNotEqualEqualsNullVar.$": "$.heap236", + "undefinedVarNotEqualEqualsNumber.$": "$.heap200", + "undefinedVarNotEqualEqualsNumberVar.$": "$.heap260", + "undefinedVarNotEqualEqualsString.$": "$.heap184", + "undefinedVarNotEqualEqualsStringVar.$": "$.heap244", + "undefinedVarNotEqualEqualsUndefined.$": "$.heap164", + "undefinedVarNotEqualEqualsUndefinedVar.$": "$.heap228", + "undefinedVarNotEqualsNull.$": "$.heap178", + "undefinedVarNotEqualsNullVar.$": "$.heap238", + "undefinedVarNotEqualsNumber.$": "$.heap202", + "undefinedVarNotEqualsNumberVar.$": "$.heap262", + "undefinedVarNotEqualsString.$": "$.heap186", + "undefinedVarNotEqualsStringVar.$": "$.heap246", + "undefinedVarNotEqualsUndefined.$": "$.heap166", + "undefinedVarNotEqualsUndefinedVar.$": "$.heap230", + "varEqualEqualsUndefined.$": "$.heap144", + "varEqualEqualsUndefinedVar.$": "$.heap168", + "varEqualsUndefined.$": "$.heap146", + "varEqualsUndefinedVar.$": "$.heap170", + "varNot.$": "$.heap134", + "varNotEqualEqualsUndefined.$": "$.heap148", + "varNotEqualEqualsUndefinedVar.$": "$.heap212", + "varNotEqualsUndefined.$": "$.heap150", + "varNotEqualsUndefinedVar.$": "$.heap214", + "varNotNullFalse.$": "$.heap138", + "varNotPresentFalse.$": "$.heap140", + "varNotPresentTrue.$": "$.heap136", + "varToConstantBooleanEquals.$": "$.heap100", + "varToConstantBooleanNotEquals.$": "$.heap108", + "varToConstantNullEquals.$": "$.heap116", + "varToConstantNullNotEquals.$": "$.heap124", + "varToConstantNumberEquals.$": "$.heap52", + "varToConstantNumberGreater.$": "$.heap84", + "varToConstantNumberGreaterEquals.$": "$.heap92", + "varToConstantNumberLess.$": "$.heap68", + "varToConstantNumberLessEquals.$": "$.heap76", + "varToConstantNumberNotEquals.$": "$.heap60", + "varToConstantStringEquals.$": "$.heap4", + "varToConstantStringGreater.$": "$.heap36", + "varToConstantStringGreaterEquals.$": "$.heap44", + "varToConstantStringLess.$": "$.heap20", + "varToConstantStringLessEquals.$": "$.heap28", + "varToConstantStringNotEquals.$": "$.heap12", + "varToVarBooleanEquals.$": "$.heap102", + "varToVarBooleanNotEquals.$": "$.heap110", + "varToVarNullEquals.$": "$.heap118", + "varToVarNullNotEquals.$": "$.heap126", + "varToVarNumberEquals.$": "$.heap54", + "varToVarNumberGreaterE.$": "$.heap86", + "varToVarNumberGreaterEquals.$": "$.heap94", + "varToVarNumberLess.$": "$.heap70", + "varToVarNumberLessEquals.$": "$.heap78", + "varToVarNumberNotEquals.$": "$.heap62", + "varToVarStringEquals.$": "$.heap6", + "varToVarStringGreaterE.$": "$.heap38", + "varToVarStringGreaterEquals.$": "$.heap46", + "varToVarStringLess.$": "$.heap22", + "varToVarStringLessEquals.$": "$.heap30", + "varToVarStringNotEquals.$": "$.heap14", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in 1": { - "InputPath": "$.heap0", - "Next": "input.v === "val"", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "201__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap200", - "Next": "input.undN != 1", - "ResultPath": "$.heap201", - "Type": "Pass", - }, - "203__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap202", - "Next": "input.nv === 1", - "ResultPath": "$.heap203", - "Type": "Pass", - }, - "205__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap204", - "Next": "input.nv == 1", - "ResultPath": "$.heap205", - "Type": "Pass", - }, - "207__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap206", - "Next": "input.nv !== 1", - "ResultPath": "$.heap207", - "Type": "Pass", - }, - "209__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap208", - "Next": "input.nv != 1", - "ResultPath": "$.heap209", - "Type": "Pass", + "3 !== input.n": { + "Choices": [ + { + "Next": "true__3 !== input.n", + "Not": { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.n", + }, + { + "NumericEquals": 3, + "Variable": "$.input.n", + }, + ], + }, + ], + }, + ], + }, + }, + ], + "Default": "false__3 !== input.n", + "Type": "Choice", }, - "211__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap210", - "Next": "input.v !== obj.und", - "ResultPath": "$.heap211", - "Type": "Pass", + "3 < input.n": { + "Choices": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.n", + }, + { + "NumericGreaterThan": 3, + "Variable": "$.input.n", + }, + ], + }, + ], + }, + ], + "Next": "true__3 < input.n", + }, + ], + "Default": "false__3 < input.n", + "Type": "Choice", }, - "213__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap212", - "Next": "input.v != obj.und", - "ResultPath": "$.heap213", - "Type": "Pass", - }, - "215__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap214", - "Next": "input.nv === obj.und", - "ResultPath": "$.heap215", - "Type": "Pass", - }, - "217__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap216", - "Next": "input.nv == obj.und", - "ResultPath": "$.heap217", - "Type": "Pass", - }, - "219__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap218", - "Next": "input.nv === obj.und 1", - "ResultPath": "$.heap219", - "Type": "Pass", - }, - "21__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap20", - "Next": "input.v < input.v", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "221__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap220", - "Next": "input.nv == obj.und 1", - "ResultPath": "$.heap221", - "Type": "Pass", - }, - "223__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap222", - "Next": "input.und === obj.und", - "ResultPath": "$.heap223", - "Type": "Pass", - }, - "225__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap224", - "Next": "input.und == obj.und", - "ResultPath": "$.heap225", - "Type": "Pass", - }, - "227__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap226", - "Next": "input.und !== obj.und", - "ResultPath": "$.heap227", - "Type": "Pass", - }, - "229__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap228", - "Next": "input.und != obj.und", - "ResultPath": "$.heap229", - "Type": "Pass", - }, - "231__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap230", - "Next": "input.und === obj.nv", - "ResultPath": "$.heap231", - "Type": "Pass", - }, - "233__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap232", - "Next": "input.und == obj.nv", - "ResultPath": "$.heap233", - "Type": "Pass", - }, - "235__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap234", - "Next": "input.und !== obj.nv", - "ResultPath": "$.heap235", - "Type": "Pass", - }, - "237__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap236", - "Next": "input.und != obj.nv", - "ResultPath": "$.heap237", - "Type": "Pass", - }, - "239__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap238", - "Next": "input.und === input.v", - "ResultPath": "$.heap239", - "Type": "Pass", - }, - "23__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap22", - "Next": ""a" <= "a"", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "241__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap240", - "Next": "input.und == input.v", - "ResultPath": "$.heap241", - "Type": "Pass", - }, - "243__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap242", - "Next": "input.und !== input.v", - "ResultPath": "$.heap243", - "Type": "Pass", - }, - "245__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap244", - "Next": "input.und != input.v", - "ResultPath": "$.heap245", - "Type": "Pass", - }, - "247__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap246", - "Next": "input.nv === input.v", - "ResultPath": "$.heap247", - "Type": "Pass", - }, - "249__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap248", - "Next": "input.nv == input.v", - "ResultPath": "$.heap249", - "Type": "Pass", - }, - "251__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap250", - "Next": "input.nv !== input.v", - "ResultPath": "$.heap251", - "Type": "Pass", - }, - "253__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap252", - "Next": "input.nv != input.v", - "ResultPath": "$.heap253", - "Type": "Pass", - }, - "255__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap254", - "Next": "input.undN === input.n", - "ResultPath": "$.heap255", - "Type": "Pass", - }, - "257__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap256", - "Next": "input.undN == input.n", - "ResultPath": "$.heap257", - "Type": "Pass", - }, - "259__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap258", - "Next": "input.undN !== input.n", - "ResultPath": "$.heap259", - "Type": "Pass", - }, - "25__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap24", - "Next": "input.v <= "val2"", - "ResultPath": "$.heap25", - "Type": "Pass", - }, - "261__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap260", - "Next": "input.undN != input.n", - "ResultPath": "$.heap261", - "Type": "Pass", - }, - "263__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap262", - "Next": "input.nv === input.n", - "ResultPath": "$.heap263", - "Type": "Pass", - }, - "265__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap264", - "Next": "input.nv == input.n", - "ResultPath": "$.heap265", - "Type": "Pass", - }, - "267__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap266", - "Next": "input.nv !== input.n", - "ResultPath": "$.heap267", - "Type": "Pass", - }, - "269__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ": { - "InputPath": "$.heap268", - "Next": "input.nv != input.n", - "ResultPath": "$.heap269", - "Type": "Pass", - }, - "27__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap26", - "Next": ""val2" <= input.v", - "ResultPath": "$.heap27", - "Type": "Pass", - }, - "29__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap28", - "Next": "input.v <= input.v", - "ResultPath": "$.heap29", - "Type": "Pass", - }, - "3 !== input.n": { - "Choices": [ - { - "Next": "true__3 !== input.n", - "Not": { - "And": [ - { - "IsPresent": true, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNull": false, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.input.n", - }, - { - "NumericEquals": 3, - "Variable": "$.input.n", - }, - ], - }, - ], - }, - ], - }, - }, - ], - "Default": "false__3 !== input.n", - "Type": "Choice", - }, - "3 < input.n": { - "Choices": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNull": false, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.input.n", - }, - { - "NumericGreaterThan": 3, - "Variable": "$.input.n", - }, - ], - }, - ], - }, - ], - "Next": "true__3 < input.n", - }, - ], - "Default": "false__3 < input.n", - "Type": "Choice", - }, - "3 <= input.n": { - "Choices": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNull": false, - "Variable": "$.input.n", - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.input.n", - }, - { - "NumericGreaterThanEquals": 3, - "Variable": "$.input.n", - }, - ], - }, - ], - }, - ], - "Next": "true__3 <= input.n", - }, - ], - "Default": "false__3 <= input.n", - "Type": "Choice", + "3 <= input.n": { + "Choices": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.n", + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.n", + }, + { + "NumericGreaterThanEquals": 3, + "Variable": "$.input.n", + }, + ], + }, + ], + }, + ], + "Next": "true__3 <= input.n", + }, + ], + "Default": "false__3 <= input.n", + "Type": "Choice", }, "3 === input.n": { "Choices": [ @@ -3878,240 +3171,6 @@ exports[`binary and unary comparison 1`] = ` "Default": "false__3 >= input.n", "Type": "Choice", }, - "31__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap30", - "Next": ""a" > "a"", - "ResultPath": "$.heap31", - "Type": "Pass", - }, - "33__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap32", - "Next": "input.v > "val2"", - "ResultPath": "$.heap33", - "Type": "Pass", - }, - "35__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap34", - "Next": ""val2" > input.v", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "37__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap36", - "Next": "input.v > input.v", - "ResultPath": "$.heap37", - "Type": "Pass", - }, - "39__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap38", - "Next": ""a" >= "a"", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "3__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in": { - "InputPath": "$.heap2", - "Next": ""val2" === input.v", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "41__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap40", - "Next": "input.v >= "val2"", - "ResultPath": "$.heap41", - "Type": "Pass", - }, - "43__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap42", - "Next": ""val2" >= input.v", - "ResultPath": "$.heap43", - "Type": "Pass", - }, - "45__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap44", - "Next": "input.v >= input.v", - "ResultPath": "$.heap45", - "Type": "Pass", - }, - "47__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap46", - "Next": "1 === 1", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "49__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap48", - "Next": "input.n === 2", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "51__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap50", - "Next": "3 === input.n", - "ResultPath": "$.heap51", - "Type": "Pass", - }, - "53__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap52", - "Next": "input.n === input.n", - "ResultPath": "$.heap53", - "Type": "Pass", - }, - "55__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap54", - "Next": "1 !== 1", - "ResultPath": "$.heap55", - "Type": "Pass", - }, - "57__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap56", - "Next": "input.n !== 2", - "ResultPath": "$.heap57", - "Type": "Pass", - }, - "59__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap58", - "Next": "3 !== input.n", - "ResultPath": "$.heap59", - "Type": "Pass", - }, - "5__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in": { - "InputPath": "$.heap4", - "Next": "input.v === input.v", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "61__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap60", - "Next": "input.n !== input.n", - "ResultPath": "$.heap61", - "Type": "Pass", - }, - "63__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap62", - "Next": "1 < 1", - "ResultPath": "$.heap63", - "Type": "Pass", - }, - "65__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap64", - "Next": "input.n < 3", - "ResultPath": "$.heap65", - "Type": "Pass", - }, - "67__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap66", - "Next": "3 < input.n", - "ResultPath": "$.heap67", - "Type": "Pass", - }, - "69__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap68", - "Next": "input.n < input.n", - "ResultPath": "$.heap69", - "Type": "Pass", - }, - "71__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap70", - "Next": "1 <= 1", - "ResultPath": "$.heap71", - "Type": "Pass", - }, - "73__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap72", - "Next": "input.n <= 3", - "ResultPath": "$.heap73", - "Type": "Pass", - }, - "75__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap74", - "Next": "3 <= input.n", - "ResultPath": "$.heap75", - "Type": "Pass", - }, - "77__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap76", - "Next": "input.n <= input.n", - "ResultPath": "$.heap77", - "Type": "Pass", - }, - "79__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap78", - "Next": "1 > 1", - "ResultPath": "$.heap79", - "Type": "Pass", - }, - "7__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in": { - "InputPath": "$.heap6", - "Next": ""a" !== "a"", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "81__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap80", - "Next": "input.n > 3", - "ResultPath": "$.heap81", - "Type": "Pass", - }, - "83__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap82", - "Next": "3 > input.n", - "ResultPath": "$.heap83", - "Type": "Pass", - }, - "85__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap84", - "Next": "input.n > input.n", - "ResultPath": "$.heap85", - "Type": "Pass", - }, - "87__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap86", - "Next": "1 >= 1", - "ResultPath": "$.heap87", - "Type": "Pass", - }, - "89__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap88", - "Next": "input.n >= 3", - "ResultPath": "$.heap89", - "Type": "Pass", - }, - "91__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap90", - "Next": "3 >= input.n", - "ResultPath": "$.heap91", - "Type": "Pass", - }, - "93__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap92", - "Next": "input.n >= input.n", - "ResultPath": "$.heap93", - "Type": "Pass", - }, - "95__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap94", - "Next": "true === true", - "ResultPath": "$.heap95", - "Type": "Pass", - }, - "97__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap96", - "Next": "input.a === true", - "ResultPath": "$.heap97", - "Type": "Pass", - }, - "99__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i": { - "InputPath": "$.heap98", - "Next": "false === input.a", - "ResultPath": "$.heap99", - "Type": "Pass", - }, - "9__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in": { - "InputPath": "$.heap8", - "Next": "input.v !== "val"", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "obj = {nv: null}", "Parameters": { @@ -4196,307 +3255,307 @@ exports[`binary and unary comparison 1`] = ` "Type": "Choice", }, "false__!false": { - "Next": "133__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.a", "Result": false, "ResultPath": "$.heap132", "Type": "Pass", }, "false__!input.a": { - "Next": "135__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.nv", "Result": false, "ResultPath": "$.heap134", "Type": "Pass", }, "false__!input.n": { - "Next": "139__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.x", "Result": false, "ResultPath": "$.heap138", "Type": "Pass", }, "false__!input.nv": { - "Next": "137__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.n", "Result": false, "ResultPath": "$.heap136", "Type": "Pass", }, "false__!input.obj": { - "Next": "143__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === undefined", "Result": false, "ResultPath": "$.heap142", "Type": "Pass", }, "false__!input.x": { - "Next": "141__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.obj", "Result": false, "ResultPath": "$.heap140", "Type": "Pass", }, "false__"a" !== "a"": { - "Next": "9__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": "input.v !== "val"", "Result": false, "ResultPath": "$.heap8", "Type": "Pass", }, "false__"a" < "a"": { - "Next": "17__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v < "val2"", "Result": false, "ResultPath": "$.heap16", "Type": "Pass", }, "false__"a" <= "a"": { - "Next": "25__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v <= "val2"", "Result": false, "ResultPath": "$.heap24", "Type": "Pass", }, "false__"a" > "a"": { - "Next": "33__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v > "val2"", "Result": false, "ResultPath": "$.heap32", "Type": "Pass", }, "false__"a" >= "a"": { - "Next": "41__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v >= "val2"", "Result": false, "ResultPath": "$.heap40", "Type": "Pass", }, "false__"a" in input.obj": { - "Next": "129__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": ""b" in input.obj", "Result": false, "ResultPath": "$.heap128", "Type": "Pass", }, "false__"b" in input.obj": { - "Next": "131__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!false", "Result": false, "ResultPath": "$.heap130", "Type": "Pass", }, "false__"val2" !== input.v": { - "Next": "13__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v !== input.v", "Result": false, "ResultPath": "$.heap12", "Type": "Pass", }, "false__"val2" < input.v": { - "Next": "21__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v < input.v", "Result": false, "ResultPath": "$.heap20", "Type": "Pass", }, "false__"val2" <= input.v": { - "Next": "29__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v <= input.v", "Result": false, "ResultPath": "$.heap28", "Type": "Pass", }, "false__"val2" === input.v": { - "Next": "5__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": "input.v === input.v", "Result": false, "ResultPath": "$.heap4", "Type": "Pass", }, "false__"val2" > input.v": { - "Next": "37__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v > input.v", "Result": false, "ResultPath": "$.heap36", "Type": "Pass", }, "false__"val2" >= input.v": { - "Next": "45__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v >= input.v", "Result": false, "ResultPath": "$.heap44", "Type": "Pass", }, "false__1 !== 1": { - "Next": "57__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n !== 2", "Result": false, "ResultPath": "$.heap56", "Type": "Pass", }, "false__1 < 1": { - "Next": "65__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n < 3", "Result": false, "ResultPath": "$.heap64", "Type": "Pass", }, "false__1 <= 1": { - "Next": "73__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n <= 3", "Result": false, "ResultPath": "$.heap72", "Type": "Pass", }, "false__1 === 1": { - "Next": "49__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n === 2", "Result": false, "ResultPath": "$.heap48", "Type": "Pass", }, "false__1 > 1": { - "Next": "81__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n > 3", "Result": false, "ResultPath": "$.heap80", "Type": "Pass", }, "false__1 >= 1": { - "Next": "89__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n >= 3", "Result": false, "ResultPath": "$.heap88", "Type": "Pass", }, "false__3 !== input.n": { - "Next": "61__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n !== input.n", "Result": false, "ResultPath": "$.heap60", "Type": "Pass", }, "false__3 < input.n": { - "Next": "69__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n < input.n", "Result": false, "ResultPath": "$.heap68", "Type": "Pass", }, "false__3 <= input.n": { - "Next": "77__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n <= input.n", "Result": false, "ResultPath": "$.heap76", "Type": "Pass", }, "false__3 === input.n": { - "Next": "53__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n === input.n", "Result": false, "ResultPath": "$.heap52", "Type": "Pass", }, "false__3 > input.n": { - "Next": "85__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n > input.n", "Result": false, "ResultPath": "$.heap84", "Type": "Pass", }, "false__3 >= input.n": { - "Next": "93__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n >= input.n", "Result": false, "ResultPath": "$.heap92", "Type": "Pass", }, "false__false !== input.a": { - "Next": "109__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a !== input.a", "Result": false, "ResultPath": "$.heap108", "Type": "Pass", }, "false__false === input.a": { - "Next": "101__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a === input.a", "Result": false, "ResultPath": "$.heap100", "Type": "Pass", }, "false__input.a !== input.a": { - "Next": "111__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "null === null", "Result": false, "ResultPath": "$.heap110", "Type": "Pass", }, "false__input.a !== true": { - "Next": "107__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "false !== input.a", "Result": false, "ResultPath": "$.heap106", "Type": "Pass", }, "false__input.a === input.a": { - "Next": "103__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "true !== true", "Result": false, "ResultPath": "$.heap102", "Type": "Pass", }, "false__input.a === true": { - "Next": "99__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "false === input.a", "Result": false, "ResultPath": "$.heap98", "Type": "Pass", }, "false__input.n !== 2": { - "Next": "59__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 !== input.n", "Result": false, "ResultPath": "$.heap58", "Type": "Pass", }, "false__input.n !== input.n": { - "Next": "63__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 < 1", "Result": false, "ResultPath": "$.heap62", "Type": "Pass", }, "false__input.n < 3": { - "Next": "67__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 < input.n", "Result": false, "ResultPath": "$.heap66", "Type": "Pass", }, "false__input.n < input.n": { - "Next": "71__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 <= 1", "Result": false, "ResultPath": "$.heap70", "Type": "Pass", }, "false__input.n <= 3": { - "Next": "75__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 <= input.n", "Result": false, "ResultPath": "$.heap74", "Type": "Pass", }, "false__input.n <= input.n": { - "Next": "79__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 > 1", "Result": false, "ResultPath": "$.heap78", "Type": "Pass", }, "false__input.n === 2": { - "Next": "51__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 === input.n", "Result": false, "ResultPath": "$.heap50", "Type": "Pass", }, "false__input.n === input.n": { - "Next": "55__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 !== 1", "Result": false, "ResultPath": "$.heap54", "Type": "Pass", }, "false__input.n > 3": { - "Next": "83__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 > input.n", "Result": false, "ResultPath": "$.heap82", "Type": "Pass", }, "false__input.n > input.n": { - "Next": "87__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 >= 1", "Result": false, "ResultPath": "$.heap86", "Type": "Pass", }, "false__input.n >= 3": { - "Next": "91__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 >= input.n", "Result": false, "ResultPath": "$.heap90", "Type": "Pass", }, "false__input.n >= input.n": { - "Next": "95__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "true === true", "Result": false, "ResultPath": "$.heap94", "Type": "Pass", }, "false__input.nv != "hello"": { - "Next": "195__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN === 1", "Result": false, "ResultPath": "$.heap194", "Type": "Pass", }, "false__input.nv != 1": { - "Next": "211__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== obj.und", "Result": false, "ResultPath": "$.heap210", "Type": "Pass", @@ -4508,505 +3567,505 @@ exports[`binary and unary comparison 1`] = ` "Type": "Pass", }, "false__input.nv != input.v": { - "Next": "255__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN === input.n", "Result": false, "ResultPath": "$.heap254", "Type": "Pass", }, "false__input.nv !== "hello"": { - "Next": "193__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != "hello"", "Result": false, "ResultPath": "$.heap192", "Type": "Pass", }, "false__input.nv !== 1": { - "Next": "209__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != 1", "Result": false, "ResultPath": "$.heap208", "Type": "Pass", }, "false__input.nv !== input.n": { - "Next": "269__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != input.n", "Result": false, "ResultPath": "$.heap268", "Type": "Pass", }, "false__input.nv !== input.nv": { - "Next": "127__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": ""a" in input.obj", "Result": false, "ResultPath": "$.heap126", "Type": "Pass", }, "false__input.nv !== input.v": { - "Next": "253__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != input.v", "Result": false, "ResultPath": "$.heap252", "Type": "Pass", }, "false__input.nv !== null": { - "Next": "123__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== input.nv", "Result": false, "ResultPath": "$.heap122", "Type": "Pass", }, "false__input.nv == "hello"": { - "Next": "191__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== "hello"", "Result": false, "ResultPath": "$.heap190", "Type": "Pass", }, "false__input.nv == 1": { - "Next": "207__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== 1", "Result": false, "ResultPath": "$.heap206", "Type": "Pass", }, "false__input.nv == input.n": { - "Next": "267__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.n", "Result": false, "ResultPath": "$.heap266", "Type": "Pass", }, "false__input.nv == input.v": { - "Next": "251__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.v", "Result": false, "ResultPath": "$.heap250", "Type": "Pass", }, "false__input.nv == obj.und": { - "Next": "219__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === obj.und 1", "Result": false, "ResultPath": "$.heap218", "Type": "Pass", }, "false__input.nv == obj.und 1": { - "Next": "223__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === obj.und", "Result": false, "ResultPath": "$.heap222", "Type": "Pass", }, "false__input.nv == undefined": { - "Next": "155__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === undefined 1", "Result": false, "ResultPath": "$.heap154", "Type": "Pass", }, "false__input.nv == undefined 1": { - "Next": "159__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === undefined", "Result": false, "ResultPath": "$.heap158", "Type": "Pass", }, "false__input.nv === "hello"": { - "Next": "189__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == "hello"", "Result": false, "ResultPath": "$.heap188", "Type": "Pass", }, "false__input.nv === 1": { - "Next": "205__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == 1", "Result": false, "ResultPath": "$.heap204", "Type": "Pass", }, "false__input.nv === input.n": { - "Next": "265__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == input.n", "Result": false, "ResultPath": "$.heap264", "Type": "Pass", }, "false__input.nv === input.nv": { - "Next": "119__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "null !== null", "Result": false, "ResultPath": "$.heap118", "Type": "Pass", }, "false__input.nv === input.v": { - "Next": "249__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == input.v", "Result": false, "ResultPath": "$.heap248", "Type": "Pass", }, "false__input.nv === null": { - "Next": "115__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === input.nv", "Result": false, "ResultPath": "$.heap114", "Type": "Pass", }, "false__input.nv === obj.und": { - "Next": "217__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == obj.und", "Result": false, "ResultPath": "$.heap216", "Type": "Pass", }, "false__input.nv === obj.und 1": { - "Next": "221__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == obj.und 1", "Result": false, "ResultPath": "$.heap220", "Type": "Pass", }, "false__input.nv === undefined": { - "Next": "153__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == undefined", "Result": false, "ResultPath": "$.heap152", "Type": "Pass", }, "false__input.nv === undefined 1": { - "Next": "157__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == undefined 1", "Result": false, "ResultPath": "$.heap156", "Type": "Pass", }, "false__input.und != "hello"": { - "Next": "187__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === "hello"", "Result": false, "ResultPath": "$.heap186", "Type": "Pass", }, "false__input.und != input.v": { - "Next": "247__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.v", "Result": false, "ResultPath": "$.heap246", "Type": "Pass", }, "false__input.und != null": { - "Next": "179__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === "hello"", "Result": false, "ResultPath": "$.heap178", "Type": "Pass", }, "false__input.und != obj.nv": { - "Next": "239__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === input.v", "Result": false, "ResultPath": "$.heap238", "Type": "Pass", }, "false__input.und != obj.und": { - "Next": "231__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === obj.nv", "Result": false, "ResultPath": "$.heap230", "Type": "Pass", }, "false__input.und != undefined": { - "Next": "167__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === undefined 1", "Result": false, "ResultPath": "$.heap166", "Type": "Pass", }, "false__input.und !== "hello"": { - "Next": "185__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != "hello"", "Result": false, "ResultPath": "$.heap184", "Type": "Pass", }, "false__input.und !== input.v": { - "Next": "245__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != input.v", "Result": false, "ResultPath": "$.heap244", "Type": "Pass", }, "false__input.und !== null": { - "Next": "177__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != null", "Result": false, "ResultPath": "$.heap176", "Type": "Pass", }, "false__input.und !== obj.nv": { - "Next": "237__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != obj.nv", "Result": false, "ResultPath": "$.heap236", "Type": "Pass", }, "false__input.und !== obj.und": { - "Next": "229__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != obj.und", "Result": false, "ResultPath": "$.heap228", "Type": "Pass", }, "false__input.und !== undefined": { - "Next": "165__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != undefined", "Result": false, "ResultPath": "$.heap164", "Type": "Pass", }, "false__input.und == "hello"": { - "Next": "183__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== "hello"", "Result": false, "ResultPath": "$.heap182", "Type": "Pass", }, "false__input.und == input.v": { - "Next": "243__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== input.v", "Result": false, "ResultPath": "$.heap242", "Type": "Pass", }, "false__input.und == null": { - "Next": "175__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== null", "Result": false, "ResultPath": "$.heap174", "Type": "Pass", }, "false__input.und == obj.nv": { - "Next": "235__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== obj.nv", "Result": false, "ResultPath": "$.heap234", "Type": "Pass", }, "false__input.und == obj.und": { - "Next": "227__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== obj.und", "Result": false, "ResultPath": "$.heap226", "Type": "Pass", }, "false__input.und == undefined": { - "Next": "163__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== undefined", "Result": false, "ResultPath": "$.heap162", "Type": "Pass", }, "false__input.und === "hello"": { - "Next": "181__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == "hello"", "Result": false, "ResultPath": "$.heap180", "Type": "Pass", }, "false__input.und === input.v": { - "Next": "241__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == input.v", "Result": false, "ResultPath": "$.heap240", "Type": "Pass", }, "false__input.und === null": { - "Next": "173__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == null", "Result": false, "ResultPath": "$.heap172", "Type": "Pass", }, "false__input.und === obj.nv": { - "Next": "233__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == obj.nv", "Result": false, "ResultPath": "$.heap232", "Type": "Pass", }, "false__input.und === obj.und": { - "Next": "225__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == obj.und", "Result": false, "ResultPath": "$.heap224", "Type": "Pass", }, "false__input.und === undefined": { - "Next": "161__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == undefined", "Result": false, "ResultPath": "$.heap160", "Type": "Pass", }, "false__input.undN != 1": { - "Next": "203__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === 1", "Result": false, "ResultPath": "$.heap202", "Type": "Pass", }, "false__input.undN != input.n": { - "Next": "263__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.n", "Result": false, "ResultPath": "$.heap262", "Type": "Pass", }, "false__input.undN !== 1": { - "Next": "201__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN != 1", "Result": false, "ResultPath": "$.heap200", "Type": "Pass", }, "false__input.undN !== input.n": { - "Next": "261__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN != input.n", "Result": false, "ResultPath": "$.heap260", "Type": "Pass", }, "false__input.undN == 1": { - "Next": "199__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN !== 1", "Result": false, "ResultPath": "$.heap198", "Type": "Pass", }, "false__input.undN == input.n": { - "Next": "259__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN !== input.n", "Result": false, "ResultPath": "$.heap258", "Type": "Pass", }, "false__input.undN === 1": { - "Next": "197__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN == 1", "Result": false, "ResultPath": "$.heap196", "Type": "Pass", }, "false__input.undN === input.n": { - "Next": "257__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN == input.n", "Result": false, "ResultPath": "$.heap256", "Type": "Pass", }, "false__input.v != obj.und": { - "Next": "215__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === obj.und", "Result": false, "ResultPath": "$.heap214", "Type": "Pass", }, "false__input.v != undefined": { - "Next": "151__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === undefined", "Result": false, "ResultPath": "$.heap150", "Type": "Pass", }, "false__input.v !== "val"": { - "Next": "11__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" !== input.v", "Result": false, "ResultPath": "$.heap10", "Type": "Pass", }, "false__input.v !== input.nv": { - "Next": "125__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.nv", "Result": false, "ResultPath": "$.heap124", "Type": "Pass", }, "false__input.v !== input.v": { - "Next": "15__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" < "a"", "Result": false, "ResultPath": "$.heap14", "Type": "Pass", }, "false__input.v !== obj.und": { - "Next": "213__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v != obj.und", "Result": false, "ResultPath": "$.heap212", "Type": "Pass", }, "false__input.v !== undefined": { - "Next": "149__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v != undefined", "Result": false, "ResultPath": "$.heap148", "Type": "Pass", }, "false__input.v < "val2"": { - "Next": "19__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" < input.v", "Result": false, "ResultPath": "$.heap18", "Type": "Pass", }, "false__input.v < input.v": { - "Next": "23__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" <= "a"", "Result": false, "ResultPath": "$.heap22", "Type": "Pass", }, "false__input.v <= "val2"": { - "Next": "27__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" <= input.v", "Result": false, "ResultPath": "$.heap26", "Type": "Pass", }, "false__input.v <= input.v": { - "Next": "31__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" > "a"", "Result": false, "ResultPath": "$.heap30", "Type": "Pass", }, "false__input.v == undefined": { - "Next": "147__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== undefined", "Result": false, "ResultPath": "$.heap146", "Type": "Pass", }, "false__input.v == undefined 1": { - "Next": "171__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === null", "Result": false, "ResultPath": "$.heap170", "Type": "Pass", }, "false__input.v === "val"": { - "Next": "3__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": ""val2" === input.v", "Result": false, "ResultPath": "$.heap2", "Type": "Pass", }, "false__input.v === input.nv": { - "Next": "117__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.nv", "Result": false, "ResultPath": "$.heap116", "Type": "Pass", }, "false__input.v === input.v": { - "Next": "7__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": ""a" !== "a"", "Result": false, "ResultPath": "$.heap6", "Type": "Pass", }, "false__input.v === undefined": { - "Next": "145__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v == undefined", "Result": false, "ResultPath": "$.heap144", "Type": "Pass", }, "false__input.v === undefined 1": { - "Next": "169__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v == undefined 1", "Result": false, "ResultPath": "$.heap168", "Type": "Pass", }, "false__input.v > "val2"": { - "Next": "35__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" > input.v", "Result": false, "ResultPath": "$.heap34", "Type": "Pass", }, "false__input.v > input.v": { - "Next": "39__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" >= "a"", "Result": false, "ResultPath": "$.heap38", "Type": "Pass", }, "false__input.v >= "val2"": { - "Next": "43__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" >= input.v", "Result": false, "ResultPath": "$.heap42", "Type": "Pass", }, "false__input.v >= input.v": { - "Next": "47__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 === 1", "Result": false, "ResultPath": "$.heap46", "Type": "Pass", }, "false__null !== null": { - "Next": "121__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== null", "Result": false, "ResultPath": "$.heap120", "Type": "Pass", }, "false__null === null": { - "Next": "113__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === null", "Result": false, "ResultPath": "$.heap112", "Type": "Pass", }, "false__return {constantStringEquals: "a" === "a", constantToVarStringEquals": { - "Next": "1__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in 1", + "Next": "input.v === "val"", "Result": false, "ResultPath": "$.heap0", "Type": "Pass", }, "false__true !== true": { - "Next": "105__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a !== true", "Result": false, "ResultPath": "$.heap104", "Type": "Pass", }, "false__true === true": { - "Next": "97__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.a === true", "Result": false, "ResultPath": "$.heap96", "Type": "Pass", @@ -12085,307 +11144,307 @@ exports[`binary and unary comparison 1`] = ` "Type": "Choice", }, "true__!false": { - "Next": "133__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.a", "Result": true, "ResultPath": "$.heap132", "Type": "Pass", }, "true__!input.a": { - "Next": "135__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.nv", "Result": true, "ResultPath": "$.heap134", "Type": "Pass", }, "true__!input.n": { - "Next": "139__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.x", "Result": true, "ResultPath": "$.heap138", "Type": "Pass", }, "true__!input.nv": { - "Next": "137__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.n", "Result": true, "ResultPath": "$.heap136", "Type": "Pass", }, "true__!input.obj": { - "Next": "143__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === undefined", "Result": true, "ResultPath": "$.heap142", "Type": "Pass", }, "true__!input.x": { - "Next": "141__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!input.obj", "Result": true, "ResultPath": "$.heap140", "Type": "Pass", }, "true__"a" !== "a"": { - "Next": "9__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": "input.v !== "val"", "Result": true, "ResultPath": "$.heap8", "Type": "Pass", }, "true__"a" < "a"": { - "Next": "17__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v < "val2"", "Result": true, "ResultPath": "$.heap16", "Type": "Pass", }, "true__"a" <= "a"": { - "Next": "25__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v <= "val2"", "Result": true, "ResultPath": "$.heap24", "Type": "Pass", }, "true__"a" > "a"": { - "Next": "33__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v > "val2"", "Result": true, "ResultPath": "$.heap32", "Type": "Pass", }, "true__"a" >= "a"": { - "Next": "41__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v >= "val2"", "Result": true, "ResultPath": "$.heap40", "Type": "Pass", }, "true__"a" in input.obj": { - "Next": "129__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": ""b" in input.obj", "Result": true, "ResultPath": "$.heap128", "Type": "Pass", }, "true__"b" in input.obj": { - "Next": "131__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "!false", "Result": true, "ResultPath": "$.heap130", "Type": "Pass", }, "true__"val2" !== input.v": { - "Next": "13__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v !== input.v", "Result": true, "ResultPath": "$.heap12", "Type": "Pass", }, "true__"val2" < input.v": { - "Next": "21__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v < input.v", "Result": true, "ResultPath": "$.heap20", "Type": "Pass", }, "true__"val2" <= input.v": { - "Next": "29__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v <= input.v", "Result": true, "ResultPath": "$.heap28", "Type": "Pass", }, "true__"val2" === input.v": { - "Next": "5__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": "input.v === input.v", "Result": true, "ResultPath": "$.heap4", "Type": "Pass", }, "true__"val2" > input.v": { - "Next": "37__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v > input.v", "Result": true, "ResultPath": "$.heap36", "Type": "Pass", }, "true__"val2" >= input.v": { - "Next": "45__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.v >= input.v", "Result": true, "ResultPath": "$.heap44", "Type": "Pass", }, "true__1 !== 1": { - "Next": "57__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n !== 2", "Result": true, "ResultPath": "$.heap56", "Type": "Pass", }, "true__1 < 1": { - "Next": "65__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n < 3", "Result": true, "ResultPath": "$.heap64", "Type": "Pass", }, "true__1 <= 1": { - "Next": "73__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n <= 3", "Result": true, "ResultPath": "$.heap72", "Type": "Pass", }, "true__1 === 1": { - "Next": "49__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n === 2", "Result": true, "ResultPath": "$.heap48", "Type": "Pass", }, "true__1 > 1": { - "Next": "81__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n > 3", "Result": true, "ResultPath": "$.heap80", "Type": "Pass", }, "true__1 >= 1": { - "Next": "89__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n >= 3", "Result": true, "ResultPath": "$.heap88", "Type": "Pass", }, "true__3 !== input.n": { - "Next": "61__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n !== input.n", "Result": true, "ResultPath": "$.heap60", "Type": "Pass", }, "true__3 < input.n": { - "Next": "69__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n < input.n", "Result": true, "ResultPath": "$.heap68", "Type": "Pass", }, "true__3 <= input.n": { - "Next": "77__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n <= input.n", "Result": true, "ResultPath": "$.heap76", "Type": "Pass", }, "true__3 === input.n": { - "Next": "53__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n === input.n", "Result": true, "ResultPath": "$.heap52", "Type": "Pass", }, "true__3 > input.n": { - "Next": "85__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n > input.n", "Result": true, "ResultPath": "$.heap84", "Type": "Pass", }, "true__3 >= input.n": { - "Next": "93__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.n >= input.n", "Result": true, "ResultPath": "$.heap92", "Type": "Pass", }, "true__false !== input.a": { - "Next": "109__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a !== input.a", "Result": true, "ResultPath": "$.heap108", "Type": "Pass", }, "true__false === input.a": { - "Next": "101__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a === input.a", "Result": true, "ResultPath": "$.heap100", "Type": "Pass", }, "true__input.a !== input.a": { - "Next": "111__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "null === null", "Result": true, "ResultPath": "$.heap110", "Type": "Pass", }, "true__input.a !== true": { - "Next": "107__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "false !== input.a", "Result": true, "ResultPath": "$.heap106", "Type": "Pass", }, "true__input.a === input.a": { - "Next": "103__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "true !== true", "Result": true, "ResultPath": "$.heap102", "Type": "Pass", }, "true__input.a === true": { - "Next": "99__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "false === input.a", "Result": true, "ResultPath": "$.heap98", "Type": "Pass", }, "true__input.n !== 2": { - "Next": "59__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 !== input.n", "Result": true, "ResultPath": "$.heap58", "Type": "Pass", }, "true__input.n !== input.n": { - "Next": "63__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 < 1", "Result": true, "ResultPath": "$.heap62", "Type": "Pass", }, "true__input.n < 3": { - "Next": "67__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 < input.n", "Result": true, "ResultPath": "$.heap66", "Type": "Pass", }, "true__input.n < input.n": { - "Next": "71__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 <= 1", "Result": true, "ResultPath": "$.heap70", "Type": "Pass", }, "true__input.n <= 3": { - "Next": "75__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 <= input.n", "Result": true, "ResultPath": "$.heap74", "Type": "Pass", }, "true__input.n <= input.n": { - "Next": "79__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 > 1", "Result": true, "ResultPath": "$.heap78", "Type": "Pass", }, "true__input.n === 2": { - "Next": "51__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 === input.n", "Result": true, "ResultPath": "$.heap50", "Type": "Pass", }, "true__input.n === input.n": { - "Next": "55__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 !== 1", "Result": true, "ResultPath": "$.heap54", "Type": "Pass", }, "true__input.n > 3": { - "Next": "83__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 > input.n", "Result": true, "ResultPath": "$.heap82", "Type": "Pass", }, "true__input.n > input.n": { - "Next": "87__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 >= 1", "Result": true, "ResultPath": "$.heap86", "Type": "Pass", }, "true__input.n >= 3": { - "Next": "91__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "3 >= input.n", "Result": true, "ResultPath": "$.heap90", "Type": "Pass", }, "true__input.n >= input.n": { - "Next": "95__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "true === true", "Result": true, "ResultPath": "$.heap94", "Type": "Pass", }, "true__input.nv != "hello"": { - "Next": "195__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN === 1", "Result": true, "ResultPath": "$.heap194", "Type": "Pass", }, "true__input.nv != 1": { - "Next": "211__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== obj.und", "Result": true, "ResultPath": "$.heap210", "Type": "Pass", @@ -12397,505 +11456,505 @@ exports[`binary and unary comparison 1`] = ` "Type": "Pass", }, "true__input.nv != input.v": { - "Next": "255__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN === input.n", "Result": true, "ResultPath": "$.heap254", "Type": "Pass", }, "true__input.nv !== "hello"": { - "Next": "193__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != "hello"", "Result": true, "ResultPath": "$.heap192", "Type": "Pass", }, "true__input.nv !== 1": { - "Next": "209__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != 1", "Result": true, "ResultPath": "$.heap208", "Type": "Pass", }, "true__input.nv !== input.n": { - "Next": "269__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != input.n", "Result": true, "ResultPath": "$.heap268", "Type": "Pass", }, "true__input.nv !== input.nv": { - "Next": "127__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": ""a" in input.obj", "Result": true, "ResultPath": "$.heap126", "Type": "Pass", }, "true__input.nv !== input.v": { - "Next": "253__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv != input.v", "Result": true, "ResultPath": "$.heap252", "Type": "Pass", }, "true__input.nv !== null": { - "Next": "123__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== input.nv", "Result": true, "ResultPath": "$.heap122", "Type": "Pass", }, "true__input.nv == "hello"": { - "Next": "191__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== "hello"", "Result": true, "ResultPath": "$.heap190", "Type": "Pass", }, "true__input.nv == 1": { - "Next": "207__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== 1", "Result": true, "ResultPath": "$.heap206", "Type": "Pass", }, "true__input.nv == input.n": { - "Next": "267__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.n", "Result": true, "ResultPath": "$.heap266", "Type": "Pass", }, "true__input.nv == input.v": { - "Next": "251__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.v", "Result": true, "ResultPath": "$.heap250", "Type": "Pass", }, "true__input.nv == obj.und": { - "Next": "219__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === obj.und 1", "Result": true, "ResultPath": "$.heap218", "Type": "Pass", }, "true__input.nv == obj.und 1": { - "Next": "223__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === obj.und", "Result": true, "ResultPath": "$.heap222", "Type": "Pass", }, "true__input.nv == undefined": { - "Next": "155__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === undefined 1", "Result": true, "ResultPath": "$.heap154", "Type": "Pass", }, "true__input.nv == undefined 1": { - "Next": "159__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === undefined", "Result": true, "ResultPath": "$.heap158", "Type": "Pass", }, "true__input.nv === "hello"": { - "Next": "189__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == "hello"", "Result": true, "ResultPath": "$.heap188", "Type": "Pass", }, "true__input.nv === 1": { - "Next": "205__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == 1", "Result": true, "ResultPath": "$.heap204", "Type": "Pass", }, "true__input.nv === input.n": { - "Next": "265__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == input.n", "Result": true, "ResultPath": "$.heap264", "Type": "Pass", }, "true__input.nv === input.nv": { - "Next": "119__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "null !== null", "Result": true, "ResultPath": "$.heap118", "Type": "Pass", }, "true__input.nv === input.v": { - "Next": "249__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == input.v", "Result": true, "ResultPath": "$.heap248", "Type": "Pass", }, "true__input.nv === null": { - "Next": "115__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === input.nv", "Result": true, "ResultPath": "$.heap114", "Type": "Pass", }, "true__input.nv === obj.und": { - "Next": "217__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == obj.und", "Result": true, "ResultPath": "$.heap216", "Type": "Pass", }, "true__input.nv === obj.und 1": { - "Next": "221__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == obj.und 1", "Result": true, "ResultPath": "$.heap220", "Type": "Pass", }, "true__input.nv === undefined": { - "Next": "153__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == undefined", "Result": true, "ResultPath": "$.heap152", "Type": "Pass", }, "true__input.nv === undefined 1": { - "Next": "157__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv == undefined 1", "Result": true, "ResultPath": "$.heap156", "Type": "Pass", }, "true__input.und != "hello"": { - "Next": "187__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === "hello"", "Result": true, "ResultPath": "$.heap186", "Type": "Pass", }, "true__input.und != input.v": { - "Next": "247__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.v", "Result": true, "ResultPath": "$.heap246", "Type": "Pass", }, "true__input.und != null": { - "Next": "179__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === "hello"", "Result": true, "ResultPath": "$.heap178", "Type": "Pass", }, "true__input.und != obj.nv": { - "Next": "239__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === input.v", "Result": true, "ResultPath": "$.heap238", "Type": "Pass", }, "true__input.und != obj.und": { - "Next": "231__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === obj.nv", "Result": true, "ResultPath": "$.heap230", "Type": "Pass", }, "true__input.und != undefined": { - "Next": "167__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v === undefined 1", "Result": true, "ResultPath": "$.heap166", "Type": "Pass", }, "true__input.und !== "hello"": { - "Next": "185__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != "hello"", "Result": true, "ResultPath": "$.heap184", "Type": "Pass", }, "true__input.und !== input.v": { - "Next": "245__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != input.v", "Result": true, "ResultPath": "$.heap244", "Type": "Pass", }, "true__input.und !== null": { - "Next": "177__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != null", "Result": true, "ResultPath": "$.heap176", "Type": "Pass", }, "true__input.und !== obj.nv": { - "Next": "237__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != obj.nv", "Result": true, "ResultPath": "$.heap236", "Type": "Pass", }, "true__input.und !== obj.und": { - "Next": "229__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != obj.und", "Result": true, "ResultPath": "$.heap228", "Type": "Pass", }, "true__input.und !== undefined": { - "Next": "165__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und != undefined", "Result": true, "ResultPath": "$.heap164", "Type": "Pass", }, "true__input.und == "hello"": { - "Next": "183__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== "hello"", "Result": true, "ResultPath": "$.heap182", "Type": "Pass", }, "true__input.und == input.v": { - "Next": "243__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== input.v", "Result": true, "ResultPath": "$.heap242", "Type": "Pass", }, "true__input.und == null": { - "Next": "175__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== null", "Result": true, "ResultPath": "$.heap174", "Type": "Pass", }, "true__input.und == obj.nv": { - "Next": "235__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== obj.nv", "Result": true, "ResultPath": "$.heap234", "Type": "Pass", }, "true__input.und == obj.und": { - "Next": "227__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== obj.und", "Result": true, "ResultPath": "$.heap226", "Type": "Pass", }, "true__input.und == undefined": { - "Next": "163__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und !== undefined", "Result": true, "ResultPath": "$.heap162", "Type": "Pass", }, "true__input.und === "hello"": { - "Next": "181__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == "hello"", "Result": true, "ResultPath": "$.heap180", "Type": "Pass", }, "true__input.und === input.v": { - "Next": "241__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == input.v", "Result": true, "ResultPath": "$.heap240", "Type": "Pass", }, "true__input.und === null": { - "Next": "173__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == null", "Result": true, "ResultPath": "$.heap172", "Type": "Pass", }, "true__input.und === obj.nv": { - "Next": "233__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == obj.nv", "Result": true, "ResultPath": "$.heap232", "Type": "Pass", }, "true__input.und === obj.und": { - "Next": "225__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == obj.und", "Result": true, "ResultPath": "$.heap224", "Type": "Pass", }, "true__input.und === undefined": { - "Next": "161__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und == undefined", "Result": true, "ResultPath": "$.heap160", "Type": "Pass", }, "true__input.undN != 1": { - "Next": "203__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === 1", "Result": true, "ResultPath": "$.heap202", "Type": "Pass", }, "true__input.undN != input.n": { - "Next": "263__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.n", "Result": true, "ResultPath": "$.heap262", "Type": "Pass", }, "true__input.undN !== 1": { - "Next": "201__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN != 1", "Result": true, "ResultPath": "$.heap200", "Type": "Pass", }, "true__input.undN !== input.n": { - "Next": "261__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN != input.n", "Result": true, "ResultPath": "$.heap260", "Type": "Pass", }, "true__input.undN == 1": { - "Next": "199__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN !== 1", "Result": true, "ResultPath": "$.heap198", "Type": "Pass", }, "true__input.undN == input.n": { - "Next": "259__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN !== input.n", "Result": true, "ResultPath": "$.heap258", "Type": "Pass", }, "true__input.undN === 1": { - "Next": "197__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN == 1", "Result": true, "ResultPath": "$.heap196", "Type": "Pass", }, "true__input.undN === input.n": { - "Next": "257__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.undN == input.n", "Result": true, "ResultPath": "$.heap256", "Type": "Pass", }, "true__input.v != obj.und": { - "Next": "215__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === obj.und", "Result": true, "ResultPath": "$.heap214", "Type": "Pass", }, "true__input.v != undefined": { - "Next": "151__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === undefined", "Result": true, "ResultPath": "$.heap150", "Type": "Pass", }, "true__input.v !== "val"": { - "Next": "11__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" !== input.v", "Result": true, "ResultPath": "$.heap10", "Type": "Pass", }, "true__input.v !== input.nv": { - "Next": "125__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== input.nv", "Result": true, "ResultPath": "$.heap124", "Type": "Pass", }, "true__input.v !== input.v": { - "Next": "15__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" < "a"", "Result": true, "ResultPath": "$.heap14", "Type": "Pass", }, "true__input.v !== obj.und": { - "Next": "213__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v != obj.und", "Result": true, "ResultPath": "$.heap212", "Type": "Pass", }, "true__input.v !== undefined": { - "Next": "149__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v != undefined", "Result": true, "ResultPath": "$.heap148", "Type": "Pass", }, "true__input.v < "val2"": { - "Next": "19__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" < input.v", "Result": true, "ResultPath": "$.heap18", "Type": "Pass", }, "true__input.v < input.v": { - "Next": "23__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" <= "a"", "Result": true, "ResultPath": "$.heap22", "Type": "Pass", }, "true__input.v <= "val2"": { - "Next": "27__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" <= input.v", "Result": true, "ResultPath": "$.heap26", "Type": "Pass", }, "true__input.v <= input.v": { - "Next": "31__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" > "a"", "Result": true, "ResultPath": "$.heap30", "Type": "Pass", }, "true__input.v == undefined": { - "Next": "147__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v !== undefined", "Result": true, "ResultPath": "$.heap146", "Type": "Pass", }, "true__input.v == undefined 1": { - "Next": "171__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.und === null", "Result": true, "ResultPath": "$.heap170", "Type": "Pass", }, "true__input.v === "val"": { - "Next": "3__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": ""val2" === input.v", "Result": true, "ResultPath": "$.heap2", "Type": "Pass", }, "true__input.v === input.nv": { - "Next": "117__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === input.nv", "Result": true, "ResultPath": "$.heap116", "Type": "Pass", }, "true__input.v === input.v": { - "Next": "7__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in", + "Next": ""a" !== "a"", "Result": true, "ResultPath": "$.heap6", "Type": "Pass", }, "true__input.v === undefined": { - "Next": "145__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v == undefined", "Result": true, "ResultPath": "$.heap144", "Type": "Pass", }, "true__input.v === undefined 1": { - "Next": "169__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.v == undefined 1", "Result": true, "ResultPath": "$.heap168", "Type": "Pass", }, "true__input.v > "val2"": { - "Next": "35__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" > input.v", "Result": true, "ResultPath": "$.heap34", "Type": "Pass", }, "true__input.v > input.v": { - "Next": "39__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""a" >= "a"", "Result": true, "ResultPath": "$.heap38", "Type": "Pass", }, "true__input.v >= "val2"": { - "Next": "43__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": ""val2" >= input.v", "Result": true, "ResultPath": "$.heap42", "Type": "Pass", }, "true__input.v >= input.v": { - "Next": "47__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "1 === 1", "Result": true, "ResultPath": "$.heap46", "Type": "Pass", }, "true__null !== null": { - "Next": "121__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv !== null", "Result": true, "ResultPath": "$.heap120", "Type": "Pass", }, "true__null === null": { - "Next": "113__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.nv === null", "Result": true, "ResultPath": "$.heap112", "Type": "Pass", }, "true__return {constantStringEquals: "a" === "a", constantToVarStringEquals:": { - "Next": "1__return {constantStringEquals: "a" === "a", constantToVarStringEquals: in 1", + "Next": "input.v === "val"", "Result": true, "ResultPath": "$.heap0", "Type": "Pass", }, "true__true !== true": { - "Next": "105__return {constantStringEquals: "a" === "a", constantToVarStringEquals: ", + "Next": "input.a !== true", "Result": true, "ResultPath": "$.heap104", "Type": "Pass", }, "true__true === true": { - "Next": "97__return {constantStringEquals: "a" === "a", constantToVarStringEquals: i", + "Next": "input.a === true", "Result": true, "ResultPath": "$.heap96", "Type": "Pass", @@ -12908,36 +11967,6 @@ exports[`binaryOps logic 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "10__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv": { - "InputPath": "$.heap32", - "Next": "null ?? input.v", - "ResultPath": "$.heap33", - "Type": "Pass", - }, - "12__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv": { - "InputPath": "$.heap34", - "Next": "input.b || input.z || x = 3x , true || x = 4x , false", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "14__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv": { - "InputPath": "$.heap43", - "Next": "input.b || x = 5x , false", - "ResultPath": "$.heap44", - "Type": "Pass", - }, - "16__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv": { - "InputPath": "$.heap48", - "Next": "input.z && x = 6x , true", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "18__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv": { - "InputPath": "$.heap52", - "Next": "input.a && input.v && x = 7x , true", - "ResultPath": "$.heap53", - "Type": "Pass", - }, "1__if(y = 1y && y = 2y , false && y = 3y)": { "Choices": [ { @@ -13033,58 +12062,58 @@ exports[`binaryOps logic 1`] = ` ], }, ], - "Next": "y = 4y", + "Next": "4y", }, ], - "Default": "if(y = 5y , false || y = 6y , true || y = 7y)", + "Default": "5y", "Type": "Choice", }, "1__if(y = 5y , false || y = 6y , true || y = 7y)": { "Choices": [ { "IsNull": false, - "Next": "y = 8y", + "Next": "8y", "Variable": "$$.Execution.Id", }, ], - "Default": "return {andVar: c, and: input.a && input.b, or: input.a || input.b, invNull", + "Default": "input.a && input.b", "Type": "Choice", }, "1__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN": { "End": true, "Parameters": { - "and.$": "$.heap21", - "andVar.$": "$.heap19", - "falsyAndAssign.$": "$.heap65", - "falsyChainAnd.$": "$.heap53", - "falsyChainOr.$": "$.heap44", + "and.$": "$.heap20", + "andVar.$": "$.heap0", + "falsyAndAssign.$": "$.falsyAndAssign", + "falsyChainAnd.$": "$.heap52", + "falsyChainOr.$": "$.heap43", "falsyOrAssign.$": "$.falsyOrAssign", - "invNullCoal.$": "$.heap27", - "notNullishCoalAssign.$": "$.heap62", - "nullCoal.$": "$.heap31", - "nullNull.$": "$.heap33", - "nullVal.$": "$.heap35", - "nullishCoalAssign.$": "$.heap63", - "or.$": "$.heap23", - "truthyAndAssign.$": "$.heap64", - "truthyChainAnd.$": "$.heap59", - "truthyChainOr.$": "$.heap49", - "truthyOrAssign.$": "$.heap66", - "x.$": "$.heap60", - "y.$": "$.heap61", + "invNullCoal.$": "$.heap26", + "notNullishCoalAssign.$": "$.notNullishCoalAssign", + "nullCoal.$": "$.heap30", + "nullNull.$": "$.heap32", + "nullVal.$": "$.heap34", + "nullishCoalAssign.$": "$.nullishCoalAssign", + "or.$": "$.heap22", + "truthyAndAssign.$": "$.truthyAndAssign", + "truthyChainAnd.$": "$.heap58", + "truthyChainOr.$": "$.heap48", + "truthyOrAssign.$": "$.truthyOrAssign", + "x.$": "$.x", + "y.$": "$.y", }, "ResultPath": "$", "Type": "Pass", }, "1__x = 1x": { "InputPath": "$.input.v", - "Next": "6__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", + "Next": "input.v ?? x = 2x , input.nv", "ResultPath": "$.heap26", "Type": "Pass", }, "1__x = 2x": { "InputPath": "$.input.nv", - "Next": "8__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", + "Next": "input.nv ?? null", "ResultPath": "$.heap30", "Type": "Pass", }, @@ -13107,7 +12136,7 @@ exports[`binaryOps logic 1`] = ` "Type": "Pass", }, "1__x = 6x": { - "Next": "18__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "Next": "input.a && input.v && x = 7x , true", "Result": true, "ResultPath": "$.heap52", "Type": "Pass", @@ -13133,7 +12162,7 @@ exports[`binaryOps logic 1`] = ` "1x": { "Next": "x = 1x 1", "Parameters": { - "string.$": "States.Format('{}1',$.heap24)", + "string.$": "States.Format('{}1',$.x)", }, "ResultPath": "$.heap25", "Type": "Pass", @@ -13141,7 +12170,7 @@ exports[`binaryOps logic 1`] = ` "1y": { "Next": "y = 1y", "Parameters": { - "string.$": "States.Format('{}1',$.heap1)", + "string.$": "States.Format('{}1',$.y)", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -13194,16 +12223,10 @@ exports[`binaryOps logic 1`] = ` "ResultPath": "$.heap66", "Type": "Pass", }, - "2__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN": { - "InputPath": "$.heap20", - "Next": "input.a || input.b", - "ResultPath": "$.heap21", - "Type": "Pass", - }, "2x": { "Next": "x = 2x 1", "Parameters": { - "string.$": "States.Format('{}2',$.heap28)", + "string.$": "States.Format('{}2',$.x)", }, "ResultPath": "$.heap29", "Type": "Pass", @@ -13211,7 +12234,7 @@ exports[`binaryOps logic 1`] = ` "2y": { "Next": "y = 2y 1", "Parameters": { - "string.$": "States.Format('{}2',$.heap3)", + "string.$": "States.Format('{}2',$.y)", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -13219,7 +12242,7 @@ exports[`binaryOps logic 1`] = ` "3x": { "Next": "x = 3x 1", "Parameters": { - "string.$": "States.Format('{}3',$.heap37)", + "string.$": "States.Format('{}3',$.x)", }, "ResultPath": "$.heap38", "Type": "Pass", @@ -13227,21 +12250,15 @@ exports[`binaryOps logic 1`] = ` "3y": { "Next": "y = 3y 1", "Parameters": { - "string.$": "States.Format('{}3',$.heap6)", + "string.$": "States.Format('{}3',$.y)", }, "ResultPath": "$.heap7", "Type": "Pass", }, - "4__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN": { - "InputPath": "$.heap22", - "Next": "input.nv ?? x = 1x , input.v", - "ResultPath": "$.heap23", - "Type": "Pass", - }, "4x": { "Next": "x = 4x 1", "Parameters": { - "string.$": "States.Format('{}4',$.heap40)", + "string.$": "States.Format('{}4',$.x)", }, "ResultPath": "$.heap41", "Type": "Pass", @@ -13249,7 +12266,7 @@ exports[`binaryOps logic 1`] = ` "4y": { "Next": "y = 4y 1", "Parameters": { - "string.$": "States.Format('{}4',$.heap9)", + "string.$": "States.Format('{}4',$.y)", }, "ResultPath": "$.heap10", "Type": "Pass", @@ -13257,7 +12274,7 @@ exports[`binaryOps logic 1`] = ` "5x": { "Next": "x = 5x 1", "Parameters": { - "string.$": "States.Format('{}5',$.heap45)", + "string.$": "States.Format('{}5',$.x)", }, "ResultPath": "$.heap46", "Type": "Pass", @@ -13265,21 +12282,15 @@ exports[`binaryOps logic 1`] = ` "5y": { "Next": "y = 5y", "Parameters": { - "string.$": "States.Format('{}5',$.heap11)", + "string.$": "States.Format('{}5',$.y)", }, "ResultPath": "$.heap12", "Type": "Pass", }, - "6__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN": { - "InputPath": "$.heap26", - "Next": "input.v ?? x = 2x , input.nv", - "ResultPath": "$.heap27", - "Type": "Pass", - }, "6x": { "Next": "x = 6x 1", "Parameters": { - "string.$": "States.Format('{}6',$.heap50)", + "string.$": "States.Format('{}6',$.x)", }, "ResultPath": "$.heap51", "Type": "Pass", @@ -13287,7 +12298,7 @@ exports[`binaryOps logic 1`] = ` "6y": { "Next": "y = 6y 1", "Parameters": { - "string.$": "States.Format('{}6',$.heap13)", + "string.$": "States.Format('{}6',$.y)", }, "ResultPath": "$.heap14", "Type": "Pass", @@ -13295,21 +12306,15 @@ exports[`binaryOps logic 1`] = ` "7x": { "Next": "x = 7x 1", "Parameters": { - "string.$": "States.Format('{}7',$.heap55)", + "string.$": "States.Format('{}7',$.x)", }, "ResultPath": "$.heap56", "Type": "Pass", }, - "8__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN": { - "InputPath": "$.heap30", - "Next": "input.nv ?? null", - "ResultPath": "$.heap31", - "Type": "Pass", - }, "8y": { "Next": "y = 8y 1", "Parameters": { - "string.$": "States.Format('{}8',$.heap17)", + "string.$": "States.Format('{}8',$.y)", }, "ResultPath": "$.heap18", "Type": "Pass", @@ -13325,12 +12330,6 @@ exports[`binaryOps logic 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "c": { - "InputPath": "$.heap0", - "Next": "x = """, - "ResultPath": "$.c", - "Type": "Pass", - }, "c = input.a && input.b": { "Choices": [ { @@ -13436,7 +12435,7 @@ exports[`binaryOps logic 1`] = ` }, "false__c = input.a && input.b": { "InputPath": "$.input.b", - "Next": "c", + "Next": "x = """, "ResultPath": "$.heap0", "Type": "Pass", }, @@ -13454,7 +12453,7 @@ exports[`binaryOps logic 1`] = ` }, "false__input.a && input.b": { "InputPath": "$.input.b", - "Next": "2__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", + "Next": "input.a || input.b", "ResultPath": "$.heap20", "Type": "Pass", }, @@ -13472,7 +12471,7 @@ exports[`binaryOps logic 1`] = ` }, "false__input.a || input.b": { "InputPath": "$.input.b", - "Next": "4__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", + "Next": "input.nv ?? x = 1x , input.v", "ResultPath": "$.heap22", "Type": "Pass", }, @@ -13484,19 +12483,19 @@ exports[`binaryOps logic 1`] = ` }, "false__input.b || input.z || x = 3x , true || x = 4x , false || input.v": { "InputPath": "$.input.v", - "Next": "14__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "Next": "input.b || x = 5x , false", "ResultPath": "$.heap43", "Type": "Pass", }, "false__input.b || x = 5x , false || input.arr": { "InputPath": "$.input.arr", - "Next": "16__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "Next": "input.z && x = 6x , true", "ResultPath": "$.heap48", "Type": "Pass", }, "false__input.nv ?? null": { "InputPath": "$.fnl_context.null", - "Next": "10__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "Next": "null ?? input.v", "ResultPath": "$.heap32", "Type": "Pass", }, @@ -13508,7 +12507,7 @@ exports[`binaryOps logic 1`] = ` }, "false__null ?? input.v": { "InputPath": "$.input.v", - "Next": "12__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "Next": "input.b || input.z || x = 3x , true || x = 4x , false", "ResultPath": "$.heap34", "Type": "Pass", }, @@ -13533,506 +12532,337 @@ exports[`binaryOps logic 1`] = ` "falsyAndAssign &&= "b"": { "Choices": [ { - "And": [ - { - "Not": { + "Next": "truthyOrAssign ||= "b"", + "Not": { + "And": [ + { "And": [ + { + "IsPresent": true, + "Variable": "$.falsyAndAssign", + }, + { + "IsNull": false, + "Variable": "$.falsyAndAssign", + }, + ], + }, + { + "Or": [ { "And": [ { - "IsPresent": true, + "IsString": true, "Variable": "$.falsyAndAssign", }, { - "IsNull": false, + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.falsyAndAssign", + }, + { + "StringEquals": "", + "Variable": "$.falsyAndAssign", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, "Variable": "$.falsyAndAssign", }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.falsyAndAssign", + }, + { + "NumericEquals": 0, + "Variable": "$.falsyAndAssign", + }, + ], + }, + }, ], }, { - "Or": [ + "And": [ + { + "IsBoolean": true, + "Variable": "$.falsyAndAssign", + }, { + "BooleanEquals": true, + "Variable": "$.falsyAndAssign", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.falsyAndAssign", + }, + { + "IsNumeric": true, + "Variable": "$.falsyAndAssign", + }, + { + "IsString": true, + "Variable": "$.falsyAndAssign", + }, + ], + }, + }, + ], + }, + ], + }, + }, + ], + "Default": "false__falsyAndAssign &&= "b"", + "Type": "Choice", + }, + "falsyAndAssign = """: { + "Next": "truthyOrAssign = "a"", + "Result": "", + "ResultPath": "$.falsyAndAssign", + "Type": "Pass", + }, + "falsyOrAssign = """: { + "Next": "notNullishCoalAssign ??= "b"", + "Result": "", + "ResultPath": "$.falsyOrAssign", + "Type": "Pass", + }, + "falsyOrAssign ||= "b"": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.falsyOrAssign", + }, + { + "IsNull": false, + "Variable": "$.falsyOrAssign", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.falsyOrAssign", + }, + { + "Not": { "And": [ { "IsString": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.falsyOrAssign", }, { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, + "StringEquals": "", + "Variable": "$.falsyOrAssign", }, ], }, - { + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.falsyOrAssign", + }, + { + "Not": { "And": [ { "IsNumeric": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.falsyOrAssign", }, { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, + "NumericEquals": 0, + "Variable": "$.falsyOrAssign", }, ], }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.falsyOrAssign", + }, + { + "BooleanEquals": true, + "Variable": "$.falsyOrAssign", + }, + ], + }, + { + "Not": { + "Or": [ { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], + "IsBoolean": true, + "Variable": "$.falsyOrAssign", }, { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, + "IsNumeric": true, + "Variable": "$.falsyOrAssign", + }, + { + "IsString": true, + "Variable": "$.falsyOrAssign", }, ], }, + }, + ], + }, + ], + "Next": "y = """, + }, + ], + "Default": "false__falsyOrAssign ||= "b"", + "Type": "Choice", + }, + "input.a && input.b": { + "Choices": [ + { + "Next": "true__input.a && input.b", + "Not": { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.a", + }, + { + "IsNull": false, + "Variable": "$.input.a", + }, ], }, - }, - { - "And": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.a", + }, + { + "Not": { "And": [ { "IsString": true, - "Variable": "$.truthyOrAssign", + "Variable": "$.input.a", }, { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, + "StringEquals": "", + "Variable": "$.input.a", }, ], }, - { + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.a", + }, + { + "Not": { "And": [ { "IsNumeric": true, - "Variable": "$.truthyOrAssign", + "Variable": "$.input.a", }, { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, + "NumericEquals": 0, + "Variable": "$.input.a", }, ], }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.a", + }, + { + "BooleanEquals": true, + "Variable": "$.input.a", + }, + ], + }, + { + "Not": { + "Or": [ { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], + "IsBoolean": true, + "Variable": "$.input.a", }, { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], + "IsNumeric": true, + "Variable": "$.input.a", }, { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, + "IsString": true, + "Variable": "$.input.a", }, ], }, - ], - }, - ], - }, - ], - "Next": "y = """, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], }, ], }, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - "Next": "false__falsyOrAssign ||= "b"", + ], + }, }, + ], + "Default": "false__input.a && input.b", + "Type": "Choice", + }, + "input.a && input.v && x = 7x , true": { + "Choices": [ { - "Next": "false__truthyOrAssign ||= "b"", + "Next": "true__input.a && input.v && x = 7x , true", "Not": { "And": [ { "And": [ { "IsPresent": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "IsNull": false, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, ], }, @@ -14042,18 +12872,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsString": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "Not": { "And": [ { "IsString": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "StringEquals": "", - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, ], }, @@ -14064,18 +12894,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsNumeric": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "Not": { "And": [ { "IsNumeric": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "NumericEquals": 0, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, ], }, @@ -14086,11 +12916,11 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsBoolean": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "BooleanEquals": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, ], }, @@ -14099,15 +12929,15 @@ exports[`binaryOps logic 1`] = ` "Or": [ { "IsBoolean": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "IsNumeric": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, { "IsString": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.a", }, ], }, @@ -14118,149 +12948,24 @@ exports[`binaryOps logic 1`] = ` }, }, ], - "Default": "false__falsyAndAssign &&= "b"", - "Type": "Choice", - }, - "falsyAndAssign = """: { - "Next": "truthyOrAssign = "a"", - "Result": "", - "ResultPath": "$.falsyAndAssign", - "Type": "Pass", - }, - "falsyOrAssign = """: { - "Next": "notNullishCoalAssign ??= "b"", - "Result": "", - "ResultPath": "$.falsyOrAssign", - "Type": "Pass", - }, - "falsyOrAssign ||= "b"": { - "Choices": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - ], - "Next": "y = """, - }, - ], - "Default": "false__falsyOrAssign ||= "b"", + "Default": "false__input.a && input.v && x = 7x , true", "Type": "Choice", }, - "if(y = 1y && y = 2y , false && y = 3y)": { - "InputPath": "$.y", - "Next": "1y", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "if(y = 5y , false || y = 6y , true || y = 7y)": { - "InputPath": "$.y", - "Next": "5y", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "input.a && input.b": { + "input.a && input.v && x = 7x , true && input.v": { "Choices": [ { - "Next": "true__input.a && input.b", + "Next": "true__input.a && input.v && x = 7x , true && input.v", "Not": { "And": [ { "And": [ { "IsPresent": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "IsNull": false, - "Variable": "$.input.a", + "Variable": "$.heap57", }, ], }, @@ -14270,18 +12975,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "Not": { "And": [ { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "StringEquals": "", - "Variable": "$.input.a", + "Variable": "$.heap57", }, ], }, @@ -14292,18 +12997,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "Not": { "And": [ { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "NumericEquals": 0, - "Variable": "$.input.a", + "Variable": "$.heap57", }, ], }, @@ -14314,11 +13019,11 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsBoolean": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "BooleanEquals": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, ], }, @@ -14327,15 +13032,15 @@ exports[`binaryOps logic 1`] = ` "Or": [ { "IsBoolean": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap57", }, ], }, @@ -14346,24 +13051,24 @@ exports[`binaryOps logic 1`] = ` }, }, ], - "Default": "false__input.a && input.b", + "Default": "false__input.a && input.v && x = 7x , true && input.v", "Type": "Choice", }, - "input.a && input.v && x = 7x , true": { + "input.a && input.v && x = 7x , true 1": { "Choices": [ { - "Next": "true__input.a && input.v && x = 7x , true", + "Next": "true__input.a && input.v && x = 7x , true 1", "Not": { "And": [ { "And": [ { "IsPresent": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "IsNull": false, - "Variable": "$.input.a", + "Variable": "$.heap54", }, ], }, @@ -14373,18 +13078,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "Not": { "And": [ { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "StringEquals": "", - "Variable": "$.input.a", + "Variable": "$.heap54", }, ], }, @@ -14395,18 +13100,18 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "Not": { "And": [ { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "NumericEquals": 0, - "Variable": "$.input.a", + "Variable": "$.heap54", }, ], }, @@ -14417,11 +13122,11 @@ exports[`binaryOps logic 1`] = ` "And": [ { "IsBoolean": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "BooleanEquals": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, ], }, @@ -14430,15 +13135,15 @@ exports[`binaryOps logic 1`] = ` "Or": [ { "IsBoolean": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "IsNumeric": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, { "IsString": true, - "Variable": "$.input.a", + "Variable": "$.heap54", }, ], }, @@ -14449,216 +13154,10 @@ exports[`binaryOps logic 1`] = ` }, }, ], - "Default": "false__input.a && input.v && x = 7x , true", + "Default": "7x", "Type": "Choice", }, - "input.a && input.v && x = 7x , true && input.v": { - "Choices": [ - { - "Next": "true__input.a && input.v && x = 7x , true && input.v", - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.heap57", - }, - { - "IsNull": false, - "Variable": "$.heap57", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.heap57", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.heap57", - }, - { - "StringEquals": "", - "Variable": "$.heap57", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.heap57", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.heap57", - }, - { - "NumericEquals": 0, - "Variable": "$.heap57", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.heap57", - }, - { - "BooleanEquals": true, - "Variable": "$.heap57", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.heap57", - }, - { - "IsNumeric": true, - "Variable": "$.heap57", - }, - { - "IsString": true, - "Variable": "$.heap57", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - "Default": "false__input.a && input.v && x = 7x , true && input.v", - "Type": "Choice", - }, - "input.a && input.v && x = 7x , true 1": { - "Choices": [ - { - "Next": "true__input.a && input.v && x = 7x , true 1", - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.heap54", - }, - { - "IsNull": false, - "Variable": "$.heap54", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.heap54", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.heap54", - }, - { - "StringEquals": "", - "Variable": "$.heap54", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.heap54", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.heap54", - }, - { - "NumericEquals": 0, - "Variable": "$.heap54", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.heap54", - }, - { - "BooleanEquals": true, - "Variable": "$.heap54", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.heap54", - }, - { - "IsNumeric": true, - "Variable": "$.heap54", - }, - { - "IsString": true, - "Variable": "$.heap54", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - "Default": "x = 7x", - "Type": "Choice", - }, - "input.a || input.b": { + "input.a || input.b": { "Choices": [ { "And": [ @@ -14857,7 +13356,7 @@ exports[`binaryOps logic 1`] = ` "Next": "true__input.b || input.z || x = 3x , true", }, ], - "Default": "x = 3x", + "Default": "3x", "Type": "Choice", }, "input.b || input.z || x = 3x , true || x = 4x , false": { @@ -15059,7 +13558,7 @@ exports[`binaryOps logic 1`] = ` "Next": "true__input.b || input.z || x = 3x , true || x = 4x , false 1", }, ], - "Default": "x = 4x", + "Default": "4x", "Type": "Choice", }, "input.b || input.z || x = 3x , true || x = 4x , false || input.v": { @@ -15261,7 +13760,7 @@ exports[`binaryOps logic 1`] = ` "Next": "true__input.b || x = 5x , false", }, ], - "Default": "x = 5x", + "Default": "5x", "Type": "Choice", }, "input.b || x = 5x , false || input.arr": { @@ -15400,7 +13899,7 @@ exports[`binaryOps logic 1`] = ` "Next": "true__input.nv ?? x = 1x , input.v", }, ], - "Default": "x = 1x", + "Default": "1x", "Type": "Choice", }, "input.v ?? x = 2x , input.nv": { @@ -15419,3375 +13918,299 @@ exports[`binaryOps logic 1`] = ` "Next": "true__input.v ?? x = 2x , input.nv", }, ], - "Default": "x = 2x", + "Default": "2x", "Type": "Choice", }, "input.z && x = 6x , true": { "Choices": [ { - "Next": "true__input.z && x = 6x , true", - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.input.z", - }, - { - "IsNull": false, - "Variable": "$.input.z", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.input.z", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.input.z", - }, - { - "StringEquals": "", - "Variable": "$.input.z", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.input.z", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.input.z", - }, - { - "NumericEquals": 0, - "Variable": "$.input.z", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.input.z", - }, - { - "BooleanEquals": true, - "Variable": "$.input.z", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.input.z", - }, - { - "IsNumeric": true, - "Variable": "$.input.z", - }, - { - "IsString": true, - "Variable": "$.input.z", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - "Default": "x = 6x", - "Type": "Choice", - }, - "notNullishCoalAssign = "a"": { - "Next": "nullishCoalAssign = null", - "Result": "a", - "ResultPath": "$.notNullishCoalAssign", - "Type": "Pass", - }, - "notNullishCoalAssign ??= "b"": { - "Choices": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "y = """, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "false__falsyOrAssign ||= "b"", - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - }, - ], - "Next": "false__truthyOrAssign ||= "b"", - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - "Next": "false__falsyAndAssign &&= "b"", - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - ], - "Next": "false__truthyAndAssign &&= "b"", - }, - { - "And": [ - { - "IsPresent": true, - "Variable": "$.notNullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.notNullishCoalAssign", - }, - ], - "Next": "false__nullishCoalAssign ??= "b"", - }, - ], - "Default": "false__notNullishCoalAssign ??= "b"", - "Type": "Choice", - }, - "null ?? input.v": { - "Choices": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.fnl_context.null", - }, - { - "IsNull": false, - "Variable": "$.fnl_context.null", - }, - ], - "Next": "true__null ?? input.v", - }, - ], - "Default": "false__null ?? input.v", - "Type": "Choice", - }, - "nullishCoalAssign = null": { - "InputPath": "$.fnl_context.null", - "Next": "truthyAndAssign = "a"", - "ResultPath": "$.nullishCoalAssign", - "Type": "Pass", - }, - "nullishCoalAssign ??= "b"": { - "Choices": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "y = """, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "false__falsyOrAssign ||= "b"", - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - "Next": "false__truthyOrAssign ||= "b"", - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - }, - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - "Next": "false__falsyAndAssign &&= "b"", - }, - { - "And": [ - { - "IsPresent": true, - "Variable": "$.nullishCoalAssign", - }, - { - "IsNull": false, - "Variable": "$.nullishCoalAssign", - }, - ], - "Next": "false__truthyAndAssign &&= "b"", - }, - ], - "Default": "false__nullishCoalAssign ??= "b"", - "Type": "Choice", - }, - "return {andVar: c, and: input.a && input.b, or: input.a || input.b, invNull": { - "InputPath": "$.c", - "Next": "input.a && input.b", - "ResultPath": "$.heap19", - "Type": "Pass", - }, - "true__c = input.a && input.b": { - "InputPath": "$.input.a", - "Next": "c", - "ResultPath": "$.heap0", - "Type": "Pass", - }, - "true__input.a && input.b": { - "InputPath": "$.input.a", - "Next": "2__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", - "ResultPath": "$.heap20", - "Type": "Pass", - }, - "true__input.a && input.v && x = 7x , true": { - "InputPath": "$.input.a", - "Next": "input.a && input.v && x = 7x , true 1", - "ResultPath": "$.heap54", - "Type": "Pass", - }, - "true__input.a && input.v && x = 7x , true && input.v": { - "InputPath": "$.heap57", - "Next": "20__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap58", - "Type": "Pass", - }, - "true__input.a && input.v && x = 7x , true 1": { - "InputPath": "$.heap54", - "Next": "input.a && input.v && x = 7x , true && input.v", - "ResultPath": "$.heap57", - "Type": "Pass", - }, - "true__input.a || input.b": { - "InputPath": "$.input.a", - "Next": "4__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", - "ResultPath": "$.heap22", - "Type": "Pass", - }, - "true__input.b || input.z || x = 3x , true": { - "InputPath": "$.heap36", - "Next": "input.b || input.z || x = 3x , true || x = 4x , false 1", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "true__input.b || input.z || x = 3x , true || x = 4x , false": { - "InputPath": "$.input.b", - "Next": "input.b || input.z || x = 3x , true", - "ResultPath": "$.heap36", - "Type": "Pass", - }, - "true__input.b || input.z || x = 3x , true || x = 4x , false 1": { - "InputPath": "$.heap39", - "Next": "input.b || input.z || x = 3x , true || x = 4x , false || input.v", - "ResultPath": "$.heap42", - "Type": "Pass", - }, - "true__input.b || input.z || x = 3x , true || x = 4x , false || input.v": { - "InputPath": "$.heap42", - "Next": "14__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap43", - "Type": "Pass", - }, - "true__input.b || x = 5x , false": { - "InputPath": "$.input.b", - "Next": "input.b || x = 5x , false || input.arr", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "true__input.b || x = 5x , false || input.arr": { - "InputPath": "$.heap47", - "Next": "16__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "true__input.nv ?? null": { - "InputPath": "$.input.nv", - "Next": "10__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap32", - "Type": "Pass", - }, - "true__input.nv ?? x = 1x , input.v": { - "InputPath": "$.input.nv", - "Next": "6__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", - "ResultPath": "$.heap26", - "Type": "Pass", - }, - "true__input.v ?? x = 2x , input.nv": { - "InputPath": "$.input.v", - "Next": "8__return {andVar: c, and: input.a && input.b, or: input.a || input.b, invN", - "ResultPath": "$.heap30", - "Type": "Pass", - }, - "true__input.z && x = 6x , true": { - "InputPath": "$.input.z", - "Next": "18__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap52", - "Type": "Pass", - }, - "true__null ?? input.v": { - "InputPath": "$.fnl_context.null", - "Next": "12__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", - "ResultPath": "$.heap34", - "Type": "Pass", - }, - "true__y = 1y && y = 2y , false": { - "InputPath": "$.heap2.string", - "Next": "y = 1y && y = 2y , false && y = 3y", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "true__y = 1y && y = 2y , false && y = 3y": { - "InputPath": "$.heap5", - "Next": "1__if(y = 1y && y = 2y , false && y = 3y)", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "truthyAndAssign &&= "b"": { - "Choices": [ - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "y = """, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - ], - }, - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - }, - ], - "Next": "false__falsyOrAssign ||= "b"", - }, - { - "And": [ - { - "Not": { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyAndAssign", - }, - ], - }, - }, - ], - }, + "Next": "true__input.z && x = 6x , true", + "Not": { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.z", + }, + { + "IsNull": false, + "Variable": "$.input.z", + }, + ], + }, + { + "Or": [ + { + "And": [ { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyAndAssign", - }, - ], + "IsString": true, + "Variable": "$.input.z", }, { "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyAndAssign", - }, + "And": [ { - "IsNumeric": true, - "Variable": "$.truthyAndAssign", + "IsString": true, + "Variable": "$.input.z", }, { - "IsString": true, - "Variable": "$.truthyAndAssign", + "StringEquals": "", + "Variable": "$.input.z", }, ], }, }, ], }, - ], - }, - }, - { - "Not": { - "And": [ { "And": [ { - "IsPresent": true, - "Variable": "$.falsyAndAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyAndAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyAndAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyAndAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyAndAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyAndAssign", - }, - ], + "IsNumeric": true, + "Variable": "$.input.z", }, { "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyAndAssign", - }, + "And": [ { "IsNumeric": true, - "Variable": "$.falsyAndAssign", + "Variable": "$.input.z", }, { - "IsString": true, - "Variable": "$.falsyAndAssign", + "NumericEquals": 0, + "Variable": "$.input.z", }, ], }, }, ], }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.z", + }, + { + "BooleanEquals": true, + "Variable": "$.input.z", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.z", + }, + { + "IsNumeric": true, + "Variable": "$.input.z", + }, + { + "IsString": true, + "Variable": "$.input.z", + }, + ], + }, + }, ], }, + ], + }, + }, + ], + "Default": "6x", + "Type": "Choice", + }, + "notNullishCoalAssign = "a"": { + "Next": "nullishCoalAssign = null", + "Result": "a", + "ResultPath": "$.notNullishCoalAssign", + "Type": "Pass", + }, + "notNullishCoalAssign ??= "b"": { + "Choices": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.notNullishCoalAssign", + }, + { + "IsNull": false, + "Variable": "$.notNullishCoalAssign", + }, + ], + "Next": "nullishCoalAssign ??= "b"", + }, + ], + "Default": "false__notNullishCoalAssign ??= "b"", + "Type": "Choice", + }, + "null ?? input.v": { + "Choices": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.fnl_context.null", + }, + { + "IsNull": false, + "Variable": "$.fnl_context.null", + }, + ], + "Next": "true__null ?? input.v", + }, + ], + "Default": "false__null ?? input.v", + "Type": "Choice", + }, + "nullishCoalAssign = null": { + "InputPath": "$.fnl_context.null", + "Next": "truthyAndAssign = "a"", + "ResultPath": "$.nullishCoalAssign", + "Type": "Pass", + }, + "nullishCoalAssign ??= "b"": { + "Choices": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.nullishCoalAssign", + }, + { + "IsNull": false, + "Variable": "$.nullishCoalAssign", }, ], - "Next": "false__truthyOrAssign ||= "b"", + "Next": "truthyAndAssign &&= "b"", }, + ], + "Default": "false__nullishCoalAssign ??= "b"", + "Type": "Choice", + }, + "true__c = input.a && input.b": { + "InputPath": "$.input.a", + "Next": "x = """, + "ResultPath": "$.heap0", + "Type": "Pass", + }, + "true__input.a && input.b": { + "InputPath": "$.input.a", + "Next": "input.a || input.b", + "ResultPath": "$.heap20", + "Type": "Pass", + }, + "true__input.a && input.v && x = 7x , true": { + "InputPath": "$.input.a", + "Next": "input.a && input.v && x = 7x , true 1", + "ResultPath": "$.heap54", + "Type": "Pass", + }, + "true__input.a && input.v && x = 7x , true && input.v": { + "InputPath": "$.heap57", + "Next": "20__return {andVar: c, and: input.a && input.b, or: input.a || input.b, inv", + "ResultPath": "$.heap58", + "Type": "Pass", + }, + "true__input.a && input.v && x = 7x , true 1": { + "InputPath": "$.heap54", + "Next": "input.a && input.v && x = 7x , true && input.v", + "ResultPath": "$.heap57", + "Type": "Pass", + }, + "true__input.a || input.b": { + "InputPath": "$.input.a", + "Next": "input.nv ?? x = 1x , input.v", + "ResultPath": "$.heap22", + "Type": "Pass", + }, + "true__input.b || input.z || x = 3x , true": { + "InputPath": "$.heap36", + "Next": "input.b || input.z || x = 3x , true || x = 4x , false 1", + "ResultPath": "$.heap39", + "Type": "Pass", + }, + "true__input.b || input.z || x = 3x , true || x = 4x , false": { + "InputPath": "$.input.b", + "Next": "input.b || input.z || x = 3x , true", + "ResultPath": "$.heap36", + "Type": "Pass", + }, + "true__input.b || input.z || x = 3x , true || x = 4x , false 1": { + "InputPath": "$.heap39", + "Next": "input.b || input.z || x = 3x , true || x = 4x , false || input.v", + "ResultPath": "$.heap42", + "Type": "Pass", + }, + "true__input.b || input.z || x = 3x , true || x = 4x , false || input.v": { + "InputPath": "$.heap42", + "Next": "input.b || x = 5x , false", + "ResultPath": "$.heap43", + "Type": "Pass", + }, + "true__input.b || x = 5x , false": { + "InputPath": "$.input.b", + "Next": "input.b || x = 5x , false || input.arr", + "ResultPath": "$.heap47", + "Type": "Pass", + }, + "true__input.b || x = 5x , false || input.arr": { + "InputPath": "$.heap47", + "Next": "input.z && x = 6x , true", + "ResultPath": "$.heap48", + "Type": "Pass", + }, + "true__input.nv ?? null": { + "InputPath": "$.input.nv", + "Next": "null ?? input.v", + "ResultPath": "$.heap32", + "Type": "Pass", + }, + "true__input.nv ?? x = 1x , input.v": { + "InputPath": "$.input.nv", + "Next": "input.v ?? x = 2x , input.nv", + "ResultPath": "$.heap26", + "Type": "Pass", + }, + "true__input.v ?? x = 2x , input.nv": { + "InputPath": "$.input.v", + "Next": "input.nv ?? null", + "ResultPath": "$.heap30", + "Type": "Pass", + }, + "true__input.z && x = 6x , true": { + "InputPath": "$.input.z", + "Next": "input.a && input.v && x = 7x , true", + "ResultPath": "$.heap52", + "Type": "Pass", + }, + "true__null ?? input.v": { + "InputPath": "$.fnl_context.null", + "Next": "input.b || input.z || x = 3x , true || x = 4x , false", + "ResultPath": "$.heap34", + "Type": "Pass", + }, + "true__y = 1y && y = 2y , false": { + "InputPath": "$.heap2.string", + "Next": "y = 1y && y = 2y , false && y = 3y", + "ResultPath": "$.heap5", + "Type": "Pass", + }, + "true__y = 1y && y = 2y , false && y = 3y": { + "InputPath": "$.heap5", + "Next": "1__if(y = 1y && y = 2y , false && y = 3y)", + "ResultPath": "$.heap8", + "Type": "Pass", + }, + "truthyAndAssign &&= "b"": { + "Choices": [ { - "Next": "false__falsyAndAssign &&= "b"", + "Next": "falsyAndAssign &&= "b"", "Not": { "And": [ { @@ -18901,199 +14324,6 @@ exports[`binaryOps logic 1`] = ` }, "truthyOrAssign ||= "b"": { "Choices": [ - { - "And": [ - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.truthyOrAssign", - }, - { - "IsString": true, - "Variable": "$.truthyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - { - "And": [ - { - "And": [ - { - "IsPresent": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNull": false, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Or": [ - { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - { - "StringEquals": "", - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "Not": { - "And": [ - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "NumericEquals": 0, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - { - "And": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "BooleanEquals": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - { - "Not": { - "Or": [ - { - "IsBoolean": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsNumeric": true, - "Variable": "$.falsyOrAssign", - }, - { - "IsString": true, - "Variable": "$.falsyOrAssign", - }, - ], - }, - }, - ], - }, - ], - }, - ], - "Next": "y = """, - }, { "And": [ { @@ -19187,7 +14417,7 @@ exports[`binaryOps logic 1`] = ` ], }, ], - "Next": "false__falsyOrAssign ||= "b"", + "Next": "falsyOrAssign ||= "b"", }, ], "Default": "false__truthyOrAssign ||= "b"", @@ -19199,84 +14429,42 @@ exports[`binaryOps logic 1`] = ` "ResultPath": "$.x", "Type": "Pass", }, - "x = 1x": { - "InputPath": "$.x", - "Next": "1x", - "ResultPath": "$.heap24", - "Type": "Pass", - }, "x = 1x 1": { "InputPath": "$.heap25.string", "Next": "1__x = 1x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 2x": { - "InputPath": "$.x", - "Next": "2x", - "ResultPath": "$.heap28", - "Type": "Pass", - }, "x = 2x 1": { "InputPath": "$.heap29.string", "Next": "1__x = 2x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 3x": { - "InputPath": "$.x", - "Next": "3x", - "ResultPath": "$.heap37", - "Type": "Pass", - }, "x = 3x 1": { "InputPath": "$.heap38.string", "Next": "1__x = 3x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 4x": { - "InputPath": "$.x", - "Next": "4x", - "ResultPath": "$.heap40", - "Type": "Pass", - }, "x = 4x 1": { "InputPath": "$.heap41.string", "Next": "1__x = 4x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 5x": { - "InputPath": "$.x", - "Next": "5x", - "ResultPath": "$.heap45", - "Type": "Pass", - }, "x = 5x 1": { "InputPath": "$.heap46.string", "Next": "1__x = 5x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 6x": { - "InputPath": "$.x", - "Next": "6x", - "ResultPath": "$.heap50", - "Type": "Pass", - }, "x = 6x 1": { "InputPath": "$.heap51.string", "Next": "1__x = 6x", "ResultPath": "$.x", "Type": "Pass", }, - "x = 7x": { - "InputPath": "$.x", - "Next": "7x", - "ResultPath": "$.heap55", - "Type": "Pass", - }, "x = 7x 1": { "InputPath": "$.heap56.string", "Next": "1__x = 7x", @@ -19284,7 +14472,7 @@ exports[`binaryOps logic 1`] = ` "Type": "Pass", }, "y = """: { - "Next": "if(y = 1y && y = 2y , false && y = 3y)", + "Next": "1y", "Result": "", "ResultPath": "$.y", "Type": "Pass", @@ -19395,7 +14583,7 @@ exports[`binaryOps logic 1`] = ` }, }, ], - "Default": "y = 2y", + "Default": "2y", "Type": "Choice", }, "y = 1y && y = 2y , false && y = 3y": { @@ -19498,55 +14686,31 @@ exports[`binaryOps logic 1`] = ` }, }, ], - "Default": "y = 3y", + "Default": "3y", "Type": "Choice", }, - "y = 2y": { - "InputPath": "$.y", - "Next": "2y", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "y = 2y 1": { "InputPath": "$.heap4.string", "Next": "1__y = 2y", "ResultPath": "$.y", "Type": "Pass", }, - "y = 3y": { - "InputPath": "$.y", - "Next": "3y", - "ResultPath": "$.heap6", - "Type": "Pass", - }, "y = 3y 1": { "InputPath": "$.heap7.string", "Next": "1__y = 3y", "ResultPath": "$.y", "Type": "Pass", }, - "y = 4y": { - "InputPath": "$.y", - "Next": "4y", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "y = 4y 1": { "InputPath": "$.heap10.string", - "Next": "if(y = 5y , false || y = 6y , true || y = 7y)", + "Next": "5y", "ResultPath": "$.y", "Type": "Pass", }, "y = 5y": { "InputPath": "$.heap12.string", - "Next": "y = 6y", - "ResultPath": "$.y", - "Type": "Pass", - }, - "y = 6y": { - "InputPath": "$.y", "Next": "6y", - "ResultPath": "$.heap13", + "ResultPath": "$.y", "Type": "Pass", }, "y = 6y 1": { @@ -19555,15 +14719,9 @@ exports[`binaryOps logic 1`] = ` "ResultPath": "$.y", "Type": "Pass", }, - "y = 8y": { - "InputPath": "$.y", - "Next": "8y", - "ResultPath": "$.heap17", - "Type": "Pass", - }, "y = 8y 1": { "InputPath": "$.heap18.string", - "Next": "return {andVar: c, and: input.a && input.b, or: input.a || input.b, invNull", + "Next": "input.a && input.b", "ResultPath": "$.y", "Type": "Pass", }, @@ -19578,18 +14736,12 @@ exports[`binaryOps logic with calls 1`] = ` "1__return {and: true && await $SFN.retry(function ()), or: false || await $": { "End": true, "Parameters": { - "and.$": "$.heap2", + "and.$": "$.heap1[0]", "or.$": "$.heap4[0]", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {and: true && await $SFN.retry(function ()), or: false || await $ 1": { - "InputPath": "$.heap1[0]", - "Next": "2__return {and: true && await $SFN.retry(function ()), or: false || await $", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "2__return {and: true && await $SFN.retry(function ()), or: false || await $": { "Branches": [ { @@ -19656,7 +14808,7 @@ exports[`binaryOps logic with calls 1`] = ` }, }, ], - "Next": "1__return {and: true && await $SFN.retry(function ()), or: false || await $ 1", + "Next": "2__return {and: true && await $SFN.retry(function ()), or: false || await $", "Parameters": { "fnl_context.$": "$.fnl_context", }, @@ -19692,7 +14844,7 @@ exports[`call $SFN map, foreach, and parallel 1`] = ` "nn": { "Next": "1__return nn", "Parameters": { - "string.$": "States.Format('n{}',$.heap3)", + "string.$": "States.Format('n{}',$.n__1)", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -19700,12 +14852,12 @@ exports[`call $SFN map, foreach, and parallel 1`] = ` "return nn": { "InputPath": "$.n__1", "Next": "nn", - "ResultPath": "$.heap3", + "ResultPath": null, "Type": "Pass", }, }, }, - "Next": "1__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in 1", + "Next": "$SFN.map(input.arr, function (n))", "Parameters": { "fnl_context.$": "$.fnl_context", "input.$": "$.input", @@ -19727,7 +14879,7 @@ exports[`call $SFN map, foreach, and parallel 1`] = ` }, }, }, - "Next": "3__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in", + "Next": "4__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in", "Parameters": { "fnl_context.$": "$.fnl_context", "input.$": "$.input", @@ -19739,25 +14891,13 @@ exports[`call $SFN map, foreach, and parallel 1`] = ` "1__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in": { "End": true, "Parameters": { - "a.$": "$.heap7", - "b.$": "$.heap9", + "a.$": "$.heap6", + "b.$": "$.heap8", "c.$": "$.heap10", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in 1": { - "InputPath": "$.heap6", - "Next": "$SFN.map(input.arr, function (n))", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "3__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in": { - "InputPath": "$.heap8", - "Next": "4__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "4__return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(in": { "Branches": [ { @@ -19854,7 +14994,7 @@ exports[`call $SFN map, foreach, and parallel 1`] = ` "input.$": "$.input", "n.$": "$$.Map.Item.Value", }, - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Map", }, "return {a: await $SFN.map([1, 2, 3], function (n)), b: await $SFN.map(input": { @@ -19881,30 +15021,6 @@ exports[`call $SFN retry 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "1__return [a, b, c, d, e] 1": { - "InputPath": "$.b", - "Next": "2__return [a, b, c, d, e]", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "2__return [a, b, c, d, e]": { - "InputPath": "$.c", - "Next": "3__return [a, b, c, d, e]", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "3__return [a, b, c, d, e]": { - "InputPath": "$.d", - "Next": "4__return [a, b, c, d, e]", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "4__return [a, b, c, d, e]": { - "InputPath": "$.e", - "Next": "[a, b, c, d, e]", - "ResultPath": "$.heap12", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "id", "Parameters": { @@ -19918,7 +15034,7 @@ exports[`call $SFN retry 1`] = ` "[a, b, c, d, e]": { "Next": "1__return [a, b, c, d, e]", "Parameters": { - "out.$": "States.Array($.heap8,$.heap9,$.heap10,$.heap11,$.heap12)", + "out.$": "States.Array($.a,$.b,$.c,$.d,$.e)", }, "ResultPath": "$.heap13", "Type": "Pass", @@ -20405,7 +15521,7 @@ exports[`call $SFN retry 1`] = ` "Type": "Pass", }, "catch__try 3": { - "Next": "return [a, b, c, d, e]", + "Next": "[a, b, c, d, e]", "Result": 7, "ResultPath": "$.e", "Type": "Pass", @@ -20430,22 +15546,16 @@ exports[`call $SFN retry 1`] = ` }, "e = await $SFN.retry([{ErrorEquals: ["MyError2"], BackoffRate: 1, IntervalS": { "InputPath": "$.heap7[0]", - "Next": "return [a, b, c, d, e]", + "Next": "[a, b, c, d, e]", "ResultPath": "$.e", "Type": "Pass", }, "id": { - "InputPath": "$$.Execution.Input['id']", + "InputPath": "$$.Execution.Input.id", "Next": "a = await $SFN.retry(function ())", "ResultPath": "$.id", "Type": "Pass", }, - "return [a, b, c, d, e]": { - "InputPath": "$.a", - "Next": "1__return [a, b, c, d, e] 1", - "ResultPath": "$.heap8", - "Type": "Pass", - }, "try": { "Branches": [ { @@ -20767,12 +15877,6 @@ exports[`call lambda 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "10__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func": { - "InputPath": "$.heap10", - "Next": "11__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "11__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func": { "Branches": [ { @@ -20818,12 +15922,12 @@ exports[`call lambda 1`] = ` "1__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { "End": true, "Parameters": { - "f1.$": "$.heap1", - "f2.$": "$.heap3", - "f3.$": "$.heap5", - "f4.$": "$.heap7", - "f5.$": "$.heap9", - "f6.$": "$.heap11", + "f1.$": "$.f1", + "f2.$": "$.heap2.str", + "f3.$": "$.heap4.str", + "f4.$": "$.heap6.str", + "f5.$": "$.heap8", + "f6.$": "$.heap10", "f7.$": "$.heap13[0].Payload.str", }, "ResultPath": "$", @@ -20831,19 +15935,13 @@ exports[`call lambda 1`] = ` }, "1__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2 1": { "InputPath": "$.event.str", - "Next": "2__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", + "Next": "3__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap2", "Type": "Task", }, - "2__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "InputPath": "$.heap2.str", - "Next": "3__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "3__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "Next": "4__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", + "Next": "5__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", "Parameters": { "str": "hello world 2", }, @@ -20851,27 +15949,15 @@ exports[`call lambda 1`] = ` "ResultPath": "$.heap4", "Type": "Task", }, - "4__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "InputPath": "$.heap4.str", - "Next": "5__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "5__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { "InputPath": "$.obj", - "Next": "6__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", + "Next": "7__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap6", "Type": "Task", }, - "6__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "InputPath": "$.heap6.str", - "Next": "7__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "7__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "Next": "8__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", + "Next": "9__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", "Parameters": [ 1, 2, @@ -20880,15 +15966,9 @@ exports[`call lambda 1`] = ` "ResultPath": "$.heap8", "Type": "Task", }, - "8__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { - "InputPath": "$.heap8", - "Next": "9__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "9__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2": { "InputPath": "$.arr", - "Next": "10__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func", + "Next": "11__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap10", "Type": "Task", @@ -20905,7 +15985,7 @@ exports[`call lambda 1`] = ` "Type": "Pass", }, "arr = [1, 2, 3]": { - "Next": "return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2({s", + "Next": "1__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2 1", "Result": [ 1, 2, @@ -20935,12 +16015,6 @@ exports[`call lambda 1`] = ` "ResultPath": "$.obj", "Type": "Pass", }, - "return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2({s": { - "InputPath": "$.f1", - "Next": "1__return {f1: f1, f2: await echoStringFunc(event.str).str, f3: await func2 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, }, } `; @@ -20952,32 +16026,14 @@ exports[`clean state after input 1`] = ` "1__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?": { "End": true, "Parameters": { - "a.$": "$.heap2", + "a.$": "$.input.a", "initA.$": "$.heap5", - "stateA.$": "$.heap1", - "stateInput.$": "$.heap4", + "stateA.$": "$.heap0", + "stateInput.$": "$.heap3", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ? 1": { - "InputPath": "$.heap0", - "Next": "2__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "2__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?": { - "InputPath": "$.input.a", - "Next": "state.input.a ?? null", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "4__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?": { - "InputPath": "$.heap3", - "Next": "a ?? null", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "state = dumpState()", "Parameters": { @@ -21016,13 +16072,13 @@ exports[`clean state after input 1`] = ` }, "false__return {stateA: state.a ?? null, a: input.a, stateInput: state.input": { "InputPath": "$.fnl_context.null", - "Next": "1__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ? 1", + "Next": "state.input.a ?? null", "ResultPath": "$.heap0", "Type": "Pass", }, "false__state.input.a ?? null": { "InputPath": "$.fnl_context.null", - "Next": "4__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?", + "Next": "a ?? null", "ResultPath": "$.heap3", "Type": "Pass", }, @@ -21078,13 +16134,13 @@ exports[`clean state after input 1`] = ` }, "true__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.": { "InputPath": "$.state.a", - "Next": "1__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ? 1", + "Next": "state.input.a ?? null", "ResultPath": "$.heap0", "Type": "Pass", }, "true__state.input.a ?? null": { "InputPath": "$.state.input.a", - "Next": "4__return {stateA: state.a ?? null, a: input.a, stateInput: state.input.a ?", + "Next": "a ?? null", "ResultPath": "$.heap3", "Type": "Pass", }, @@ -21372,7 +16428,7 @@ exports[`context 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "return name: context.Execution.Name", + "Next": "name: context.Execution.Name", "Parameters": { "_.$": "$$.Execution.Input", "fnl_context": { @@ -21385,17 +16441,11 @@ exports[`context 1`] = ` "name: context.Execution.Name": { "Next": "1__return name: context.Execution.Name", "Parameters": { - "string.$": "States.Format('name: {}',$.heap0)", + "string.$": "States.Format('name: {}',$$.Execution.Name)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "return name: context.Execution.Name": { - "InputPath": "$$.Execution.Name", - "Next": "name: context.Execution.Name", - "ResultPath": "$.heap0", - "Type": "Pass", - }, }, } `; @@ -21413,7 +16463,7 @@ exports[`continue break 1`] = ` "1a": { "Next": "a = 1a 1", "Parameters": { - "string.$": "States.Format('{}1',$.heap0)", + "string.$": "States.Format('{}1',$.a)", }, "ResultPath": "$.heap1", "Type": "Pass", @@ -21421,7 +16471,7 @@ exports[`continue break 1`] = ` "2a": { "Next": "a = 2a 1", "Parameters": { - "string.$": "States.Format('{}2',$.heap2)", + "string.$": "States.Format('{}2',$.a)", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -21442,24 +16492,12 @@ exports[`continue break 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = 1a": { - "InputPath": "$.a", - "Next": "1a", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = 1a 1": { "InputPath": "$.heap1.string", "Next": "if(a !== "111")", "ResultPath": "$.a", "Type": "Pass", }, - "a = 2a": { - "InputPath": "$.a", - "Next": "2a", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "a = 2a 1": { "InputPath": "$.heap3.string", "Next": "while (true)", @@ -21469,29 +16507,17 @@ exports[`continue break 1`] = ` "ab": { "Next": "1__return ab", "Parameters": { - "string.$": "States.Format('{}{}',$.heap8,$.heap9)", + "string.$": "States.Format('{}{}',$.a,$.b)", }, "ResultPath": "$.heap10", "Type": "Pass", }, - "b": { - "InputPath": "$.b", - "Next": "ab", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "b = """: { "Next": "for(i of [1, 2, 3, 4])", "Result": "", "ResultPath": "$.b", "Type": "Pass", }, - "b = bi": { - "InputPath": "$.b", - "Next": "i 1", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "b = bi 1": { "InputPath": "$.heap6.string", "Next": "if(i === 3)", @@ -21501,7 +16527,7 @@ exports[`continue break 1`] = ` "bi": { "Next": "b = bi 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap4,$.heap5)", + "string.$": "States.Format('{}{}',$.b,$.i)", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -21525,7 +16551,7 @@ exports[`continue break 1`] = ` "Variable": "$.heap7[0]", }, ], - "Default": "return ab", + "Default": "ab", "Type": "Choice", }, "i": { @@ -21534,12 +16560,6 @@ exports[`continue break 1`] = ` "ResultPath": "$.i", "Type": "Pass", }, - "i 1": { - "InputPath": "$.i", - "Next": "bi", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "if(a !== "111")": { "Choices": [ { @@ -21637,7 +16657,7 @@ exports[`continue break 1`] = ` }, }, ], - "Default": "a = 2a", + "Default": "2a", "Type": "Choice", }, "if(i === 1)": { @@ -21672,7 +16692,7 @@ exports[`continue break 1`] = ` "Next": "tail__for(i of [1, 2, 3, 4])", }, ], - "Default": "b = bi", + "Default": "bi", "Type": "Choice", }, "if(i === 3)": { @@ -21704,18 +16724,12 @@ exports[`continue break 1`] = ` ], }, ], - "Next": "return ab", + "Next": "ab", }, ], "Default": "tail__for(i of [1, 2, 3, 4])", "Type": "Choice", }, - "return ab": { - "InputPath": "$.a", - "Next": "b", - "ResultPath": "$.heap8", - "Type": "Pass", - }, "tail__for(i of [1, 2, 3, 4])": { "InputPath": "$.heap7[1:]", "Next": "hasNext__for(i of [1, 2, 3, 4])", @@ -21726,7 +16740,7 @@ exports[`continue break 1`] = ` "Choices": [ { "IsNull": false, - "Next": "a = 1a", + "Next": "1a", "Variable": "$$.Execution.Id", }, ], @@ -21789,7 +16803,14 @@ exports[`destructure 1`] = ` "1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).join() 1": { "Next": "check__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).j", "Parameters": { - "arr.$": "$.heap5", + "arr": [ + { + "aa": "a", + "bb": [ + "b", + ], + }, + ], "arrStr": "[null", }, "ResultPath": "$.heap6", @@ -21804,43 +16825,19 @@ exports[`destructure 1`] = ` "1__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV": { "End": true, "Parameters": { - "forV.$": "$.heap50", - "map.$": "$.heap49", - "prop.$": "$.heap38", + "forV.$": "$.forV", + "map.$": "$.map", + "prop.$": "$.heap37.string", "sfnMap.$": "$.sfnMap", - "tr.$": "$.heap51", - "var.$": "$.heap48", + "tr": "hi", + "var.$": "$.heap47.string", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV 1": { - "InputPath": "$.heap37.string", - "Next": "zwvxsuttserRra[0]", - "ResultPath": "$.heap38", - "Type": "Pass", - }, - "3__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV": { - "InputPath": "$.heap47.string", - "Next": "4__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "4__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV": { - "InputPath": "$.map", - "Next": "5__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "5__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV": { - "InputPath": "$.forV", - "Next": "6__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", - "ResultPath": "$.heap50", - "Type": "Pass", - }, "6__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV": { - "InputPath": "$.tr", "Next": "1__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", + "Parameters": "hi", "ResultPath": "$.heap51", "Type": "Pass", }, @@ -21855,13 +16852,13 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "[ d, , e, arrRest ]": { - "InputPath": "$$.Execution.Input['arr'][0]", + "InputPath": "$$.Execution.Input.arr[0]", "Next": "e", "ResultPath": "$.d", "Type": "Pass", }, "[ s, , u, tserRra ]": { - "InputPath": "$.value['rra'][0]", + "InputPath": "$.value.rra[0]", "Next": "u", "ResultPath": "$.s", "Type": "Pass", @@ -21869,15 +16866,15 @@ exports[`destructure 1`] = ` "aacc": { "Next": "1__return aacc", "Parameters": { - "string.$": "States.Format('{}{}',$.heap7,$.heap8)", + "string.$": "States.Format('{}{}',$.heap6.arr[0].aa,$.heap6.arr[0].bb[0])", }, "ResultPath": "$.heap9", "Type": "Pass", }, "abcdefarrRest[0]rm": { - "Next": "1__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV 1", + "Next": "zwvxsuttserRra[0] 1", "Parameters": { - "string.$": "States.Format('{}{}{}{}{}{}{}{}{}',$.heap28,$.heap29,$.heap30,$.heap31,$.heap32,$.heap33,$.heap34,$.heap35,$.heap36)", + "string.$": "States.Format('{}{}{}{}{}{}{}{}{}',$.a,$.b,$.c,$.d,$.e,$.f,$.arrRest[0],$.r,$.m)", }, "ResultPath": "$.heap37", "Type": "Pass", @@ -21904,52 +16901,20 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "arrRest": { - "InputPath": "$$.Execution.Input['arr'][3:]", + "InputPath": "$$.Execution.Input.arr[3:]", "Next": "f = "sir"", "ResultPath": "$.arrRest", "Type": "Pass", }, - "arrRest[0]": { - "InputPath": "$.arrRest[0]", - "Next": "r 1", - "ResultPath": "$.heap34", - "Type": "Pass", - }, "await $SFN.forEach(arr, function ({ a, b: [ c ] }))": { "ItemsPath": "$.arr", "Iterator": { "StartAt": "function ({ a, b: [ c ] }) 1", "States": { - " ac": { - "InputPath": "$.a__2", - "Next": "c 2", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - " ac 1": { - "Next": "return null", - "Parameters": { - "string.$": "States.Format('{} {}',$.heap23,$.heap24)", - }, - "ResultPath": "$.heap25", - "Type": "Pass", - }, - "c 1": { - "InputPath": "$.heap26['b'][0]", - "Next": " ac", - "ResultPath": "$.c__2", - "Type": "Pass", - }, - "c 2": { - "InputPath": "$.c__2", - "Next": " ac 1", - "ResultPath": "$.heap24", - "Type": "Pass", - }, "function ({ a, b: [ c ] }) 1": { - "InputPath": "$.heap26['a']", - "Next": "c 1", - "ResultPath": "$.a__2", + "InputPath": "$.heap26.a", + "Next": "return null", + "ResultPath": null, "Type": "Pass", }, "return null": { @@ -21987,73 +16952,43 @@ exports[`destructure 1`] = ` "x.$": "$.x", "z.$": "$.z", }, - "ResultPath": "$.heap27", + "ResultPath": null, "Type": "Map", }, - "b": { - "InputPath": "$.b", - "Next": "c 4", - "ResultPath": "$.heap29", - "Type": "Pass", - }, "c 3": { "InputPath": "$.heap0", "Next": "m = c", "ResultPath": "$.c", "Type": "Pass", }, - "c 4": { - "InputPath": "$.c", - "Next": "d", - "ResultPath": "$.heap30", - "Type": "Pass", - }, "c = "what"": { "Choices": [ { "IsPresent": true, "Next": "value__c = "what"", - "Variable": "$$.Execution.Input['c']", + "Variable": "$$.Execution.Input.c", }, ], "Default": "default__c = "what"", "Type": "Choice", }, "catch__try": { - "InputPath": "$.fnl_tmp_1['message']", "Next": "tr = message", + "Parameters": "hi", "ResultPath": "$.message", "Type": "Pass", }, - "cc": { - "InputPath": "$.heap6.arr[0]['bb'][0]", - "Next": "return aacc", - "ResultPath": "$.cc", - "Type": "Pass", - }, - "cc 1": { - "InputPath": "$.cc", - "Next": "aacc", - "ResultPath": "$.heap8", - "Type": "Pass", - }, "check__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).j": { "Choices": [ { "IsPresent": true, - "Next": "{ aa, bb: [ cc ] }", + "Next": "aacc", "Variable": "$.heap6.arr[0]", }, ], "Default": "end__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).joi", "Type": "Choice", }, - "d": { - "InputPath": "$.d", - "Next": "e 1", - "ResultPath": "$.heap31", - "Type": "Pass", - }, "default__c = "what"": { "Next": "c 3", "Result": "what", @@ -22085,17 +17020,11 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "e": { - "InputPath": "$$.Execution.Input['arr'][2]", + "InputPath": "$$.Execution.Input.arr[2]", "Next": "arrRest", "ResultPath": "$.e", "Type": "Pass", }, - "e 1": { - "InputPath": "$.e", - "Next": "f 1", - "ResultPath": "$.heap32", - "Type": "Pass", - }, "end__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).joi": { "Next": "set__end__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })", "Parameters": { @@ -22110,18 +17039,12 @@ exports[`destructure 1`] = ` "ResultPath": "$.f", "Type": "Pass", }, - "f 1": { - "InputPath": "$.f", - "Next": "arrRest[0]", - "ResultPath": "$.heap33", - "Type": "Pass", - }, "f = "sir"": { "Choices": [ { "IsPresent": true, "Next": "value__f = "sir"", - "Variable": "$$.Execution.Input['arr2'][0]", + "Variable": "$$.Execution.Input.arr2[0]", }, ], "Default": "default__f = "sir"", @@ -22146,12 +17069,6 @@ exports[`destructure 1`] = ` "ResultPath": "$.forV", "Type": "Pass", }, - "forV = forVhl": { - "InputPath": "$.forV", - "Next": "h", - "ResultPath": "$.heap13", - "Type": "Pass", - }, "forV = forVhl 1": { "InputPath": "$.heap16.string", "Next": "tail__for({ h, j: [ l ] } of [{h: "a", j: ["b"]}])", @@ -22161,17 +17078,11 @@ exports[`destructure 1`] = ` "forVhl": { "Next": "forV = forVhl 1", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap13,$.heap14,$.heap15)", + "string.$": "States.Format('{}{}{}',$.forV,$.heap17[0].h,$.heap17[0].j[0])", }, "ResultPath": "$.heap16", "Type": "Pass", }, - "h": { - "InputPath": "$.h", - "Next": "l 1", - "ResultPath": "$.heap14", - "Type": "Pass", - }, "handleResult__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ": { "Next": "check__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).j", "Parameters": { @@ -22224,7 +17135,7 @@ exports[`destructure 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "{ h, j: [ l ] }", + "Next": "forVhl", "Variable": "$.heap17[0]", }, ], @@ -22237,36 +17148,18 @@ exports[`destructure 1`] = ` "ResultPath": "$.heap11.string", "Type": "Pass", }, - "l": { - "InputPath": "$.heap17[0]['j'][0]", - "Next": "forV = forVhl", - "ResultPath": "$.l", - "Type": "Pass", - }, - "l 1": { - "InputPath": "$.l", - "Next": "forVhl", - "ResultPath": "$.heap15", - "Type": "Pass", - }, "m": { "InputPath": "$.heap1", "Next": "[ d, , e, arrRest ]", "ResultPath": "$.m", "Type": "Pass", }, - "m 1": { - "InputPath": "$.m", - "Next": "abcdefarrRest[0]rm", - "ResultPath": "$.heap36", - "Type": "Pass", - }, "m = c": { "Choices": [ { "IsPresent": true, "Next": "value__m = c", - "Variable": "$$.Execution.Input['m']", + "Variable": "$$.Execution.Input.m", }, ], "Default": "default__m = c", @@ -22292,41 +17185,17 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "r": { - "InputPath": "$$.Execution.Input['bb']['ab']", + "InputPath": "$$.Execution.Input.bb.ab", "Next": "c = "what"", "ResultPath": "$.r", "Type": "Pass", }, - "r 1": { - "InputPath": "$.r", - "Next": "m 1", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "return aacc": { - "InputPath": "$.aa", - "Next": "cc 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV: f": { - "InputPath": "$.a", - "Next": "b", - "ResultPath": "$.heap28", - "Type": "Pass", - }, "returnEmpty__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ]": { "Next": "map", "Result": "", "ResultPath": "$.heap11.string", "Type": "Pass", }, - "s": { - "InputPath": "$.s", - "Next": "u 1", - "ResultPath": "$.heap43", - "Type": "Pass", - }, "set__end__1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })": { "InputPath": "$.heap6.result[1:]", "Next": "1__map = [{aa: "a", bb: ["b"]}].map(function ({ aa, bb: [ cc ] })).join()", @@ -22487,7 +17356,7 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "c": { - "InputPath": "$.heap21['b'][0]", + "InputPath": "$.heap21.b[0]", "Next": "return a + c", "ResultPath": "$.c__1", "Type": "Pass", @@ -22670,7 +17539,7 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "function ({ a, b: [ c ] })": { - "InputPath": "$.heap21['a']", + "InputPath": "$.heap21.a", "Next": "c", "ResultPath": "$.a__1", "Type": "Pass", @@ -22855,18 +17724,12 @@ exports[`destructure 1`] = ` "ResultPath": "$.t", "Type": "Pass", }, - "t 1": { - "InputPath": "$.t", - "Next": "tserRra[0]", - "ResultPath": "$.heap45", - "Type": "Pass", - }, "t = "sir"": { "Choices": [ { "IsPresent": true, "Next": "value__t = "sir"", - "Variable": "$.value['rra2'][0]", + "Variable": "$.value.rra2[0]", }, ], "Default": "default__t = "sir"", @@ -22885,8 +17748,8 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "tr = message": { - "InputPath": "$.message", - "Next": "return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV: f", + "Next": "abcdefarrRest[0]rm", + "Parameters": "hi", "ResultPath": "$.tr", "Type": "Pass", }, @@ -22899,152 +17762,104 @@ exports[`destructure 1`] = ` "Type": "Pass", }, "tserRra": { - "InputPath": "$.value['rra'][3:]", + "InputPath": "$.value.rra[3:]", "Next": "t = "sir"", "ResultPath": "$.tserRra", "Type": "Pass", }, - "tserRra[0]": { - "InputPath": "$.tserRra[0]", - "Next": "zwvxsuttserRra[0] 1", - "ResultPath": "$.heap46", - "Type": "Pass", - }, "u": { - "InputPath": "$.value['rra'][2]", + "InputPath": "$.value.rra[2]", "Next": "tserRra", "ResultPath": "$.u", "Type": "Pass", }, - "u 1": { - "InputPath": "$.u", - "Next": "t 1", - "ResultPath": "$.heap44", - "Type": "Pass", - }, "v": { - "InputPath": "$.value['yy']['ab']", + "InputPath": "$.value.yy.ab", "Next": "x = "what"", "ResultPath": "$.v", "Type": "Pass", }, - "v 1": { - "InputPath": "$.v", - "Next": "x 1", - "ResultPath": "$.heap41", - "Type": "Pass", - }, "value": { - "InputPath": "$$.Execution.Input['value']", + "InputPath": "$$.Execution.Input.value", "Next": "{ z, yy: { ["value"]: w, ["a""b"]: v }, x = "what", rra: [ s, , u, tserRra ", "ResultPath": "$.value", "Type": "Pass", }, "value__c = "what"": { - "InputPath": "$$.Execution.Input['c']", + "InputPath": "$$.Execution.Input.c", "Next": "c 3", "ResultPath": "$.heap0", "Type": "Pass", }, "value__f = "sir"": { - "InputPath": "$$.Execution.Input['arr2'][0]", + "InputPath": "$$.Execution.Input.arr2[0]", "Next": "f", "ResultPath": "$.heap2", "Type": "Pass", }, "value__m = c": { - "InputPath": "$$.Execution.Input['m']", + "InputPath": "$$.Execution.Input.m", "Next": "m", "ResultPath": "$.heap1", "Type": "Pass", }, "value__t = "sir"": { - "InputPath": "$.value['rra2'][0]", + "InputPath": "$.value.rra2[0]", "Next": "t", "ResultPath": "$.heap4", "Type": "Pass", }, "value__x = "what"": { - "InputPath": "$.value['x']", + "InputPath": "$.value.x", "Next": "x", "ResultPath": "$.heap3", "Type": "Pass", }, - "w": { - "InputPath": "$.w", - "Next": "v 1", - "ResultPath": "$.heap40", - "Type": "Pass", - }, "x": { "InputPath": "$.heap3", "Next": "[ s, , u, tserRra ]", "ResultPath": "$.x", "Type": "Pass", }, - "x 1": { - "InputPath": "$.x", - "Next": "s", - "ResultPath": "$.heap42", - "Type": "Pass", - }, "x = "what"": { "Choices": [ { "IsPresent": true, "Next": "value__x = "what"", - "Variable": "$.value['x']", + "Variable": "$.value.x", }, ], "Default": "default__x = "what"", "Type": "Choice", }, - "zwvxsuttserRra[0]": { - "InputPath": "$.z", - "Next": "w", - "ResultPath": "$.heap39", - "Type": "Pass", - }, "zwvxsuttserRra[0] 1": { - "Next": "3__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", + "Next": "6__return {prop: abcdefarrRest[0]rm, var: zwvxsuttserRra[0], map: map, forV", "Parameters": { - "string.$": "States.Format('{}{}{}{}{}{}{}{}',$.heap39,$.heap40,$.heap41,$.heap42,$.heap43,$.heap44,$.heap45,$.heap46)", + "string.$": "States.Format('{}{}{}{}{}{}{}{}',$.z,$.w,$.v,$.x,$.s,$.u,$.t,$.tserRra[0])", }, "ResultPath": "$.heap47", "Type": "Pass", }, "{ ["value"]: w, ["a""b"]: v }": { - "InputPath": "$.value['yy']['value']", + "InputPath": "$.value.yy.value", "Next": "v", "ResultPath": "$.w", "Type": "Pass", }, "{ a, bb: { value: b, ["a""b"]: r }, c = "what", m = c, arr: [ d, , e, arrRe": { - "InputPath": "$$.Execution.Input['a']", + "InputPath": "$$.Execution.Input.a", "Next": "{ value: b, ["a""b"]: r }", "ResultPath": "$.a", "Type": "Pass", }, - "{ aa, bb: [ cc ] }": { - "InputPath": "$.heap6.arr[0]['aa']", - "Next": "cc", - "ResultPath": "$.aa", - "Type": "Pass", - }, - "{ h, j: [ l ] }": { - "InputPath": "$.heap17[0]['h']", - "Next": "l", - "ResultPath": "$.h", - "Type": "Pass", - }, "{ value: b, ["a""b"]: r }": { - "InputPath": "$$.Execution.Input['bb']['value']", + "InputPath": "$$.Execution.Input.bb.value", "Next": "r", "ResultPath": "$.b", "Type": "Pass", }, "{ z, yy: { ["value"]: w, ["a""b"]: v }, x = "what", rra: [ s, , u, tserRra ": { - "InputPath": "$.value['z']", + "InputPath": "$.value.z", "Next": "{ ["value"]: w, ["a""b"]: v }", "ResultPath": "$.z", "Type": "Pass", @@ -23082,7 +17897,7 @@ exports[`filter 1`] = ` "StartAt": "Initialize Functionless Context", "States": { "$SFN.waitFor(1)": { - "Next": "return itemKey === hikey", + "Next": "hikey", "Seconds": 1, "Type": "Wait", }, @@ -23095,8 +17910,8 @@ exports[`filter 1`] = ` "1__return {arr1: arr1, arr2: arr2}": { "End": true, "Parameters": { - "arr1.$": "$.heap9", - "arr2.$": "$.arr2", + "arr1.$": "$.heap0", + "arr2.$": "$.heap6", }, "ResultPath": "$", "Type": "Pass", @@ -23141,16 +17956,10 @@ exports[`filter 1`] = ` }, "Type": "Map", }, - "arr1": { - "InputPath": "$.heap0", - "Next": "arr2 = [4, 3, 2, 1].filter(function (x,index,[ first ]))", - "ResultPath": "$.arr1", - "Type": "Pass", - }, "arr1 = arr.filter(function ({ value })).filter(function ({ value })).filter": { "Next": "check__arr1 = arr.filter(function ({ value })).filter(function ({ value }))", "Parameters": { - "arr.$": "$.arr[?(@['value']<=3)][?(@['value']<=$.key)]", + "arr.$": "$.arr[?(@.value<=3)][?(@.value<=$.key)]", "arrStr": "[null", }, "ResultPath": "$.heap0", @@ -23188,7 +17997,7 @@ exports[`filter 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "{ key: itemKey } = item", "Variable": "$.heap0.arr[0]", }, ], @@ -23440,7 +18249,7 @@ exports[`filter 1`] = ` "hikey": { "Next": "itemKey === hikey", "Parameters": { - "string.$": "States.Format('hi{}',$.heap2)", + "string.$": "States.Format('hi{}',$.key)", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -23451,12 +18260,6 @@ exports[`filter 1`] = ` "ResultPath": "$.index", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "{ key: itemKey } = item", - "ResultPath": "$.item", - "Type": "Pass", - }, "itemKey === hikey": { "Choices": [ { @@ -23561,7 +18364,7 @@ exports[`filter 1`] = ` "Type": "Choice", }, "key": { - "InputPath": "$$.Execution.Input['key']", + "InputPath": "$$.Execution.Input.key", "Next": "arr1 = arr.filter(function ({ value })).filter(function ({ value })).filter", "ResultPath": "$.key", "Type": "Pass", @@ -23584,12 +18387,6 @@ exports[`filter 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "return itemKey === hikey": { - "InputPath": "$.key", - "Next": "hikey", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "return x <= index || first === x": { "Choices": [ { @@ -23750,7 +18547,7 @@ exports[`filter 1`] = ` "Type": "Choice", }, "return {arr1: arr1, arr2: arr2}": { - "InputPath": "$.arr1", + "InputPath": "$.heap0", "Next": "1__return {arr1: arr1, arr2: arr2}", "ResultPath": "$.heap9", "Type": "Pass", @@ -23763,7 +18560,7 @@ exports[`filter 1`] = ` }, "set__end__arr1 = arr.filter(function ({ value })).filter(function ({ value ": { "InputPath": "$.heap0.result[1:]", - "Next": "arr1", + "Next": "arr2 = [4, 3, 2, 1].filter(function (x,index,[ first ]))", "ResultPath": "$.heap0", "Type": "Pass", }, @@ -23792,13 +18589,13 @@ exports[`filter 1`] = ` "Type": "Pass", }, "{ arr, key }": { - "InputPath": "$$.Execution.Input['arr']", + "InputPath": "$$.Execution.Input.arr", "Next": "key", "ResultPath": "$.arr", "Type": "Pass", }, "{ key: itemKey } = item": { - "InputPath": "$.item['key']", + "InputPath": "$.heap0.arr[0].key", "Next": "$SFN.waitFor(1)", "ResultPath": "$.itemKey", "Type": "Pass", @@ -23906,7 +18703,7 @@ exports[`for 1`] = ` ], }, ], - "Next": "a = naarr[0]", + "Next": "naarr[0]", }, ], "Default": "c = """, @@ -23915,7 +18712,7 @@ exports[`for 1`] = ` "1c": { "Next": "c = 1c 2", "Parameters": { - "string.$": "States.Format('{}1',$.heap3)", + "string.$": "States.Format('{}1',$.c)", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -23923,7 +18720,7 @@ exports[`for 1`] = ` "1c 1": { "Next": "c = 1c 3", "Parameters": { - "string.$": "States.Format('{}1',$.heap8)", + "string.$": "States.Format('{}1',$.c)", }, "ResultPath": "$.heap9", "Type": "Pass", @@ -23945,24 +18742,12 @@ exports[`for 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = cac": { - "InputPath": "$.a", - "Next": "c", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "a = cac 1": { "InputPath": "$.heap7.string", - "Next": "c = 1c", + "Next": "1c 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = naarr[0]": { - "InputPath": "$.a", - "Next": "arr[0]", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = naarr[0] 1": { "InputPath": "$.heap2.string", "Next": "arr = arr.slice(1)", @@ -23975,36 +18760,12 @@ exports[`for 1`] = ` "ResultPath": "$.arr", "Type": "Pass", }, - "arr[0]": { - "InputPath": "$.arr[0]", - "Next": "naarr[0]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "c": { - "InputPath": "$.c", - "Next": "cac", - "ResultPath": "$.heap6", - "Type": "Pass", - }, "c = """: { "Next": "if(c === "1")", "Result": "", "ResultPath": "$.c", "Type": "Pass", }, - "c = 1c": { - "InputPath": "$.c", - "Next": "1c 1", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "c = 1c 1": { - "InputPath": "$.c", - "Next": "1c", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "c = 1c 2": { "InputPath": "$.heap4.string", "Next": "if(c === "1")", @@ -24020,7 +18781,7 @@ exports[`for 1`] = ` "cac": { "Next": "a = cac 1", "Parameters": { - "string.$": "States.Format('{}c{}',$.heap5,$.heap6)", + "string.$": "States.Format('{}c{}',$.a,$.c)", }, "ResultPath": "$.heap7", "Type": "Pass", @@ -24060,7 +18821,7 @@ exports[`for 1`] = ` ], }, ], - "Next": "c = 1c 1", + "Next": "1c", }, { "And": [ @@ -24092,13 +18853,13 @@ exports[`for 1`] = ` "Next": "return a", }, ], - "Default": "a = cac", + "Default": "cac", "Type": "Choice", }, "naarr[0]": { "Next": "a = naarr[0] 1", "Parameters": { - "string.$": "States.Format('{}n{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}n{}',$.a,$.arr[0])", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -24174,42 +18935,18 @@ exports[`for control and assignment 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = nai": { - "InputPath": "$.a", - "Next": "i 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = nai 1": { "InputPath": "$.heap2.string", "Next": "tail__for(i in input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "a = nai 2": { - "InputPath": "$.a", - "Next": "i 3", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "a = nai 3": { "InputPath": "$.heap6.string", "Next": "tail__for(i in input.arr) 1", "ResultPath": "$.a", "Type": "Pass", }, - "assignValue__i": { - "InputPath": "$.heap3[0].item", - "Next": "if(i === "2")", - "ResultPath": "$.0__i", - "Type": "Pass", - }, - "assignValue__i 2": { - "InputPath": "$.heap7[0].item", - "Next": "if(i !== "2")", - "ResultPath": "$.0__i__1", - "Type": "Pass", - }, "for(i in input.arr)": { "InputPath": "$.input.arr", "Next": "1__for(i in input.arr)", @@ -24263,28 +19000,16 @@ exports[`for control and assignment 1`] = ` }, "i": { "InputPath": "$.heap3[0].index", - "Next": "assignValue__i", + "Next": "if(i === "2")", "ResultPath": "$.i", "Type": "Pass", }, - "i 1": { - "InputPath": "$.i", - "Next": "nai", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "i 2": { "InputPath": "$.heap7[0].index", - "Next": "assignValue__i 2", + "Next": "if(i !== "2")", "ResultPath": "$.i__1", "Type": "Pass", }, - "i 3": { - "InputPath": "$.i__1", - "Next": "nai 1", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "i 4": { "InputPath": "$.heap8[0]", "Next": "if(i === 2)", @@ -24325,7 +19050,7 @@ exports[`for control and assignment 1`] = ` }, }, ], - "Default": "a = nai 2", + "Default": "nai 1", "Type": "Choice", }, "if(i === "2")": { @@ -24360,7 +19085,7 @@ exports[`for control and assignment 1`] = ` "Next": "for(i in input.arr) 1", }, ], - "Default": "a = nai", + "Default": "nai", "Type": "Choice", }, "if(i === 2)": { @@ -24401,7 +19126,7 @@ exports[`for control and assignment 1`] = ` "nai": { "Next": "a = nai 1", "Parameters": { - "string.$": "States.Format('{}n{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}n{}',$.a,$.i)", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -24409,7 +19134,7 @@ exports[`for control and assignment 1`] = ` "nai 1": { "Next": "a = nai 3", "Parameters": { - "string.$": "States.Format('{}n{}',$.heap4,$.heap5)", + "string.$": "States.Format('{}n{}',$.a,$.i__1)", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -24455,7 +19180,7 @@ exports[`for in 1`] = ` "--aj": { "Next": "a = --aj 1", "Parameters": { - "string.$": "States.Format('{}--{}',$.heap12,$.heap13)", + "string.$": "States.Format('{}--{}',$.a,$.j)", }, "ResultPath": "$.heap14", "Type": "Pass", @@ -24537,36 +19262,18 @@ exports[`for in 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = --aj": { - "InputPath": "$.a", - "Next": "j 2", - "ResultPath": "$.heap12", - "Type": "Pass", - }, "a = --aj 1": { "InputPath": "$.heap14.string", "Next": "tail__for(i in input.arr) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = aiinput.arr[i]": { - "InputPath": "$.a", - "Next": "i 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = aiinput.arr[i] 1": { "InputPath": "$.heap3.string", "Next": "tail__for(i in input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "a = |naiinput.arr[i]nijinput.arr[j]j": { - "InputPath": "$.a", - "Next": "iinput.arr[i]", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "a = |naiinput.arr[i]nijinput.arr[j]j 1": { "InputPath": "$.heap10.string", "Next": "tail__for(j in input.arr)", @@ -24576,27 +19283,15 @@ exports[`for in 1`] = ` "aiinput.arr[i]": { "Next": "a = aiinput.arr[i] 1", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap0,$.heap1,$.heap2)", + "string.$": "States.Format('{}{}{}',$.a,$.heap4[0].index,$.heap4[0].item)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignValue__i": { - "InputPath": "$.heap4[0].item", - "Next": "a = aiinput.arr[i]", - "ResultPath": "$.0__i", - "Type": "Pass", - }, "assignValue__i 2": { "InputPath": "$.heap15[0].item", "Next": "j = "1"", - "ResultPath": "$.0__i__1", - "Type": "Pass", - }, - "assignValue__j": { - "InputPath": "$.heap11[0].item", - "Next": "a = |naiinput.arr[i]nijinput.arr[j]j", - "ResultPath": "$.0__j", + "ResultPath": "$.fnls__0__i__1", "Type": "Pass", }, "for(i in input.arr)": { @@ -24621,7 +19316,7 @@ exports[`for in 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "aiinput.arr[i]", "Variable": "$.heap4[0]", }, ], @@ -24647,55 +19342,19 @@ exports[`for in 1`] = ` "Variable": "$.heap11[0]", }, ], - "Default": "a = --aj", + "Default": "--aj", "Type": "Choice", }, - "i": { - "InputPath": "$.heap4[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, - "i 1": { - "InputPath": "$.i", - "Next": "input.arr[i]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "i 2": { "InputPath": "$.heap15[0].index", "Next": "assignValue__i 2", "ResultPath": "$.i__1", "Type": "Pass", }, - "iinput.arr[i]": { - "InputPath": "$.0__i__1", - "Next": "ni", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "input.arr[i]": { - "InputPath": "$.0__i", - "Next": "aiinput.arr[i]", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "j": { "InputPath": "$.heap11[0].index", - "Next": "assignValue__j", - "ResultPath": "$.j", - "Type": "Pass", - }, - "j 1": { - "InputPath": "$.j", "Next": "|naiinput.arr[i]nijinput.arr[j]j", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "j 2": { - "InputPath": "$.j", - "Next": "--aj", - "ResultPath": "$.heap13", + "ResultPath": "$.j", "Type": "Pass", }, "j = "1"": { @@ -24704,18 +19363,6 @@ exports[`for in 1`] = ` "ResultPath": "$.j", "Type": "Pass", }, - "jinput.arr[j]": { - "InputPath": "$.0__j", - "Next": "j 1", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "ni": { - "InputPath": "$.i__1", - "Next": "jinput.arr[j]", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "return a": { "End": true, "InputPath": "$.a", @@ -24743,7 +19390,7 @@ exports[`for in 1`] = ` "|naiinput.arr[i]nijinput.arr[j]j": { "Next": "a = |naiinput.arr[i]nijinput.arr[j]j 1", "Parameters": { - "string.$": "States.Format('{}|n{}i{}n{}j{}',$.heap5,$.heap6,$.heap7,$.heap8,$.heap9)", + "string.$": "States.Format('{}|n{}i{}n{}j{}',$.a,$.fnls__0__i__1,$.i__1,$.heap11[0].item,$.j)", }, "ResultPath": "$.heap10", "Type": "Pass", @@ -24773,36 +19420,18 @@ exports[`for loops 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = ai": { - "InputPath": "$.a", - "Next": "i 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = ai 1": { "InputPath": "$.heap2.string", "Next": "tail__for(i of [1, 2, 3])", "ResultPath": "$.a", "Type": "Pass", }, - "a = ai 2": { - "InputPath": "$.a", - "Next": "i 3", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "a = ai 3": { "InputPath": "$.heap6.string", "Next": "tail__for(i of input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "a = ai 4": { - "InputPath": "$.a", - "Next": "i 5", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "a = ai 5": { "InputPath": "$.heap11.string", "Next": "tail__for(i of await arrFunc()) 1", @@ -24812,7 +19441,7 @@ exports[`for loops 1`] = ` "ai": { "Next": "a = ai 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}{}',$.a,$.heap3[0])", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -24820,7 +19449,7 @@ exports[`for loops 1`] = ` "ai 1": { "Next": "a = ai 3", "Parameters": { - "string.$": "States.Format('{}{}',$.heap4,$.heap5)", + "string.$": "States.Format('{}{}',$.a,$.heap7[0])", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -24828,7 +19457,7 @@ exports[`for loops 1`] = ` "ai 2": { "Next": "a = ai 5", "Parameters": { - "string.$": "States.Format('{}{}',$.heap9,$.heap10)", + "string.$": "States.Format('{}{}',$.a,$.heap12[0])", }, "ResultPath": "$.heap11", "Type": "Pass", @@ -24866,7 +19495,7 @@ exports[`for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "ai", "Variable": "$.heap3[0]", }, ], @@ -24877,7 +19506,7 @@ exports[`for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i 4", + "Next": "ai 2", "Variable": "$.heap12[0]", }, ], @@ -24888,49 +19517,13 @@ exports[`for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i 2", + "Next": "ai 1", "Variable": "$.heap7[0]", }, ], "Default": "for(i of await arrFunc())", "Type": "Choice", }, - "i": { - "InputPath": "$.heap3[0]", - "Next": "a = ai", - "ResultPath": "$.i", - "Type": "Pass", - }, - "i 1": { - "InputPath": "$.i", - "Next": "ai", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "i 2": { - "InputPath": "$.heap7[0]", - "Next": "a = ai 2", - "ResultPath": "$.i__1", - "Type": "Pass", - }, - "i 3": { - "InputPath": "$.i__1", - "Next": "ai 1", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "i 4": { - "InputPath": "$.heap12[0]", - "Next": "a = ai 4", - "ResultPath": "$.i__2", - "Type": "Pass", - }, - "i 5": { - "InputPath": "$.i__2", - "Next": "ai 2", - "ResultPath": "$.heap10", - "Type": "Pass", - }, "return \`madeit\`": { "End": true, "Result": "madeit", @@ -24966,7 +19559,9 @@ exports[`for map conditional 1`] = ` "1__b = ["b"].map(function (v))": { "Next": "check__1__b = ["b"].map(function (v))", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + "b", + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -24975,7 +19570,9 @@ exports[`for map conditional 1`] = ` "1__c = ["c"].map(function (v))": { "Next": "check__1__c = ["c"].map(function (v))", "Parameters": { - "arr.$": "$.heap7", + "arr": [ + "c", + ], "arrStr": "[null", }, "ResultPath": "$.heap8", @@ -24984,7 +19581,9 @@ exports[`for map conditional 1`] = ` "1__d = await Promise.all(["d"].map(function (v)))": { "Next": "check__1__d = await Promise.all(["d"].map(function (v)))", "Parameters": { - "arr.$": "$.heap14", + "arr": [ + "d", + ], "arrStr": "[null", }, "ResultPath": "$.heap15", @@ -25025,24 +19624,6 @@ exports[`for map conditional 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a": { - "InputPath": "$.a", - "Next": "i 1", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "a 1": { - "InputPath": "$.a", - "Next": "i 3", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "a 2": { - "InputPath": "$.a", - "Next": "i 5", - "ResultPath": "$.heap18", - "Type": "Pass", - }, "a = "x"": { "Next": "b = ["b"].map(function (v))", "Result": "x", @@ -25073,12 +19654,6 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.heap23", "Type": "Pass", }, - "b": { - "InputPath": "$.heap1", - "Next": "c = ["c"].map(function (v))", - "ResultPath": "$.b", - "Type": "Pass", - }, "b = ["b"].map(function (v))": { "Next": "1__b = ["b"].map(function (v))", "Result": [ @@ -25087,26 +19662,14 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "b.join("")": { - "InputPath": "$.heap23.string", - "Next": "c.join("")", - "ResultPath": "$.heap25", - "Type": "Pass", - }, "b.join("")c.join("")d.join("")": { "Next": "1__return b.join("")c.join("")d.join("")", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap25,$.heap29,$.heap33)", + "string.$": "States.Format('{}{}{}',$.heap23.string,$.heap27.string,$.heap31.string)", }, "ResultPath": "$.heap34", "Type": "Pass", }, - "c": { - "InputPath": "$.heap8", - "Next": "d = await Promise.all(["d"].map(function (v)))", - "ResultPath": "$.c", - "Type": "Pass", - }, "c = ["c"].map(function (v))": { "Next": "1__c = ["c"].map(function (v))", "Result": [ @@ -25116,7 +19679,7 @@ exports[`for map conditional 1`] = ` "Type": "Pass", }, "c.join("")": { - "ItemsPath": "$.c", + "ItemsPath": "$.heap8", "Iterator": { "StartAt": "Default 1", "States": { @@ -25160,12 +19723,6 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.heap26", "Type": "Map", }, - "c.join("") 1": { - "InputPath": "$.heap27.string", - "Next": "d.join("")", - "ResultPath": "$.heap29", - "Type": "Pass", - }, "check__1__b = ["b"].map(function (v))": { "Choices": [ { @@ -25199,12 +19756,6 @@ exports[`for map conditional 1`] = ` "Default": "end__1__d = await Promise.all(["d"].map(function (v)))", "Type": "Choice", }, - "d": { - "InputPath": "$.heap15", - "Next": "return b.join("")c.join("")d.join("")", - "ResultPath": "$.d", - "Type": "Pass", - }, "d = await Promise.all(["d"].map(function (v)))": { "Next": "1__d = await Promise.all(["d"].map(function (v)))", "Result": [ @@ -25214,7 +19765,7 @@ exports[`for map conditional 1`] = ` "Type": "Pass", }, "d.join("")": { - "ItemsPath": "$.d", + "ItemsPath": "$.heap15", "Iterator": { "StartAt": "Default 2", "States": { @@ -25258,12 +19809,6 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.heap30", "Type": "Map", }, - "d.join("") 1": { - "InputPath": "$.heap31.string", - "Next": "b.join("")c.join("")d.join("")", - "ResultPath": "$.heap33", - "Type": "Pass", - }, "end__1__b = ["b"].map(function (v))": { "Next": "set__end__1__b = ["b"].map(function (v))", "Parameters": { @@ -25380,7 +19925,7 @@ exports[`for map conditional 1`] = ` "Variable": "$.heap26[0]", }, ], - "Default": "c.join("") 1", + "Default": "d.join("")", "Type": "Choice", }, "hasNext__d.join("")": { @@ -25419,7 +19964,7 @@ exports[`for map conditional 1`] = ` "Variable": "$.heap30[0]", }, ], - "Default": "d.join("") 1", + "Default": "b.join("")c.join("")d.join("")", "Type": "Choice", }, "hasNext__for(i of [1, 2, 3])": { @@ -25491,7 +20036,7 @@ exports[`for map conditional 1`] = ` "Variable": "$.heap22[0]", }, ], - "Default": "b.join("")", + "Default": "c.join("")", "Type": "Choice", }, "i": { @@ -25500,36 +20045,18 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.i", "Type": "Pass", }, - "i 1": { - "InputPath": "$.i", - "Next": "vai", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "i 2": { "InputPath": "$.heap13[0]", "Next": "if(i === 3) 1", "ResultPath": "$.i__1", "Type": "Pass", }, - "i 3": { - "InputPath": "$.i__1", - "Next": "vai 1", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "i 4": { "InputPath": "$.heap21[0]", "Next": "if(i === 3) 2", "ResultPath": "$.i__2", "Type": "Pass", }, - "i 5": { - "InputPath": "$.i__2", - "Next": "vai 2", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "if(i === 3)": { "Choices": [ { @@ -25559,7 +20086,7 @@ exports[`for map conditional 1`] = ` ], }, ], - "Next": "return vai", + "Next": "vai", }, ], "Default": "tail__for(i of [1, 2, 3])", @@ -25594,7 +20121,7 @@ exports[`for map conditional 1`] = ` ], }, ], - "Next": "return vai 1", + "Next": "vai 1", }, ], "Default": "tail__for(i of input.arr)", @@ -25629,7 +20156,7 @@ exports[`for map conditional 1`] = ` ], }, ], - "Next": "return vai 2", + "Next": "vai 2", }, ], "Default": "tail__for(i of await arrFunc()) 1", @@ -25672,7 +20199,7 @@ exports[`for map conditional 1`] = ` "Type": "Pass", }, "return b.join("")c.join("")d.join("")": { - "ItemsPath": "$.b", + "ItemsPath": "$.heap1", "Iterator": { "StartAt": "Default", "States": { @@ -25716,57 +20243,39 @@ exports[`for map conditional 1`] = ` "ResultPath": "$.heap22", "Type": "Map", }, - "return vai": { - "InputPath": "$.v", - "Next": "a", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "return vai 1": { - "InputPath": "$.v__1", - "Next": "a 1", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "return vai 2": { - "InputPath": "$.v__2", - "Next": "a 2", - "ResultPath": "$.heap17", - "Type": "Pass", - }, "returnEmpty__c.join("")": { - "Next": "c.join("") 1", + "Next": "d.join("")", "Result": "", "ResultPath": "$.heap27.string", "Type": "Pass", }, "returnEmpty__d.join("")": { - "Next": "d.join("") 1", + "Next": "b.join("")c.join("")d.join("")", "Result": "", "ResultPath": "$.heap31.string", "Type": "Pass", }, "returnEmpty__return b.join("")c.join("")d.join("")": { - "Next": "b.join("")", + "Next": "c.join("")", "Result": "", "ResultPath": "$.heap23.string", "Type": "Pass", }, "set__end__1__b = ["b"].map(function (v))": { "InputPath": "$.heap1.result[1:]", - "Next": "b", + "Next": "c = ["c"].map(function (v))", "ResultPath": "$.heap1", "Type": "Pass", }, "set__end__1__c = ["c"].map(function (v))": { "InputPath": "$.heap8.result[1:]", - "Next": "c", + "Next": "d = await Promise.all(["d"].map(function (v)))", "ResultPath": "$.heap8", "Type": "Pass", }, "set__end__1__d = await Promise.all(["d"].map(function (v)))": { "InputPath": "$.heap15.result[1:]", - "Next": "d", + "Next": "return b.join("")c.join("")d.join("")", "ResultPath": "$.heap15", "Type": "Pass", }, @@ -25827,7 +20336,7 @@ exports[`for map conditional 1`] = ` "vai": { "Next": "1__return vai", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap2,$.heap3,$.heap4)", + "string.$": "States.Format('{}{}{}',$.v,$.a,$.i)", }, "ResultPath": "$.heap5", "Type": "Pass", @@ -25835,7 +20344,7 @@ exports[`for map conditional 1`] = ` "vai 1": { "Next": "1__return vai 1", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap9,$.heap10,$.heap11)", + "string.$": "States.Format('{}{}{}',$.v__1,$.a,$.i__1)", }, "ResultPath": "$.heap12", "Type": "Pass", @@ -25843,7 +20352,7 @@ exports[`for map conditional 1`] = ` "vai 2": { "Next": "1__return vai 2", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap17,$.heap18,$.heap19)", + "string.$": "States.Format('{}{}{}',$.v__2,$.a,$.i__2)", }, "ResultPath": "$.heap20", "Type": "Pass", @@ -25859,7 +20368,7 @@ exports[`for of 1`] = ` "--aj": { "Next": "a = --aj 1", "Parameters": { - "string.$": "States.Format('{}--{}',$.heap9,$.heap10)", + "string.$": "States.Format('{}--{}',$.a,$.j)", }, "ResultPath": "$.heap11", "Type": "Pass", @@ -25881,36 +20390,18 @@ exports[`for of 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = --aj": { - "InputPath": "$.a", - "Next": "j 2", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "a = --aj 1": { "InputPath": "$.heap11.string", "Next": "tail__for(i of input.arr) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = ai": { - "InputPath": "$.a", - "Next": "i 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = ai 1": { "InputPath": "$.heap2.string", "Next": "tail__for(i of input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "a = |iajij": { - "InputPath": "$.a", - "Next": "ji", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "a = |iajij 1": { "InputPath": "$.heap7.string", "Next": "tail__for(j of input.arr)", @@ -25920,7 +20411,7 @@ exports[`for of 1`] = ` "ai": { "Next": "a = ai 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}{}',$.a,$.heap3[0])", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -25947,7 +20438,7 @@ exports[`for of 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "ai", "Variable": "$.heap3[0]", }, ], @@ -25973,21 +20464,9 @@ exports[`for of 1`] = ` "Variable": "$.heap8[0]", }, ], - "Default": "a = --aj", + "Default": "--aj", "Type": "Choice", }, - "i": { - "InputPath": "$.heap3[0]", - "Next": "a = ai", - "ResultPath": "$.i", - "Type": "Pass", - }, - "i 1": { - "InputPath": "$.i", - "Next": "ai", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "i 2": { "InputPath": "$.heap12[0]", "Next": "j = 1", @@ -25996,20 +20475,8 @@ exports[`for of 1`] = ` }, "j": { "InputPath": "$.heap8[0]", - "Next": "a = |iajij", - "ResultPath": "$.j", - "Type": "Pass", - }, - "j 1": { - "InputPath": "$.j", "Next": "|iajij", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "j 2": { - "InputPath": "$.j", - "Next": "--aj", - "ResultPath": "$.heap10", + "ResultPath": "$.j", "Type": "Pass", }, "j = 1": { @@ -26018,12 +20485,6 @@ exports[`for of 1`] = ` "ResultPath": "$.j", "Type": "Pass", }, - "ji": { - "InputPath": "$.i__1", - "Next": "j 1", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "return a": { "End": true, "InputPath": "$.a", @@ -26051,7 +20512,7 @@ exports[`for of 1`] = ` "|iajij": { "Next": "a = |iajij 1", "Parameters": { - "string.$": "States.Format('{}|i{}j{}',$.heap4,$.heap5,$.heap6)", + "string.$": "States.Format('{}|i{}j{}',$.a,$.i__1,$.j)", }, "ResultPath": "$.heap7", "Type": "Pass", @@ -26081,12 +20542,6 @@ exports[`foreach 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = aax": { - "InputPath": "$.a", - "Next": "x 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "a = aax 1": { "InputPath": "$.heap3.string", "Next": "return a 1", @@ -26096,7 +20551,7 @@ exports[`foreach 1`] = ` "aax": { "Next": "a = aax 1", "Parameters": { - "string.$": "States.Format('{}a{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}a{}',$.a,$.heap0.arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -26105,7 +20560,7 @@ exports[`foreach 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x", + "Next": "aax", "Variable": "$.heap0.arr[0]", }, ], @@ -26144,18 +20599,6 @@ exports[`foreach 1`] = ` "ResultPath": "$.heap0.arr", "Type": "Pass", }, - "x": { - "InputPath": "$.heap0.arr[0]", - "Next": "a = aax", - "ResultPath": "$.x", - "Type": "Pass", - }, - "x 1": { - "InputPath": "$.x", - "Next": "aax", - "ResultPath": "$.heap2", - "Type": "Pass", - }, }, } `; @@ -26180,12 +20623,6 @@ exports[`intrinsics 1`] = ` "ResultPath": "$.heap25", "Type": "Pass", }, - "$SFN.hash("hide me", "SHA-1")": { - "Next": "1__$SFN.hash("hide me", "SHA-1")", - "Result": "hide me", - "ResultPath": "$.heap28", - "Type": "Pass", - }, "$SFN.range(input.range.start, input.range.end, input.range.step).map(functi": { "Next": "1__$SFN.range(input.range.start, input.range.end, input.range.step).map(fun 1", "Parameters": { @@ -26203,53 +20640,23 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "10__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "11__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "$SFN.base64Encode("test")", "Parameters": { "out.$": "States.ArrayUnique($.input.arr)", }, "ResultPath": "$.heap20", "Type": "Pass", }, - "11__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap20.out", - "Next": "$SFN.base64Encode("test")", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "13__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap23.out", - "Next": "$SFN.base64Encode(input.baseTest)", - "ResultPath": "$.heap24", - "Type": "Pass", - }, - "15__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap26.out", - "Next": "$SFN.hash("hide me", "SHA-1")", - "ResultPath": "$.heap27", - "Type": "Pass", - }, - "17__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap29.out", - "Next": "18__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap30", - "Type": "Pass", - }, "18__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "19__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "[1, 2, 3, 4].includes(2)", "Parameters": { "out.$": "States.Hash($.input.hashTest,$.input.hashAlgo)", }, "ResultPath": "$.heap31", "Type": "Pass", }, - "19__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap31.out", - "Next": "[1, 2, 3, 4].includes(2)", - "ResultPath": "$.heap32", - "Type": "Pass", - }, "1__$SFN.base64Encode("test")": { - "Next": "13__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "$SFN.base64Encode(input.baseTest)", "Parameters": { "out.$": "States.Base64Decode($.heap22.out)", }, @@ -26257,7 +20664,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "1__$SFN.base64Encode(input.baseTest)": { - "Next": "15__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "1__$SFN.hash("hide me", "SHA-1")", "Parameters": { "out.$": "States.Base64Decode($.heap25.out)", }, @@ -26265,9 +20672,9 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "1__$SFN.hash("hide me", "SHA-1")": { - "Next": "17__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "18__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { - "out.$": "States.Hash($.heap28,'SHA-1')", + "out.$": "States.Hash('hide me','SHA-1')", }, "ResultPath": "$.heap29", "Type": "Pass", @@ -26343,7 +20750,7 @@ exports[`intrinsics 1`] = ` "Type": "Choice", }, "1__["a", 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, "a", "b"]": { - "Next": "9__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", + "Next": "10__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "out.$": "States.ArrayUnique($.heap17)", }, @@ -26351,7 +20758,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "1__[1, 2, 3, 4].includes(2)": { - "Next": "21__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "22__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "out.$": "States.ArrayContains($.heap33,2)", }, @@ -26370,76 +20777,40 @@ exports[`intrinsics 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "1__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: 1": { - "InputPath": "$.heap3.out", - "Next": "2__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "1__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: 2": { - "Next": "1__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: 1", + "Next": "2__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", "Parameters": { "out.$": "States.ArrayPartition($.heap2,4)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "21__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap34.out", - "Next": "22__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap35", - "Type": "Pass", - }, "22__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "23__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "24__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "out.$": "States.ArrayContains($.input.arr,$.input.part)", }, "ResultPath": "$.heap36", "Type": "Pass", }, - "23__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap36.out", - "Next": "24__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap37", - "Type": "Pass", - }, "24__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "25__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.part", "Parameters": { "out.$": "States.ArrayContains($.input.arr,'a')", }, "ResultPath": "$.heap38", "Type": "Pass", }, - "25__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap38.out", - "Next": "input.part", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "27__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap40.out", - "Next": "28__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap41", - "Type": "Pass", - }, "28__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "29__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "30__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "out.$": "States.ArrayGetItem($.input.arr,0)", }, "ResultPath": "$.heap42", "Type": "Pass", }, - "29__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap42.out", - "Next": "30__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap43", - "Type": "Pass", - }, "2__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "Next": "3__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", + "Next": "4__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", "Parameters": { "out.$": "States.ArrayPartition($.input.arr,$.input.part)", }, @@ -26447,85 +20818,13 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "30__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "Next": "31__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.part in input.arr", "Parameters": { "out.$": "States.ArrayGetItem($.input.arr,$.input.part)", }, "ResultPath": "$.heap44", "Type": "Pass", }, - "31__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap44.out", - "Next": "32__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap45", - "Type": "Pass", - }, - "32__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.objAccess", - "Next": "33__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap46", - "Type": "Pass", - }, - "33__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.input.range", - "Next": "input.part in input.arr", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "35__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap48.out", - "Next": "input.large in input.arr", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "37__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap50.out", - "Next": "38__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap51", - "Type": "Pass", - }, - "38__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.objIn", - "Next": "input.arr", - "ResultPath": "$.heap52", - "Type": "Pass", - }, - "3__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "InputPath": "$.heap5.out", - "Next": "4__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "40__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap53.val", - "Next": "$SFN.unique(input.arr)", - "ResultPath": "$.heap54", - "Type": "Pass", - }, - "42__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap56.val", - "Next": "input.lengthObj", - "ResultPath": "$.heap57", - "Type": "Pass", - }, - "44__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap58.val", - "Next": "45__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap59", - "Type": "Pass", - }, - "45__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.input.lengthObj", - "Next": "input.emptyArr", - "ResultPath": "$.heap60", - "Type": "Pass", - }, - "47__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { - "InputPath": "$.heap61.val", - "Next": "48__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap62", - "Type": "Pass", - }, "48__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { "InputPath": "$.input.arr[1:3]", "Next": "input.arr.slice(input.part, input.end)", @@ -26533,7 +20832,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "4__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "Next": "5__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", + "Next": "$SFN.range(input.range.start, input.range.end, input.range.step).map(functi", "Parameters": { "out.$": "States.ArrayRange(4,30,5)", }, @@ -26549,24 +20848,24 @@ exports[`intrinsics 1`] = ` "52__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { "Next": "53__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { - "base64.$": "$.heap24", - "base64Ref.$": "$.heap27", + "base64.$": "$.heap23.out", + "base64Ref.$": "$.heap26.out", "get": 1, - "getFunc.$": "$.heap43", - "getFuncRef.$": "$.heap45", - "getRef.$": "$.heap41", - "hash.$": "$.heap30", - "hashRef.$": "$.heap32", - "includes.$": "$.heap35", - "includesRes.$": "$.heap37", - "notIncludesRes.$": "$.heap39", - "objAccess.$": "$.heap46", - "partition.$": "$.heap4", - "partitionRef.$": "$.heap6", - "range.$": "$.heap8", - "rangeRef.$": "$.heap16", - "unique.$": "$.heap19", - "uniqueRef.$": "$.heap21", + "getFunc.$": "$.heap42.out", + "getFuncRef.$": "$.heap44.out", + "getRef.$": "$.heap40.out", + "hash.$": "$.heap29.out", + "hashRef.$": "$.heap31.out", + "includes.$": "$.heap34.out", + "includesRes.$": "$.heap36.out", + "notIncludesRes.$": "$.heap38.out", + "objAccess.$": "$.objAccess", + "partition.$": "$.heap3.out", + "partitionRef.$": "$.heap5.out", + "range.$": "$.heap7.out", + "rangeRef.$": "$.heap14.string", + "unique.$": "$.heap18.out", + "uniqueRef.$": "$.heap20.out", }, "ResultPath": "$.heap67", "Type": "Pass", @@ -26575,12 +20874,12 @@ exports[`intrinsics 1`] = ` "Next": "54__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "getLength": 4, - "inRef.$": "$.heap49", - "inRefFalse.$": "$.heap51", - "lengthObj.$": "$.heap59", - "lengthRef.$": "$.heap54", - "objIn.$": "$.heap52", - "uniqueLength.$": "$.heap57", + "inRef.$": "$.heap48.out", + "inRefFalse.$": "$.heap50.out", + "lengthObj.$": "$.heap58.val", + "lengthRef.$": "$.heap53.val", + "objIn.$": "$.objIn", + "uniqueLength.$": "$.heap56.val", }, "ResultPath": "$.heap68", "Type": "Pass", @@ -26588,7 +20887,7 @@ exports[`intrinsics 1`] = ` "54__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { "Next": "55__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { - "emptyLength.$": "$.heap62", + "emptyLength.$": "$.heap61.val", "slice.$": "$.heap63", "sliceRef.$": "$.heap65", "sliceRefStart.$": "$.heap66.arr[1:]", @@ -26599,29 +20898,11 @@ exports[`intrinsics 1`] = ` "55__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:": { "Next": "1__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", "Parameters": { - "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap67,$.heap47,false),$.heap68,false),$.heap60,false),$.heap69,false)", + "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap67,$.input.range,false),$.heap68,false),$.input.lengthObj,false),$.heap69,false)", }, "ResultPath": "$.heap70", "Type": "Pass", }, - "5__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "InputPath": "$.heap7.out", - "Next": "$SFN.range(input.range.start, input.range.end, input.range.step).map(functi", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "7__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "InputPath": "$.heap14.string", - "Next": "["a", 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, "a", "b"]", - "ResultPath": "$.heap16", - "Type": "Pass", - }, - "9__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ": { - "InputPath": "$.heap18.out", - "Next": "10__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "objAccess = input.range[input.key]", "Parameters": { @@ -26673,7 +20954,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "array__1__$SFN.unique(input.arr)": { - "Next": "42__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.lengthObj", "Parameters": { "val.$": "States.ArrayLength($.heap55.out)", }, @@ -26681,7 +20962,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "array__input.arr": { - "Next": "40__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "$SFN.unique(input.arr)", "Parameters": { "val.$": "States.ArrayLength($.input.arr)", }, @@ -26689,7 +20970,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "array__input.emptyArr": { - "Next": "47__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "48__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "val.$": "States.ArrayLength($.input.emptyArr)", }, @@ -26705,7 +20986,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "array__input.lengthObj": { - "Next": "44__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.emptyArr", "Parameters": { "val.$": "States.ArrayLength($.input.lengthObj)", }, @@ -26713,7 +20994,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "array__input.part": { - "Next": "27__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "28__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "Parameters": { "out.$": "States.ArrayGetItem($.input.arr,$.input.part)", }, @@ -26762,18 +21043,6 @@ exports[`intrinsics 1`] = ` "ResultPath": "$.heap64", "Type": "Pass", }, - "catch__objAccess = input.range[input.key]": { - "InputPath": "$.fnl_tmp_0", - "Next": "objAccess = err.cause", - "ResultPath": "$.err", - "Type": "Pass", - }, - "catch__try": { - "InputPath": "$.fnl_tmp_1", - "Next": "objIn = err.cause", - "ResultPath": "$.err__1", - "Type": "Pass", - }, "checkRange__input.arr.slice(input.end)": { "Choices": [ { @@ -26971,7 +21240,7 @@ exports[`intrinsics 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "n", + "Next": "nn", "Variable": "$.heap10.arr[0]", }, ], @@ -27044,13 +21313,13 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "false__check__array__input.large in input.arr": { - "Next": "37__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.arr", "Result": false, "ResultPath": "$.heap50.out", "Type": "Pass", }, "false__check__array__input.part in input.arr": { - "Next": "35__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.large in input.arr", "Result": false, "ResultPath": "$.heap48.out", "Type": "Pass", @@ -27122,7 +21391,7 @@ exports[`intrinsics 1`] = ` "Variable": "$.heap13[0]", }, ], - "Default": "7__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", + "Default": "["a", 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, "a", "b"]", "Type": "Choice", }, "initValue__1__$SFN.range(input.range.start, input.range.end, input.range.st": { @@ -27230,22 +21499,16 @@ exports[`intrinsics 1`] = ` "Default": "stringify__input.part in input.arr", "Type": "Choice", }, - "n": { - "InputPath": "$.heap10.arr[0]", - "Next": "return nn", - "ResultPath": "$.n", - "Type": "Pass", - }, "nn": { "Next": "1__return nn", "Parameters": { - "string.$": "States.Format('n{}',$.heap11)", + "string.$": "States.Format('n{}',$.heap10.arr[0])", }, "ResultPath": "$.heap12", "Type": "Pass", }, "objAccess = err.cause": { - "InputPath": "$.err.cause", + "InputPath": "$.fnl_tmp_0.cause", "Next": "try", "ResultPath": "$.objAccess", "Type": "Pass", @@ -27268,7 +21531,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "objIn = err.cause": { - "InputPath": "$.err__1.cause", + "InputPath": "$.fnl_tmp_1.cause", "Next": "return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: $SF", "ResultPath": "$.objIn", "Type": "Pass", @@ -27281,19 +21544,19 @@ exports[`intrinsics 1`] = ` }, "object__1__$SFN.unique(input.arr)": { "InputPath": "$.heap55.out.length", - "Next": "42__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.lengthObj", "ResultPath": "$.heap56.val", "Type": "Pass", }, "object__input.arr": { "InputPath": "$.input.arr.length", - "Next": "40__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "$SFN.unique(input.arr)", "ResultPath": "$.heap53.val", "Type": "Pass", }, "object__input.emptyArr": { "InputPath": "$.input.emptyArr.length", - "Next": "47__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "48__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", "ResultPath": "$.heap61.val", "Type": "Pass", }, @@ -27304,7 +21567,7 @@ exports[`intrinsics 1`] = ` }, "object__input.lengthObj": { "InputPath": "$.input.lengthObj.length", - "Next": "44__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.emptyArr", "ResultPath": "$.heap58.val", "Type": "Pass", }, @@ -27319,7 +21582,7 @@ exports[`intrinsics 1`] = ` "Type": "Fail", }, "object__objAccess = input.range[input.key]": { - "Next": "catch__objAccess = input.range[input.key]", + "Next": "objAccess = err.cause", "Parameters": { "cause": "Reference element access is not valid for objects.", "error": "Functionless.InvalidAccess", @@ -27328,7 +21591,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "object__try": { - "Next": "catch__try", + "Next": "objIn = err.cause", "Parameters": { "cause": "Reference element access is not valid for objects.", "error": "Functionless.InvalidAccess", @@ -27336,12 +21599,6 @@ exports[`intrinsics 1`] = ` "ResultPath": "$.fnl_tmp_1", "Type": "Pass", }, - "return nn": { - "InputPath": "$.n", - "Next": "nn", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: $SF": { "Next": "1__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: 2", "Result": [ @@ -27356,7 +21613,7 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "returnEmpty__1__$SFN.range(input.range.start, input.range.end, input.range.": { - "Next": "7__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef: ", + "Next": "["a", 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, "a", "b"]", "Result": "", "ResultPath": "$.heap14.string", "Type": "Pass", @@ -27446,13 +21703,13 @@ exports[`intrinsics 1`] = ` "Type": "Pass", }, "true__check__array__input.large in input.arr": { - "Next": "37__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.arr", "Result": true, "ResultPath": "$.heap50.out", "Type": "Pass", }, "true__check__array__input.part in input.arr": { - "Next": "35__return {partition: $SFN.partition([1, 2, 3, 4, 5, 6], 4), partitionRef:", + "Next": "input.large in input.arr", "Result": true, "ResultPath": "$.heap48.out", "Type": "Pass", @@ -27528,7 +21785,7 @@ exports[`join 1`] = ` "Type": "Map", }, "1__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=") 1": { - "Next": "2__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", + "Next": "["a", {a: "a"}, ["b"], input.obj, input.arr, null]", "Result": [ "b", ], @@ -27580,60 +21837,12 @@ exports[`join 1`] = ` "ResultPath": "$.heap9", "Type": "Map", }, - "1__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j": { - "InputPath": "$.heap1.string", - "Next": "input.arr.join(input.sep)", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "1__return resultArr.join("#")": { "End": true, "InputPath": "$.heap29.string", "ResultPath": "$", "Type": "Pass", }, - "2__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")": { - "InputPath": "$.input.obj", - "Next": "3__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", - "ResultPath": "$.heap19", - "Type": "Pass", - }, - "3__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")": { - "InputPath": "$.input.arr", - "Next": "4__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", - "ResultPath": "$.heap20", - "Type": "Pass", - }, - "3__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j": { - "InputPath": "$.heap5.string", - "Next": "["d", "e", "f"].join(input.sep)", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "4__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")": { - "InputPath": "$.fnl_context.null", - "Next": "["a", {a: "a"}, ["b"], input.obj, input.arr, null]", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "5__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j": { - "InputPath": "$.heap10.string", - "Next": "input.arr.join()", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "7__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j": { - "InputPath": "$.heap14.string", - "Next": "["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", - "ResultPath": "$.heap16", - "Type": "Pass", - }, - "9__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j": { - "InputPath": "$.heap24.string", - "Next": "[["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join(input.sep),", - "ResultPath": "$.heap26", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join", "Parameters": { @@ -27648,7 +21857,7 @@ exports[`join 1`] = ` "["a", {a: "a"}, ["b"], input.obj, input.arr, null]": { "Next": "1__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", "Parameters": { - "out.$": "States.Array('a',$.heap17,$.heap18,$.heap19,$.heap20,$.heap21)", + "out.$": "States.Array('a',$.heap17,$.heap18,$.input.obj,$.input.arr,$.fnl_context.null)", }, "ResultPath": "$.heap22", "Type": "Pass", @@ -27672,9 +21881,9 @@ exports[`join 1`] = ` "Type": "Pass", }, "[["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join(input.sep),": { - "Next": "resultArr", + "Next": "return resultArr.join("#")", "Parameters": { - "out.$": "States.Array('a/b/c',$.heap3,$.heap7,$.heap12,'',$.heap16,$.heap26)", + "out.$": "States.Array('a/b/c',$.heap1.string,$.heap5.string,$.heap10.string,'',$.heap14.string,$.heap24.string)", }, "ResultPath": "$.heap27", "Type": "Pass", @@ -27763,7 +21972,7 @@ exports[`join 1`] = ` "Variable": "$.heap23[0]", }, ], - "Default": "9__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Default": "[["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join(input.sep),", "Type": "Choice", }, "hasNext__1__["d", "e", "f"].join(input.sep)": { @@ -27802,7 +22011,7 @@ exports[`join 1`] = ` "Variable": "$.heap9[0]", }, ], - "Default": "5__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Default": "input.arr.join()", "Type": "Choice", }, "hasNext__input.arr.join()": { @@ -27841,7 +22050,7 @@ exports[`join 1`] = ` "Variable": "$.heap13[0]", }, ], - "Default": "7__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Default": "["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", "Type": "Choice", }, "hasNext__input.arr.join(input.sep)": { @@ -27880,7 +22089,7 @@ exports[`join 1`] = ` "Variable": "$.heap4[0]", }, ], - "Default": "3__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Default": "["d", "e", "f"].join(input.sep)", "Type": "Choice", }, "hasNext__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input": { @@ -27919,7 +22128,7 @@ exports[`join 1`] = ` "Variable": "$.heap0[0]", }, ], - "Default": "1__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Default": "input.arr.join(input.sep)", "Type": "Choice", }, "hasNext__return resultArr.join("#")": { @@ -28087,12 +22296,6 @@ exports[`join 1`] = ` "ResultPath": "$.heap4", "Type": "Map", }, - "resultArr": { - "InputPath": "$.heap27.out", - "Next": "return resultArr.join("#")", - "ResultPath": "$.resultArr", - "Type": "Pass", - }, "resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join": { "ItemsPath": "$.input.arr", "Iterator": { @@ -28139,7 +22342,7 @@ exports[`join 1`] = ` "Type": "Map", }, "return resultArr.join("#")": { - "ItemsPath": "$.resultArr", + "ItemsPath": "$.heap27.out", "Iterator": { "StartAt": "Default 5", "States": { @@ -28184,31 +22387,31 @@ exports[`join 1`] = ` "Type": "Map", }, "returnEmpty__1__["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("="": { - "Next": "9__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Next": "[["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.join(input.sep),", "Result": "", "ResultPath": "$.heap24.string", "Type": "Pass", }, "returnEmpty__1__["d", "e", "f"].join(input.sep)": { - "Next": "5__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Next": "input.arr.join()", "Result": "", "ResultPath": "$.heap10.string", "Type": "Pass", }, "returnEmpty__input.arr.join()": { - "Next": "7__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Next": "["a", {a: "a"}, ["b"], input.obj, input.arr, null].join("=")", "Result": "", "ResultPath": "$.heap14.string", "Type": "Pass", }, "returnEmpty__input.arr.join(input.sep)": { - "Next": "3__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Next": "["d", "e", "f"].join(input.sep)", "Result": "", "ResultPath": "$.heap5.string", "Type": "Pass", }, "returnEmpty__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), i": { - "Next": "1__resultArr = [["a", "b", "c"].join("/"), input.arr.join("-"), input.arr.j", + "Next": "input.arr.join(input.sep)", "Result": "", "ResultPath": "$.heap1.string", "Type": "Pass", @@ -28267,8 +22470,8 @@ exports[`json parse and stringify 1`] = ` "End": true, "Parameters": { "a.$": "$.obj.a", - "obj.$": "$.heap3", - "str.$": "$.heap2", + "obj.$": "$.obj", + "str.$": "$.str", }, "ResultPath": "$", "Type": "Pass", @@ -28370,24 +22573,12 @@ exports[`map 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a": { - "InputPath": "$.a", - "Next": "l[0]l[1]l[2]l2[0]l2[1]l2[2]a", - "ResultPath": "$.heap20", - "Type": "Pass", - }, "a = """: { "Next": "l = await $SFN.retry(function ()).map(function (x))", "Result": "", "ResultPath": "$.a", "Type": "Pass", }, - "a = aax": { - "InputPath": "$.a", - "Next": "x 3", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "a = aax 1": { "InputPath": "$.heap13.string", "Next": "return a", @@ -28397,7 +22588,7 @@ exports[`map 1`] = ` "aax": { "Next": "a = aax 1", "Parameters": { - "string.$": "States.Format('{}a{}',$.heap11,$.heap12)", + "string.$": "States.Format('{}a{}',$.a,$.heap10.arr[0])", }, "ResultPath": "$.heap13", "Type": "Pass", @@ -28406,7 +22597,7 @@ exports[`map 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x", + "Next": "nx", "Variable": "$.heap2.arr[0]", }, ], @@ -28417,7 +22608,7 @@ exports[`map 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x 2", + "Next": "aax", "Variable": "$.heap10.arr[0]", }, ], @@ -28428,7 +22619,7 @@ exports[`map 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "function (x,i,[ head ])", + "Next": "nixhead", "Variable": "$.heap5.arr[0]", }, ], @@ -28459,12 +22650,6 @@ exports[`map 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "function (x,i,[ head ])": { - "InputPath": "$.heap5.arr[0].item", - "Next": "i", - "ResultPath": "$.x__1", - "Type": "Pass", - }, "handleResult__1__l = await $SFN.retry(function ()).map(function (x))": { "Next": "check__1__l = await $SFN.retry(function ()).map(function (x))", "Parameters": { @@ -28492,24 +22677,6 @@ exports[`map 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "head": { - "InputPath": "$.input.arr[0]", - "Next": "return nixhead", - "ResultPath": "$.head", - "Type": "Pass", - }, - "head 1": { - "InputPath": "$.head", - "Next": "nixhead", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "i": { - "InputPath": "$.heap5.arr[0].index", - "Next": "head", - "ResultPath": "$.i", - "Type": "Pass", - }, "input.arr.map(function (x))": { "Next": "check__input.arr.map(function (x))", "Parameters": { @@ -28592,48 +22759,18 @@ exports[`map 1`] = ` }, "Type": "Map", }, - "l2[0]": { - "InputPath": "$.l2[0]", - "Next": "l2[1]", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "l2[1]": { - "InputPath": "$.l2[1]", - "Next": "l2[2]", - "ResultPath": "$.heap18", - "Type": "Pass", - }, - "l2[2]": { - "InputPath": "$.l2[2]", - "Next": "a", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "l[0]l[1]l[2]l2[0]l2[1]l2[2]a": { "Next": "1__return l[0]l[1]l[2]l2[0]l2[1]l2[2]a", "Parameters": { - "string.$": "States.Format('{}{}{}{}{}{}{}',$.heap14,$.heap15,$.heap16,$.heap17,$.heap18,$.heap19,$.heap20)", + "string.$": "States.Format('{}{}{}{}{}{}{}',$.l[0],$.l[1],$.l[2],$.l2[0],$.l2[1],$.l2[2],$.a)", }, "ResultPath": "$.heap21", "Type": "Pass", }, - "l[1]": { - "InputPath": "$.l[1]", - "Next": "l[2]", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "l[2]": { - "InputPath": "$.l[2]", - "Next": "l2[0]", - "ResultPath": "$.heap16", - "Type": "Pass", - }, "nixhead": { "Next": "1__return nixhead", "Parameters": { - "string.$": "States.Format('n{}{}{}',$.heap6,$.heap7,$.heap8)", + "string.$": "States.Format('n{}{}{}',$.heap5.arr[0].index,$.heap5.arr[0].item,$.input.arr[0])", }, "ResultPath": "$.heap9", "Type": "Pass", @@ -28641,7 +22778,7 @@ exports[`map 1`] = ` "nx": { "Next": "1__return nx", "Parameters": { - "string.$": "States.Format('n{}',$.heap3)", + "string.$": "States.Format('n{}',$.heap2.arr[0])", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -28652,24 +22789,6 @@ exports[`map 1`] = ` "ResultPath": "$.heap10.arr[0]", "Type": "Pass", }, - "return l[0]l[1]l[2]l2[0]l2[1]l2[2]a": { - "InputPath": "$.l[0]", - "Next": "l[1]", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "return nixhead": { - "InputPath": "$.i", - "Next": "x 1", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "return nx": { - "InputPath": "$.x", - "Next": "nx", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "set__end__1__l = await $SFN.retry(function ()).map(function (x))": { "InputPath": "$.heap2.result[1:]", "Next": "l", @@ -28678,7 +22797,7 @@ exports[`map 1`] = ` }, "set__end__input.arr.map(function (x))": { "InputPath": "$.heap10.result[1:]", - "Next": "return l[0]l[1]l[2]l2[0]l2[1]l2[2]a", + "Next": "l[0]l[1]l[2]l2[0]l2[1]l2[2]a", "ResultPath": "$.heap10", "Type": "Pass", }, @@ -28688,30 +22807,6 @@ exports[`map 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "x": { - "InputPath": "$.heap2.arr[0]", - "Next": "return nx", - "ResultPath": "$.x", - "Type": "Pass", - }, - "x 1": { - "InputPath": "$.x__1", - "Next": "head 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "x 2": { - "InputPath": "$.heap10.arr[0]", - "Next": "a = aax", - "ResultPath": "$.x__2", - "Type": "Pass", - }, - "x 3": { - "InputPath": "$.x__2", - "Next": "aax", - "ResultPath": "$.heap12", - "Type": "Pass", - }, }, } `; @@ -28762,7 +22857,7 @@ exports[`map uses input 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x", + "Next": "input.prefixx", "Variable": "$.heap1.arr[0]", }, ], @@ -28773,7 +22868,7 @@ exports[`map uses input 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x 2", + "Next": "input.prefixx 1", "Variable": "$.heap5.arr[0]", }, ], @@ -28817,7 +22912,7 @@ exports[`map uses input 1`] = ` "input.prefixx": { "Next": "1__return input.prefixx", "Parameters": { - "string.$": "States.Format('{}{}',$.heap2,$.heap3)", + "string.$": "States.Format('{}{}',$.input.prefix,$.heap1.arr[0])", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -28825,7 +22920,7 @@ exports[`map uses input 1`] = ` "input.prefixx 1": { "Next": "1__return input.prefixx 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap6,$.heap7)", + "string.$": "States.Format('{}{}',$.input.prefix,$.heap5.arr[0])", }, "ResultPath": "$.heap8", "Type": "Pass", @@ -28845,7 +22940,7 @@ exports[`map uses input 1`] = ` }, "l2": { "InputPath": "$.heap5", - "Next": "return l[0]l[1]l[2]l2[0]l2[1]l2[2]", + "Next": "l[0]l[1]l[2]l2[0]l2[1]l2[2]", "ResultPath": "$.l2", "Type": "Pass", }, @@ -28858,62 +22953,14 @@ exports[`map uses input 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "l2[0]": { - "InputPath": "$.l2[0]", - "Next": "l2[1]", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "l2[1]": { - "InputPath": "$.l2[1]", - "Next": "l2[2]", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "l2[2]": { - "InputPath": "$.l2[2]", - "Next": "l[0]l[1]l[2]l2[0]l2[1]l2[2]", - "ResultPath": "$.heap14", - "Type": "Pass", - }, "l[0]l[1]l[2]l2[0]l2[1]l2[2]": { "Next": "1__return l[0]l[1]l[2]l2[0]l2[1]l2[2]", "Parameters": { - "string.$": "States.Format('{}{}{}{}{}{}',$.heap9,$.heap10,$.heap11,$.heap12,$.heap13,$.heap14)", + "string.$": "States.Format('{}{}{}{}{}{}',$.l[0],$.l[1],$.l[2],$.l2[0],$.l2[1],$.l2[2])", }, "ResultPath": "$.heap15", "Type": "Pass", }, - "l[1]": { - "InputPath": "$.l[1]", - "Next": "l[2]", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "l[2]": { - "InputPath": "$.l[2]", - "Next": "l2[0]", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "return input.prefixx": { - "InputPath": "$.input.prefix", - "Next": "x 1", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "return input.prefixx 1": { - "InputPath": "$.input.prefix", - "Next": "x 3", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "return l[0]l[1]l[2]l2[0]l2[1]l2[2]": { - "InputPath": "$.l[0]", - "Next": "l[1]", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "set__end__1__l = await arrFunc().map(function (x))": { "InputPath": "$.heap1.result[1:]", "Next": "l", @@ -28926,30 +22973,6 @@ exports[`map uses input 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "x": { - "InputPath": "$.heap1.arr[0]", - "Next": "return input.prefixx", - "ResultPath": "$.x", - "Type": "Pass", - }, - "x 1": { - "InputPath": "$.x", - "Next": "input.prefixx", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "x 2": { - "InputPath": "$.heap5.arr[0]", - "Next": "return input.prefixx 1", - "ResultPath": "$.x__1", - "Type": "Pass", - }, - "x 3": { - "InputPath": "$.x__1", - "Next": "input.prefixx 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, }, } `; @@ -28996,24 +23019,12 @@ exports[`map with dynamic for loops 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = ax": { - "InputPath": "$.a", - "Next": "x 3", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "a = ax 1": { "InputPath": "$.heap9.string", "Next": "tail__for(x of l)", "ResultPath": "$.a", "Type": "Pass", }, - "a = ax 2": { - "InputPath": "$.a", - "Next": "x 5", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "a = ax 3": { "InputPath": "$.heap13.string", "Next": "tail__for(x of l2)", @@ -29023,7 +23034,7 @@ exports[`map with dynamic for loops 1`] = ` "ax": { "Next": "a = ax 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap7,$.heap8)", + "string.$": "States.Format('{}{}',$.a,$.heap10[0])", }, "ResultPath": "$.heap9", "Type": "Pass", @@ -29031,7 +23042,7 @@ exports[`map with dynamic for loops 1`] = ` "ax 1": { "Next": "a = ax 3", "Parameters": { - "string.$": "States.Format('{}{}',$.heap11,$.heap12)", + "string.$": "States.Format('{}{}',$.a,$.heap14[0])", }, "ResultPath": "$.heap13", "Type": "Pass", @@ -29040,7 +23051,7 @@ exports[`map with dynamic for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x", + "Next": "nx", "Variable": "$.heap1.arr[0]", }, ], @@ -29051,7 +23062,7 @@ exports[`map with dynamic for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x 1", + "Next": "nx 1", "Variable": "$.heap4.arr[0]", }, ], @@ -29075,13 +23086,13 @@ exports[`map with dynamic for loops 1`] = ` "Type": "Pass", }, "for(x of l)": { - "InputPath": "$.l", + "InputPath": "$.heap1", "Next": "hasNext__for(x of l)", "ResultPath": "$.heap10", "Type": "Pass", }, "for(x of l2)": { - "InputPath": "$.l2", + "InputPath": "$.heap4", "Next": "hasNext__for(x of l2)", "ResultPath": "$.heap14", "Type": "Pass", @@ -29108,7 +23119,7 @@ exports[`map with dynamic for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x 2", + "Next": "ax", "Variable": "$.heap10[0]", }, ], @@ -29119,19 +23130,13 @@ exports[`map with dynamic for loops 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "x 4", + "Next": "ax 1", "Variable": "$.heap14[0]", }, ], "Default": "return a", "Type": "Choice", }, - "l": { - "InputPath": "$.heap1", - "Next": "l2 = input.arr.map(function (x))", - "ResultPath": "$.l", - "Type": "Pass", - }, "l = await arrFunc().map(function (x))": { "InputPath": "$.fnl_context.null", "Next": "1__l = await arrFunc().map(function (x))", @@ -29139,12 +23144,6 @@ exports[`map with dynamic for loops 1`] = ` "ResultPath": "$.heap0", "Type": "Task", }, - "l2": { - "InputPath": "$.heap4", - "Next": "a = """, - "ResultPath": "$.l2", - "Type": "Pass", - }, "l2 = input.arr.map(function (x))": { "Next": "check__l2 = input.arr.map(function (x))", "Parameters": { @@ -29157,7 +23156,7 @@ exports[`map with dynamic for loops 1`] = ` "nx": { "Next": "1__return nx", "Parameters": { - "string.$": "States.Format('n{}',$.heap2)", + "string.$": "States.Format('n{}',$.heap1.arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -29165,7 +23164,7 @@ exports[`map with dynamic for loops 1`] = ` "nx 1": { "Next": "1__return nx 1", "Parameters": { - "string.$": "States.Format('n{}',$.heap5)", + "string.$": "States.Format('n{}',$.heap4.arr[0])", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -29176,27 +23175,15 @@ exports[`map with dynamic for loops 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return nx": { - "InputPath": "$.x", - "Next": "nx", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "return nx 1": { - "InputPath": "$.x__1", - "Next": "nx 1", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "set__end__1__l = await arrFunc().map(function (x))": { "InputPath": "$.heap1.result[1:]", - "Next": "l", + "Next": "l2 = input.arr.map(function (x))", "ResultPath": "$.heap1", "Type": "Pass", }, "set__end__l2 = input.arr.map(function (x))": { "InputPath": "$.heap4.result[1:]", - "Next": "l2", + "Next": "a = """, "ResultPath": "$.heap4", "Type": "Pass", }, @@ -29212,42 +23199,6 @@ exports[`map with dynamic for loops 1`] = ` "ResultPath": "$.heap14", "Type": "Pass", }, - "x": { - "InputPath": "$.heap1.arr[0]", - "Next": "return nx", - "ResultPath": "$.x", - "Type": "Pass", - }, - "x 1": { - "InputPath": "$.heap4.arr[0]", - "Next": "return nx 1", - "ResultPath": "$.x__1", - "Type": "Pass", - }, - "x 2": { - "InputPath": "$.heap10[0]", - "Next": "a = ax", - "ResultPath": "$.x__2", - "Type": "Pass", - }, - "x 3": { - "InputPath": "$.x__2", - "Next": "ax", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "x 4": { - "InputPath": "$.heap14[0]", - "Next": "a = ax 2", - "ResultPath": "$.x__3", - "Type": "Pass", - }, - "x 5": { - "InputPath": "$.x__3", - "Next": "ax 1", - "ResultPath": "$.heap12", - "Type": "Pass", - }, }, } `; @@ -29347,36 +23298,6 @@ exports[`math 1`] = ` "Default": "null__false__1 + input.str", "Type": "Choice", }, - "10__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.b", - "Next": "input.p + input.p", - "ResultPath": "$.heap19", - "Type": "Pass", - }, - "12__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap22", - "Next": "input.p + input.n", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "14__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap26", - "Next": "input.p + input.z", - "ResultPath": "$.heap27", - "Type": "Pass", - }, - "16__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap30", - "Next": "input.p + 1", - "ResultPath": "$.heap31", - "Type": "Pass", - }, - "18__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap34", - "Next": "input.p + -1", - "ResultPath": "$.heap35", - "Type": "Pass", - }, "1__29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { "Choices": [ { @@ -29597,7 +23518,7 @@ exports[`math 1`] = ` "Type": "Choice", }, "1__35__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "36__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "37__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "Parameters": { "out.$": "States.MathAdd($.heap71.num,-1)", }, @@ -29605,7 +23526,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "1__37__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "38__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "a++", "Parameters": { "out.$": "States.MathAdd($.heap74.num,1)", }, @@ -29614,18 +23535,18 @@ exports[`math 1`] = ` }, "1__41__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { "InputPath": "$.heap80.out", - "Next": "42__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "a--", "ResultPath": "$.a", "Type": "Pass", }, "1__45__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { "InputPath": "$.heap85.out", - "Next": "46__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p", "ResultPath": "$.a", "Type": "Pass", }, "1__55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "56__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + true", "Parameters": { "str.$": "States.Format('{}{}',$.heap100.str.left.str,'b')", }, @@ -29633,7 +23554,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "1__61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "62__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "true + input.str", "Parameters": { "str.$": "States.Format('{}{}','b',$.heap110.str.right.str)", }, @@ -29658,13 +23579,13 @@ exports[`math 1`] = ` }, "1__b += input.p": { "InputPath": "$.heap6", - "Next": "3__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual", + "Next": "b -= 1", "ResultPath": "$.b", "Type": "Pass", }, "1__b -= -1": { "InputPath": "$.heap17.out", - "Next": "9__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual", + "Next": "input.p + input.p", "ResultPath": "$.b", "Type": "Pass", }, @@ -29678,7 +23599,7 @@ exports[`math 1`] = ` }, "1__b -= 1": { "InputPath": "$.heap9.out", - "Next": "5__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual", + "Next": "b -= input.p", "ResultPath": "$.b", "Type": "Pass", }, @@ -29692,7 +23613,7 @@ exports[`math 1`] = ` }, "1__b -= input.p": { "InputPath": "$.heap14.out", - "Next": "7__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual", + "Next": "b -= -1", "ResultPath": "$.b", "Type": "Pass", }, @@ -29771,7 +23692,7 @@ exports[`math 1`] = ` }, "1__false__1 + input.str": { "InputPath": "$.heap107.str", - "Next": "60__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap108", "Type": "Pass", }, @@ -29864,7 +23785,7 @@ exports[`math 1`] = ` }, "1__false__input.b + input.b": { "InputPath": "$.heap53.str", - "Next": "28__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap54", "Type": "Pass", }, @@ -29943,7 +23864,7 @@ exports[`math 1`] = ` }, "1__false__input.b + true": { "InputPath": "$.heap49.str", - "Next": "26__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.b + input.b", "ResultPath": "$.heap50", "Type": "Pass", }, @@ -29957,7 +23878,7 @@ exports[`math 1`] = ` }, "1__false__input.p + -0": { "InputPath": "$.heap41.str", - "Next": "22__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + true", "ResultPath": "$.heap42", "Type": "Pass", }, @@ -29971,7 +23892,7 @@ exports[`math 1`] = ` }, "1__false__input.p + -1": { "InputPath": "$.heap37.str", - "Next": "20__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + -0", "ResultPath": "$.heap38", "Type": "Pass", }, @@ -29985,7 +23906,7 @@ exports[`math 1`] = ` }, "1__false__input.p + 1": { "InputPath": "$.heap33.str", - "Next": "18__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + -1", "ResultPath": "$.heap34", "Type": "Pass", }, @@ -29999,7 +23920,7 @@ exports[`math 1`] = ` }, "1__false__input.p + input.n": { "InputPath": "$.heap25.str", - "Next": "14__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + input.z", "ResultPath": "$.heap26", "Type": "Pass", }, @@ -30078,7 +23999,7 @@ exports[`math 1`] = ` }, "1__false__input.p + input.p": { "InputPath": "$.heap21.str", - "Next": "12__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + input.n", "ResultPath": "$.heap22", "Type": "Pass", }, @@ -30157,7 +24078,7 @@ exports[`math 1`] = ` }, "1__false__input.p + input.z": { "InputPath": "$.heap29.str", - "Next": "16__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + 1", "ResultPath": "$.heap30", "Type": "Pass", }, @@ -30236,7 +24157,7 @@ exports[`math 1`] = ` }, "1__false__input.p + true": { "InputPath": "$.heap45.str", - "Next": "24__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.b + true", "ResultPath": "$.heap46", "Type": "Pass", }, @@ -30250,7 +24171,7 @@ exports[`math 1`] = ` }, "1__false__input.str + 1": { "InputPath": "$.heap97.str", - "Next": "54__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap98", "Type": "Pass", }, @@ -30343,7 +24264,7 @@ exports[`math 1`] = ` }, "1__false__input.str + true": { "InputPath": "$.heap103.str", - "Next": "58__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "1 + input.str", "ResultPath": "$.heap104", "Type": "Pass", }, @@ -30371,7 +24292,7 @@ exports[`math 1`] = ` }, "1__false__true + input.str": { "InputPath": "$.heap113.str", - "Next": "64__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + input.str", "ResultPath": "$.heap114", "Type": "Pass", }, @@ -30432,7 +24353,7 @@ exports[`math 1`] = ` "Type": "Choice", }, "1__negative__1__input.n": { - "Next": "50__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.z", "Parameters": { "num.$": "States.StringToJson(States.ArrayGetItem($.heap91.num,0))", }, @@ -30440,7 +24361,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "1__negative__1__input.p": { - "Next": "48__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.n", "Parameters": { "num.$": "States.StringToJson(States.ArrayGetItem($.heap88.num,0))", }, @@ -30448,7 +24369,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "1__negative__1__input.z": { - "Next": "52__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + 1", "Parameters": { "num.$": "States.StringToJson(States.ArrayGetItem($.heap94.num,0))", }, @@ -30490,63 +24411,57 @@ exports[`math 1`] = ` "1__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual": { "End": true, "Parameters": { - "b.$": "$.heap19", - "booleanConstPlusRefString.$": "$.heap115", + "b.$": "$.b", + "booleanConstPlusRefString.$": "$.heap114", "constBooleanPlusBooleanConst": 2, "constStringPlusBooleanConst": "atrue", "constStringPlusNumberConst": "a1", "constStringPlusStringConst": "ab", - "minusEqualsConst.$": "$.heap10", - "minusEqualsNegConst.$": "$.heap18", - "minusEqualsRef.$": "$.heap15", - "negateNegRef.$": "$.heap92", - "negateRef.$": "$.heap89", - "negateZeroRef.$": "$.heap95", - "numberConstPlusRefString.$": "$.heap109", - "plusEqualsConst.$": "$.heap3", - "plusEqualsRef.$": "$.heap7", - "postMinusMinus.$": "$.heap84", - "postPlusPlus.$": "$.heap79", - "preMinusMinus.$": "$.heap86", - "prePlusPlus.$": "$.heap81", - "refBooleanPlusBooleanConst.$": "$.heap51", - "refBooleanPlusBooleanRef.$": "$.heap55", - "refMinusConst.$": "$.heap73", - "refMinusNegConst.$": "$.heap76", - "refMinusNegRef.$": "$.heap65", - "refMinusRef.$": "$.heap60", - "refMinusZeroRef.$": "$.heap70", - "refPlusBooleanConst.$": "$.heap47", - "refPlusConst.$": "$.heap35", - "refPlusNegConst.$": "$.heap39", - "refPlusNegRef.$": "$.heap27", - "refPlusRef.$": "$.heap23", - "refPlusZeroConst.$": "$.heap43", - "refPlusZeroRef.$": "$.heap31", - "refStringPlusBooleanConst.$": "$.heap105", - "refStringPlusNumberConst.$": "$.heap99", - "refStringPlusRefString.$": "$.heap119", - "refStringPlusStringConst.$": "$.heap101", - "stringConstPlusRefString.$": "$.heap111", + "minusEqualsConst.$": "$.heap9.out", + "minusEqualsNegConst.$": "$.heap17.out", + "minusEqualsRef.$": "$.heap14.out", + "negateNegRef.$": "$.heap91.num", + "negateRef.$": "$.heap88.num", + "negateZeroRef.$": "$.heap94.num", + "numberConstPlusRefString.$": "$.heap108", + "plusEqualsConst.$": "$.heap2", + "plusEqualsRef.$": "$.heap6", + "postMinusMinus.$": "$.heap83", + "postPlusPlus.$": "$.heap78", + "preMinusMinus.$": "$.heap85.out", + "prePlusPlus.$": "$.heap80.out", + "refBooleanPlusBooleanConst.$": "$.heap50", + "refBooleanPlusBooleanRef.$": "$.heap54", + "refMinusConst.$": "$.heap72.out", + "refMinusNegConst.$": "$.heap75.out", + "refMinusNegRef.$": "$.heap64.out", + "refMinusRef.$": "$.heap59.out", + "refMinusZeroRef.$": "$.heap69.out", + "refPlusBooleanConst.$": "$.heap46", + "refPlusConst.$": "$.heap34", + "refPlusNegConst.$": "$.heap38", + "refPlusNegRef.$": "$.heap26", + "refPlusRef.$": "$.heap22", + "refPlusZeroConst.$": "$.heap42", + "refPlusZeroRef.$": "$.heap30", + "refStringPlusBooleanConst.$": "$.heap104", + "refStringPlusNumberConst.$": "$.heap98", + "refStringPlusRefString.$": "$.heap118", + "refStringPlusStringConst.$": "$.heap100.str", + "stringConstPlusRefString.$": "$.heap110.str", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual 1": { - "InputPath": "$.heap2", - "Next": "b += input.p", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "1__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual 2": { "InputPath": "$.heap2", - "Next": "1__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual 1", + "Next": "b += input.p", "ResultPath": "$.b", "Type": "Pass", }, "1__true__1 + input.str": { "InputPath": "$.heap106.str", - "Next": "60__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap108", "Type": "Pass", }, @@ -30577,7 +24492,7 @@ exports[`math 1`] = ` }, "1__true__input.b + input.b": { "InputPath": "$.heap52.str", - "Next": "28__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap54", "Type": "Pass", }, @@ -30594,7 +24509,7 @@ exports[`math 1`] = ` }, "1__true__input.b + true": { "InputPath": "$.heap48.str", - "Next": "26__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.b + input.b", "ResultPath": "$.heap50", "Type": "Pass", }, @@ -30608,7 +24523,7 @@ exports[`math 1`] = ` }, "1__true__input.p + -0": { "InputPath": "$.heap40.str", - "Next": "22__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + true", "ResultPath": "$.heap42", "Type": "Pass", }, @@ -30622,7 +24537,7 @@ exports[`math 1`] = ` }, "1__true__input.p + -1": { "InputPath": "$.heap36.str", - "Next": "20__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + -0", "ResultPath": "$.heap38", "Type": "Pass", }, @@ -30636,7 +24551,7 @@ exports[`math 1`] = ` }, "1__true__input.p + 1": { "InputPath": "$.heap32.str", - "Next": "18__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + -1", "ResultPath": "$.heap34", "Type": "Pass", }, @@ -30650,7 +24565,7 @@ exports[`math 1`] = ` }, "1__true__input.p + input.n": { "InputPath": "$.heap24.str", - "Next": "14__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + input.z", "ResultPath": "$.heap26", "Type": "Pass", }, @@ -30667,7 +24582,7 @@ exports[`math 1`] = ` }, "1__true__input.p + input.p": { "InputPath": "$.heap20.str", - "Next": "12__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + input.n", "ResultPath": "$.heap22", "Type": "Pass", }, @@ -30684,7 +24599,7 @@ exports[`math 1`] = ` }, "1__true__input.p + input.z": { "InputPath": "$.heap28.str", - "Next": "16__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.p + 1", "ResultPath": "$.heap30", "Type": "Pass", }, @@ -30701,7 +24616,7 @@ exports[`math 1`] = ` }, "1__true__input.p + true": { "InputPath": "$.heap44.str", - "Next": "24__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.b + true", "ResultPath": "$.heap46", "Type": "Pass", }, @@ -30715,7 +24630,7 @@ exports[`math 1`] = ` }, "1__true__input.str + 1": { "InputPath": "$.heap96.str", - "Next": "54__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.heap98", "Type": "Pass", }, @@ -30746,7 +24661,7 @@ exports[`math 1`] = ` }, "1__true__input.str + true": { "InputPath": "$.heap102.str", - "Next": "58__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "1 + input.str", "ResultPath": "$.heap104", "Type": "Pass", }, @@ -30774,7 +24689,7 @@ exports[`math 1`] = ` }, "1__true__true + input.str": { "InputPath": "$.heap112.str", - "Next": "64__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + input.str", "ResultPath": "$.heap114", "Type": "Pass", }, @@ -30786,36 +24701,6 @@ exports[`math 1`] = ` "ResultPath": "$.heap112", "Type": "Pass", }, - "20__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap38", - "Next": "input.p + -0", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "22__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap42", - "Next": "input.p + true", - "ResultPath": "$.heap43", - "Type": "Pass", - }, - "24__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap46", - "Next": "input.b + true", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "26__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap50", - "Next": "input.b + input.b", - "ResultPath": "$.heap51", - "Type": "Pass", - }, - "28__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap54", - "Next": "29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap55", - "Type": "Pass", - }, "29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -30939,13 +24824,13 @@ exports[`math 1`] = ` }, "2__a++": { "InputPath": "$.heap77.out", - "Next": "40__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "41__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.a", "Type": "Pass", }, "2__a--": { "InputPath": "$.heap82.out", - "Next": "44__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "45__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "ResultPath": "$.a", "Type": "Pass", }, @@ -31061,12 +24946,6 @@ exports[`math 1`] = ` "ResultPath": "$.heap116", "Type": "Pass", }, - "30__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap59.out", - "Next": "31__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap60", - "Type": "Pass", - }, "31__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31140,12 +25019,6 @@ exports[`math 1`] = ` "Default": "null__31__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, min", "Type": "Choice", }, - "32__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap64.out", - "Next": "33__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap65", - "Type": "Pass", - }, "33__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31219,12 +25092,6 @@ exports[`math 1`] = ` "Default": "null__33__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, min", "Type": "Choice", }, - "34__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap69.out", - "Next": "35__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap70", - "Type": "Pass", - }, "35__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31298,12 +25165,6 @@ exports[`math 1`] = ` "Default": "null__35__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, min", "Type": "Choice", }, - "36__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap72.out", - "Next": "37__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap73", - "Type": "Pass", - }, "37__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31377,14 +25238,8 @@ exports[`math 1`] = ` "Default": "null__37__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, min", "Type": "Choice", }, - "38__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap75.out", - "Next": "a++", - "ResultPath": "$.heap76", - "Type": "Pass", - }, "3__29__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "30__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "31__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "Parameters": { "out.$": "States.MathAdd($.heap56.num,$.heap58.num)", }, @@ -31392,7 +25247,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "3__31__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "32__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "33__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "Parameters": { "out.$": "States.MathAdd($.heap61.num,$.heap63.num)", }, @@ -31400,7 +25255,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "3__33__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE": { - "Next": "34__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "35__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", "Parameters": { "out.$": "States.MathAdd($.heap66.num,$.heap68.num)", }, @@ -31415,18 +25270,6 @@ exports[`math 1`] = ` "ResultPath": "$.heap14", "Type": "Pass", }, - "3__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual": { - "InputPath": "$.heap6", - "Next": "b -= 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "40__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap78", - "Next": "41__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap79", - "Type": "Pass", - }, "41__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Next": "1__41__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE", "Parameters": { @@ -31435,18 +25278,6 @@ exports[`math 1`] = ` "ResultPath": "$.heap80", "Type": "Pass", }, - "42__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap80.out", - "Next": "a--", - "ResultPath": "$.heap81", - "Type": "Pass", - }, - "44__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap83", - "Next": "45__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap84", - "Type": "Pass", - }, "45__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Next": "1__45__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusE", "Parameters": { @@ -31455,36 +25286,6 @@ exports[`math 1`] = ` "ResultPath": "$.heap85", "Type": "Pass", }, - "46__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap85.out", - "Next": "input.p", - "ResultPath": "$.heap86", - "Type": "Pass", - }, - "48__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap88.num", - "Next": "input.n", - "ResultPath": "$.heap89", - "Type": "Pass", - }, - "50__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap91.num", - "Next": "input.z", - "ResultPath": "$.heap92", - "Type": "Pass", - }, - "52__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap94.num", - "Next": "input.str + 1", - "ResultPath": "$.heap95", - "Type": "Pass", - }, - "54__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap98", - "Next": "55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap99", - "Type": "Pass", - }, "55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31496,30 +25297,6 @@ exports[`math 1`] = ` "Default": "format__55__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, m", "Type": "Choice", }, - "56__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap100.str", - "Next": "input.str + true", - "ResultPath": "$.heap101", - "Type": "Pass", - }, - "58__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap104", - "Next": "1 + input.str", - "ResultPath": "$.heap105", - "Type": "Pass", - }, - "5__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual": { - "InputPath": "$.heap9.out", - "Next": "b -= input.p", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "60__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap108", - "Next": "61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap109", - "Type": "Pass", - }, "61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "Choices": [ { @@ -31531,36 +25308,12 @@ exports[`math 1`] = ` "Default": "format__61__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, m", "Type": "Choice", }, - "62__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap110.str", - "Next": "true + input.str", - "ResultPath": "$.heap111", - "Type": "Pass", - }, - "64__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { - "InputPath": "$.heap114", - "Next": "input.str + input.str", - "ResultPath": "$.heap115", - "Type": "Pass", - }, "66__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua": { "InputPath": "$.heap118", "Next": "1__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual", "ResultPath": "$.heap119", "Type": "Pass", }, - "7__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual": { - "InputPath": "$.heap14.out", - "Next": "b -= -1", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "9__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqual": { - "InputPath": "$.heap17.out", - "Next": "10__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", - "ResultPath": "$.heap18", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "a = input.p", "Parameters": { @@ -31574,19 +25327,19 @@ exports[`math 1`] = ` }, "NaN__1__input.n": { "InputPath": "$.fnl_context.null", - "Next": "50__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.z", "ResultPath": "$.heap91.num", "Type": "Pass", }, "NaN__1__input.p": { "InputPath": "$.fnl_context.null", - "Next": "48__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.n", "ResultPath": "$.heap88.num", "Type": "Pass", }, "NaN__1__input.z": { "InputPath": "$.fnl_context.null", - "Next": "52__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + 1", "ResultPath": "$.heap94.num", "Type": "Pass", }, @@ -36529,7 +30282,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "positive__1__input.n": { - "Next": "50__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.z", "Parameters": { "num.$": "States.StringToJson(States.Format('-{}',$.heap90.num))", }, @@ -36537,7 +30290,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "positive__1__input.p": { - "Next": "48__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.n", "Parameters": { "num.$": "States.StringToJson(States.Format('-{}',$.heap87.num))", }, @@ -36545,7 +30298,7 @@ exports[`math 1`] = ` "Type": "Pass", }, "positive__1__input.z": { - "Next": "52__return {plusEqualsConst: b += 1, plusEqualsRef: b += input.p, minusEqua", + "Next": "input.str + 1", "Parameters": { "num.$": "States.StringToJson(States.Format('-{}',$.heap93.num))", }, @@ -37051,70 +30804,10 @@ exports[`object literal spread 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "10__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "11__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "11__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "12__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "12__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "13__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "13__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "14__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "14__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "15__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "15__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "16__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap16", - "Type": "Pass", - }, - "16__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "17__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "17__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "18__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap18", - "Type": "Pass", - }, - "18__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "19__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap19", - "Type": "Pass", - }, - "19__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "20__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap20", - "Type": "Pass", - }, "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu": { "Next": "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", "Parameters": { - "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0,$.heap65,false),$.heap66,false),$.heap74.out.d1,false),$.heap67,false),$.heap68,false),$.heap69,false),$.heap70,false),$.heap71,false),$.heap72,false),$.heap73,false)", + "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0,$.input,false),$.input,false),$.heap74.out.d1,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.heap73,false)", }, "ResultPath": "$.heap74", "Type": "Pass", @@ -37122,7 +30815,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 1": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0,$.heap55,false),$.heap56,false),$.heap57,false),$.heap58,false),$.heap59,false),$.heap60,false),$.heap61,false),$.heap62,false),$.heap63,false),$.heap64,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", "d1.$": "States.StringToJson('{"x":7,"y":8,"z":9,"a":1,"m":4}')", }, "ResultPath": "$.heap74.out", @@ -37131,7 +30824,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 2": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 1", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0,$.heap45,false),$.heap46,false),$.heap47,false),$.heap48,false),$.heap49,false),$.heap50,false),$.heap51,false),$.heap52,false),$.heap53,false),$.heap54,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap74.out.d0", "Type": "Pass", @@ -37139,7 +30832,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 3": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 2", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0,$.heap35,false),$.heap36,false),$.heap37,false),$.heap38,false),$.heap39,false),$.heap40,false),$.heap41,false),$.heap42,false),$.heap43,false),$.heap44,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap74.out.d0.d0", "Type": "Pass", @@ -37147,7 +30840,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 4": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 3", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0,$.heap25,false),$.heap26,false),$.heap27,false),$.heap28,false),$.heap29,false),$.heap30,false),$.heap31,false),$.heap32,false),$.heap33,false),$.heap34,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap74.out.d0.d0.d0", "Type": "Pass", @@ -37155,7 +30848,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 5": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 4", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0.d0,$.heap16,false),$.heap17,false),$.heap18,false),$.heap19,false),$.heap74.out.d0.d0.d0.d0.d0.d1,false),$.heap20,false),$.heap21,false),$.heap22,false),$.heap23,false),$.heap24,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.heap74.out.d0.d0.d0.d0.d0.d1,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap74.out.d0.d0.d0.d0", "Type": "Pass", @@ -37163,7 +30856,7 @@ exports[`object literal spread 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 5", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0.d0.d0,$.heap6,false),$.heap7,false),$.heap8,false),$.heap9,false),$.heap10,false),$.heap11,false),$.heap12,false),$.heap13,false),$.heap14,false),$.heap15,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap74.out.d0.d0.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", "d1.$": "States.StringToJson('{"m":0,"n":5,"o":6}')", }, "ResultPath": "$.heap74.out.d0.d0.d0.d0.d0", @@ -37175,417 +30868,666 @@ exports[`object literal spread 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, . 1": { - "InputPath": "$.input", - "Next": "2__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "20__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "21__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "21__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "22__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap22", - "Type": "Pass", - }, - "22__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "23__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "23__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "24__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap24", - "Type": "Pass", - }, - "24__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "25__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap25", + "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { + "Next": "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", + "Parameters": { + "literalValueObjectLiterals.$": "$.heap0.out", + }, + "ResultPath": "$.heap73", "Type": "Pass", }, - "25__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "26__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap26", + "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { + "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6", + "Parameters": { + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.StringToJson('{"a":0,"b":2,"c":3}'),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", + }, + "ResultPath": "$.heap74.out.d0.d0.d0.d0.d0.d0", "Type": "Pass", }, - "26__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "27__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap27", + "Initialize Functionless Context": { + "Next": "literalValueObjectLiterals = {x: 1, y: "a", j: {x: 2}, ...input}", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", "Type": "Pass", }, - "27__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "28__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap28", + "literalValueObjectLiterals = {x: 1, y: "a", j: {x: 2}, ...input}": { + "Next": "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", + "Parameters": { + "out.$": "States.JsonMerge(States.StringToJson('{"x":1,"y":"a","j":{"x":2}}'),$.input,false)", + }, + "ResultPath": "$.heap0", "Type": "Pass", }, - "28__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "29__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap29", + }, +} +`; + +exports[`optimize cases 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "End": true, + "Parameters": { + "a.$": "$.input.obj.a", + "b.$": "$.input.arr[0]", + "c": "a", + "d": 1, + "t.$": "$.heap11.string", + "u": { + "f": "e", + }, + "v": "d", + "w.$": "$.d.c", + "x.$": "$.c.c", + "y.$": "$.b", + "z.$": "$.a", + }, + "ResultPath": "$", "Type": "Pass", }, - "29__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "30__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap30", + "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": "a", + "ResultPath": "$.heap2", "Type": "Pass", }, - "2__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "3__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", + "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": 1, "ResultPath": "$.heap3", "Type": "Pass", }, - "30__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "31__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap31", - "Type": "Pass", - }, - "31__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "32__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap32", - "Type": "Pass", - }, - "32__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "33__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap33", - "Type": "Pass", - }, - "33__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "34__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap34", - "Type": "Pass", - }, - "34__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "35__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "35__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "36__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap36", - "Type": "Pass", - }, - "36__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "37__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap37", - "Type": "Pass", - }, - "37__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "38__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap38", - "Type": "Pass", - }, - "38__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "39__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "39__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "40__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap40", - "Type": "Pass", - }, - "3__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "4__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap4", - "Type": "Pass", - }, - "40__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "41__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap41", - "Type": "Pass", - }, - "41__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "42__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap42", - "Type": "Pass", - }, - "42__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "43__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap43", - "Type": "Pass", - }, - "43__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "44__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap44", - "Type": "Pass", - }, - "44__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "45__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap45", - "Type": "Pass", - }, - "45__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "46__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap46", - "Type": "Pass", - }, - "46__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "47__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "47__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "48__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "48__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "49__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "49__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "50__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap50", - "Type": "Pass", - }, - "4__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "5__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "50__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "51__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap51", - "Type": "Pass", - }, - "51__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "52__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap52", - "Type": "Pass", - }, - "52__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "53__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap53", + "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": "d", + "ResultPath": "$.heap8", "Type": "Pass", }, - "53__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "54__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap54", + "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "this g.e 1", + "Parameters": { + "f": "e", + }, + "ResultPath": "$.heap9", "Type": "Pass", }, - "54__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "55__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap55", + "Initialize Functionless Context": { + "Next": "obj = {1: "a"}", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", "Type": "Pass", }, - "55__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "56__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap56", + "a = "a"": { + "Next": "b = {c: ""}", + "Result": "a", + "ResultPath": "$.a", "Type": "Pass", }, - "56__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "57__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap57", + "a = "b"": { + "Next": "b = {c: ""}", + "Result": "b", + "ResultPath": "$.a", "Type": "Pass", }, - "57__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "58__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap58", + "arr = [1]": { + "Next": "if(input.x)", + "Result": [ + 1, + ], + "ResultPath": "$.arr", "Type": "Pass", }, - "58__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "59__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap59", + "b = {c: ""}": { + "Next": "if(input.x) 1", + "Result": { + "c": "", + }, + "ResultPath": "$.b", "Type": "Pass", }, - "59__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "60__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap60", + "b.c = "a"": { + "Next": "c = {c: ""}", + "Result": "a", + "ResultPath": "$.b.c", "Type": "Pass", }, - "5__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "6__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap6", + "b.c = "b"": { + "Next": "c = {c: ""}", + "Result": "b", + "ResultPath": "$.b.c", "Type": "Pass", }, - "60__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "61__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap61", + "c = {c: ""}": { + "Next": "if(input.x) 2", + "Result": { + "c": "", + }, + "ResultPath": "$.c", "Type": "Pass", }, - "61__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "62__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap62", + "c.c = "a"": { + "Next": "d = {c: {c: ""}}", + "Result": "a", + "ResultPath": "$.c.c", "Type": "Pass", }, - "62__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "63__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap63", + "c.c = "b"": { + "Next": "d = {c: {c: ""}}", + "Result": "b", + "ResultPath": "$.c.c", "Type": "Pass", }, - "63__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "64__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap64", + "d = {c: {c: ""}}": { + "Next": "xx = {c: "1"}", + "Result": { + "c": { + "c": "", + }, + }, + "ResultPath": "$.d", "Type": "Pass", }, - "64__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "65__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap65", + "d.c = xx": { + "Next": "e = {d: "d"}", + "Parameters": { + "c": "1", + }, + "ResultPath": "$.d.c", "Type": "Pass", }, - "65__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "66__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap66", + "d.c = yy": { + "Next": "e = {d: "d"}", + "Parameters": { + "c": "2", + }, + "ResultPath": "$.d.c", "Type": "Pass", }, - "66__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "67__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap67", + "e = {d: "d"}": { + "Next": "v = e.d", + "Result": { + "d": "d", + }, + "ResultPath": "$.e", "Type": "Pass", }, - "67__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "68__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap68", + "f = {e: {f: "e"}}": { + "Next": "u = f.e", + "Result": { + "e": { + "f": "e", + }, + }, + "ResultPath": "$.f", "Type": "Pass", }, - "68__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "69__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap69", + "g = {e: "f"}": { + "Next": "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Result": { + "e": "f", + }, + "ResultPath": "$.g", "Type": "Pass", }, - "69__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "70__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap70", - "Type": "Pass", + "if(input.x)": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "a = "a"", + }, + ], + "Default": "a = "b"", + "Type": "Choice", }, - "6__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "7__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap7", - "Type": "Pass", + "if(input.x) 1": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "b.c = "a"", + }, + ], + "Default": "b.c = "b"", + "Type": "Choice", }, - "70__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "71__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap71", - "Type": "Pass", + "if(input.x) 2": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "c.c = "a"", + }, + ], + "Default": "c.c = "b"", + "Type": "Choice", }, - "71__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap72", - "Type": "Pass", + "if(input.x) 3": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "d.c = xx", + }, + ], + "Default": "d.c = yy", + "Type": "Choice", }, - "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "Next": "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "Parameters": { - "literalValueObjectLiterals.$": "$.literalValueObjectLiterals", + "obj = {1: "a"}": { + "Next": "arr = [1]", + "Result": { + "1": "a", }, - "ResultPath": "$.heap73", + "ResultPath": "$.obj", "Type": "Pass", }, - "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6", + "this g.e 1": { + "Next": "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.StringToJson('{"a":0,"b":2,"c":3}'),$.heap1,false),$.heap2,false),$.heap3,false),$.heap4,false),$.heap5,false)", + "string.$": "States.Format('this {}','f')", }, - "ResultPath": "$.heap74.out.d0.d0.d0.d0.d0.d0", - "Type": "Pass", - }, - "7__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "8__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "8__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "9__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "9__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "10__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap10", + "ResultPath": "$.heap11", "Type": "Pass", }, - "Initialize Functionless Context": { - "Next": "literalValueObjectLiterals = {x: 1, y: "a", j: {x: 2}, ...input}", + "u = f.e": { + "Next": "g = {e: "f"}", "Parameters": { - "fnl_context": { - "null": null, - }, - "input.$": "$$.Execution.Input", + "f": "e", }, - "ResultPath": "$", + "ResultPath": "$.u", "Type": "Pass", }, - "literalValueObjectLiterals": { - "InputPath": "$.heap0.out", - "Next": "return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ...i", - "ResultPath": "$.literalValueObjectLiterals", + "v = e.d": { + "Next": "f = {e: {f: "e"}}", + "Parameters": "d", + "ResultPath": "$.v", "Type": "Pass", }, - "literalValueObjectLiterals = {x: 1, y: "a", j: {x: 2}, ...input}": { - "Next": "literalValueObjectLiterals", - "Parameters": { - "out.$": "States.JsonMerge(States.StringToJson('{"x":1,"y":"a","j":{"x":2}}'),$.input,false)", + "xx = {c: "1"}": { + "Next": "yy = {c: "2"}", + "Result": { + "c": "1", }, - "ResultPath": "$.heap0", + "ResultPath": "$.xx", "Type": "Pass", }, - "return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ...i": { - "InputPath": "$.input", - "Next": "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, . 1", - "ResultPath": "$.heap1", + "yy = {c: "2"}": { + "Next": "if(input.x) 3", + "Result": { + "c": "2", + }, + "ResultPath": "$.yy", "Type": "Pass", }, }, @@ -37599,8 +31541,8 @@ exports[`overlapping variable with input 1`] = ` "1__return {a: input.a, b: a}": { "End": true, "Parameters": { - "a.$": "$.heap0", - "b.$": "$.a", + "a.$": "$.input.a", + "b": "2", }, "ResultPath": "$", "Type": "Pass", @@ -37643,7 +31585,7 @@ exports[`queue 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "1__await queue.sendMessageBatch({Entries: [{MessageBody: {id: "hello"}, Id:": { @@ -37858,50 +31800,20 @@ exports[`shadowing maintains state 1`] = ` "abcdef": { "Next": "1__return abcdef", "Parameters": { - "string.$": "States.Format('{}{}{}{}{}{}',$.heap2,$.heap3,$.heap4,$.heap5,$.heap6,$.heap7)", + "string.$": "States.Format('{}{}{}{}{}{}',$.a__1,$.b__1,$.c__1,$.d__1,$.e__1,$.f__1)", }, "ResultPath": "$.heap8", "Type": "Pass", }, - "b": { - "InputPath": "$.b__1", - "Next": "c", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "c": { - "InputPath": "$.c__1", - "Next": "d", - "ResultPath": "$.heap4", - "Type": "Pass", - }, - "d": { - "InputPath": "$.d__1", - "Next": "e", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "e": { - "InputPath": "$.e__1", - "Next": "f", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "f": { - "InputPath": "$.f__1", - "Next": "abcdef", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "return abcdef": { "InputPath": "$.a__1", - "Next": "b", - "ResultPath": "$.heap2", + "Next": "abcdef", + "ResultPath": null, "Type": "Pass", }, }, }, - "Next": "r", + "Next": "-rabcdef", "Parameters": { "a__1.$": "$.a__1", "b__1.$": "$.b__1", @@ -37916,16 +31828,10 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.heap10", "Type": "Map", }, - "-f": { - "InputPath": "$.f", - "Next": "z 2", - "ResultPath": "$.heap61", - "Type": "Pass", - }, "-rabcdef": { "Next": "res = -rabcdef 1", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap11,$.heap12,$.heap13,$.heap14,$.heap15,$.heap16,$.heap17)", + "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap10[0],$.a__1,$.b__1,$.c__1,$.d__1,$.e__1,$.f)", }, "ResultPath": "$.heap18", "Type": "Pass", @@ -37933,7 +31839,7 @@ exports[`shadowing maintains state 1`] = ` "-resabcde-fz": { "Next": "1__return -resabcde-fz", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}-{}',$.heap55,$.heap56,$.heap57,$.heap58,$.heap59,$.heap60,$.heap61,$.heap62)", + "string.$": "States.Format('{}-{}{}{}{}{}{}-{}',$.res,1,$.b,$.c,$.d,$.e,$.f,$.heap54[0])", }, "ResultPath": "$.heap63", "Type": "Pass", @@ -37941,7 +31847,7 @@ exports[`shadowing maintains state 1`] = ` "-resabcdef": { "Next": "res = -resabcdef 4", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap19,$.heap20,$.heap21,$.heap22,$.heap23,$.heap24,$.heap25)", + "string.$": "States.Format('{}-{}{}{}{}{}{}',$.res,$.a__1,$.b__1,$.c__1,$.d__1,$.e,$.f)", }, "ResultPath": "$.heap26", "Type": "Pass", @@ -37949,7 +31855,7 @@ exports[`shadowing maintains state 1`] = ` "-resabcdef 1": { "Next": "res = -resabcdef 5", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap27,$.heap28,$.heap29,$.heap30,$.heap31,$.heap32,$.heap33)", + "string.$": "States.Format('{}-{}{}{}{}{}{}',$.res,$.a__1,$.b__1,$.c__1,$.d,$.e,$.f)", }, "ResultPath": "$.heap34", "Type": "Pass", @@ -37957,7 +31863,7 @@ exports[`shadowing maintains state 1`] = ` "-resabcdef 2": { "Next": "res = -resabcdef 6", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap35,$.heap36,$.heap37,$.heap38,$.heap39,$.heap40,$.heap41)", + "string.$": "States.Format('{}-{}{}{}{}{}{}',$.res,$.a__1,$.b__1,$.c,$.d,$.e,$.f)", }, "ResultPath": "$.heap42", "Type": "Pass", @@ -37965,7 +31871,7 @@ exports[`shadowing maintains state 1`] = ` "-resabcdef 3": { "Next": "res = -resabcdef 7", "Parameters": { - "string.$": "States.Format('{}-{}{}{}{}{}{}',$.heap44,$.heap45,$.heap46,$.heap47,$.heap48,$.heap49,$.heap50)", + "string.$": "States.Format('{}-{}{}{}{}{}{}',$.res,$.a__1,$.b,$.c,$.d,$.e,$.f)", }, "ResultPath": "$.heap51", "Type": "Pass", @@ -37973,7 +31879,9 @@ exports[`shadowing maintains state 1`] = ` "1__await Promise.all([4].map(function (c)))": { "Next": "check__1__await Promise.all([4].map(function (c)))", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + 4, + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -38031,7 +31939,7 @@ exports[`shadowing maintains state 1`] = ` "Next": "r = await $SFN.map([7], function (f))[0]", }, ], - "Default": "res = -resabcdef 3", + "Default": "-resabcdef", "Type": "Choice", }, "1__return -resabcde-fz": { @@ -38043,7 +31951,9 @@ exports[`shadowing maintains state 1`] = ` "1__z = [0].map(function (z))[0]": { "Next": "check__1__z = [0].map(function (z))[0]", "Parameters": { - "arr.$": "$.heap53", + "arr": [ + 0, + ], "arrStr": "[null", }, "ResultPath": "$.heap54", @@ -38067,50 +31977,8 @@ exports[`shadowing maintains state 1`] = ` }, "a": { "InputPath": "$.heap52[0].index", - "Next": "assignValue__a", - "ResultPath": "$.a__1", - "Type": "Pass", - }, - "a 1": { - "InputPath": "$.a__1", - "Next": "b 3", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "a 2": { - "InputPath": "$.a__1", - "Next": "b 4", - "ResultPath": "$.heap20", - "Type": "Pass", - }, - "a 3": { - "InputPath": "$.a__1", - "Next": "b 5", - "ResultPath": "$.heap28", - "Type": "Pass", - }, - "a 4": { - "InputPath": "$.a__1", - "Next": "b 6", - "ResultPath": "$.heap36", - "Type": "Pass", - }, - "a 5": { - "InputPath": "$.a__1", - "Next": "b 7", - "ResultPath": "$.heap45", - "Type": "Pass", - }, - "a 6": { - "InputPath": "$.a", - "Next": "b 8", - "ResultPath": "$.heap56", - "Type": "Pass", - }, - "assignValue__a": { - "InputPath": "$.heap52[0].item", "Next": "for(b of [3])", - "ResultPath": "$.0__a__1", + "ResultPath": "$.a__1", "Type": "Pass", }, "await Promise.all([4].map(function (c)))": { @@ -38133,42 +32001,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.b__1", "Type": "Pass", }, - "b 3": { - "InputPath": "$.b__1", - "Next": "c 3", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "b 4": { - "InputPath": "$.b__1", - "Next": "c 4", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "b 5": { - "InputPath": "$.b__1", - "Next": "c 5", - "ResultPath": "$.heap29", - "Type": "Pass", - }, - "b 6": { - "InputPath": "$.b__1", - "Next": "c 6", - "ResultPath": "$.heap37", - "Type": "Pass", - }, - "b 7": { - "InputPath": "$.b", - "Next": "c 7", - "ResultPath": "$.heap46", - "Type": "Pass", - }, - "b 8": { - "InputPath": "$.b", - "Next": "c 8", - "ResultPath": "$.heap57", - "Type": "Pass", - }, "c 1": { "Next": "d 1", "Result": 1, @@ -38181,42 +32013,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.c__1", "Type": "Pass", }, - "c 3": { - "InputPath": "$.c__1", - "Next": "d 2", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "c 4": { - "InputPath": "$.c__1", - "Next": "d 3", - "ResultPath": "$.heap22", - "Type": "Pass", - }, - "c 5": { - "InputPath": "$.c__1", - "Next": "d 4", - "ResultPath": "$.heap30", - "Type": "Pass", - }, - "c 6": { - "InputPath": "$.c", - "Next": "d 5", - "ResultPath": "$.heap38", - "Type": "Pass", - }, - "c 7": { - "InputPath": "$.c", - "Next": "d 6", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "c 8": { - "InputPath": "$.c", - "Next": "d 7", - "ResultPath": "$.heap58", - "Type": "Pass", - }, "check__1__await Promise.all([4].map(function (c)))": { "Choices": [ { @@ -38232,7 +32028,7 @@ exports[`shadowing maintains state 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "z 1", + "Next": "return z", "Variable": "$.heap54.arr[0]", }, ], @@ -38245,42 +32041,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.d", "Type": "Pass", }, - "d 2": { - "InputPath": "$.d__1", - "Next": "e 2", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "d 3": { - "InputPath": "$.d__1", - "Next": "e 3", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "d 4": { - "InputPath": "$.d", - "Next": "e 4", - "ResultPath": "$.heap31", - "Type": "Pass", - }, - "d 5": { - "InputPath": "$.d", - "Next": "e 5", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "d 6": { - "InputPath": "$.d", - "Next": "e 6", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "d 7": { - "InputPath": "$.d", - "Next": "e 7", - "ResultPath": "$.heap59", - "Type": "Pass", - }, "d = 5": { "Next": "for(e = 6;e === 6;e = 7)", "Result": 5, @@ -38293,42 +32053,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.e", "Type": "Pass", }, - "e 2": { - "InputPath": "$.e__1", - "Next": "f 2", - "ResultPath": "$.heap16", - "Type": "Pass", - }, - "e 3": { - "InputPath": "$.e", - "Next": "f 3", - "ResultPath": "$.heap24", - "Type": "Pass", - }, - "e 4": { - "InputPath": "$.e", - "Next": "f 4", - "ResultPath": "$.heap32", - "Type": "Pass", - }, - "e 5": { - "InputPath": "$.e", - "Next": "f 5", - "ResultPath": "$.heap40", - "Type": "Pass", - }, - "e 6": { - "InputPath": "$.e", - "Next": "f 6", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "e 7": { - "InputPath": "$.e", - "Next": "-f", - "ResultPath": "$.heap60", - "Type": "Pass", - }, "e = 7": { "Next": "1__for(e = 6;e === 6;e = 7)", "Result": 7, @@ -38357,36 +32081,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.f", "Type": "Pass", }, - "f 2": { - "InputPath": "$.f", - "Next": "-rabcdef", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "f 3": { - "InputPath": "$.f", - "Next": "-resabcdef", - "ResultPath": "$.heap25", - "Type": "Pass", - }, - "f 4": { - "InputPath": "$.f", - "Next": "-resabcdef 1", - "ResultPath": "$.heap33", - "Type": "Pass", - }, - "f 5": { - "InputPath": "$.f", - "Next": "-resabcdef 2", - "ResultPath": "$.heap41", - "Type": "Pass", - }, - "f 6": { - "InputPath": "$.f", - "Next": "-resabcdef 3", - "ResultPath": "$.heap50", - "Type": "Pass", - }, "for(a in [2])": { "Next": "1__for(a in [2])", "Result": [ @@ -38446,7 +32140,7 @@ exports[`shadowing maintains state 1`] = ` "Variable": "$.heap43[0]", }, ], - "Default": "res = -resabcdef", + "Default": "-resabcdef 3", "Type": "Choice", }, "if(c === 4)": { @@ -38481,15 +32175,9 @@ exports[`shadowing maintains state 1`] = ` "Next": "d = 5", }, ], - "Default": "res = -resabcdef 2", + "Default": "-resabcdef 1", "Type": "Choice", }, - "r": { - "InputPath": "$.heap10[0]", - "Next": "res = -rabcdef", - "ResultPath": "$.r", - "Type": "Pass", - }, "r = await $SFN.map([7], function (f))[0]": { "Next": "$SFN.map([7], function (f))", "Result": [ @@ -38504,45 +32192,15 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.res", "Type": "Pass", }, - "res = -rabcdef": { - "InputPath": "$.r", - "Next": "a 1", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "res = -rabcdef 1": { "InputPath": "$.heap18.string", "Next": "e = 7", "ResultPath": "$.res", "Type": "Pass", }, - "res = -resabcdef": { - "InputPath": "$.res", - "Next": "a 5", - "ResultPath": "$.heap44", - "Type": "Pass", - }, - "res = -resabcdef 1": { - "InputPath": "$.res", - "Next": "a 4", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "res = -resabcdef 2": { - "InputPath": "$.res", - "Next": "a 3", - "ResultPath": "$.heap27", - "Type": "Pass", - }, - "res = -resabcdef 3": { - "InputPath": "$.res", - "Next": "a 2", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "res = -resabcdef 4": { "InputPath": "$.heap26.string", - "Next": "res = -resabcdef 2", + "Next": "-resabcdef 1", "ResultPath": "$.res", "Type": "Pass", }, @@ -38564,12 +32222,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.res", "Type": "Pass", }, - "return -resabcde-fz": { - "InputPath": "$.res", - "Next": "a 6", - "ResultPath": "$.heap55", - "Type": "Pass", - }, "return null": { "InputPath": "$.fnl_context.null", "Next": "handleResult__1__await Promise.all([4].map(function (c)))", @@ -38577,20 +32229,20 @@ exports[`shadowing maintains state 1`] = ` "Type": "Pass", }, "return z": { - "InputPath": "$.z", + "InputPath": "$.heap54.arr[0]", "Next": "handleResult__1__z = [0].map(function (z))[0]", "ResultPath": "$.heap54.arr[0]", "Type": "Pass", }, "set__end__1__await Promise.all([4].map(function (c)))": { "InputPath": "$.heap1.result[1:]", - "Next": "res = -resabcdef 1", + "Next": "-resabcdef 2", "ResultPath": "$.heap1", "Type": "Pass", }, "set__end__1__z = [0].map(function (z))[0]": { "InputPath": "$.heap54.result[1:]", - "Next": "z", + "Next": "-resabcde-fz", "ResultPath": "$.heap54", "Type": "Pass", }, @@ -38606,24 +32258,6 @@ exports[`shadowing maintains state 1`] = ` "ResultPath": "$.heap43", "Type": "Pass", }, - "z": { - "InputPath": "$.heap54[0]", - "Next": "return -resabcde-fz", - "ResultPath": "$.z__1", - "Type": "Pass", - }, - "z 1": { - "InputPath": "$.heap54.arr[0]", - "Next": "return z", - "ResultPath": "$.z", - "Type": "Pass", - }, - "z 2": { - "InputPath": "$.z__1", - "Next": "-resabcde-fz", - "ResultPath": "$.heap62", - "Type": "Pass", - }, "z = [0].map(function (z))[0]": { "Next": "1__z = [0].map(function (z))[0]", "Result": [ @@ -38668,7 +32302,7 @@ exports[`templates 1`] = ` " input.obj.str "hello" partOfTheTemplateStringinput.obj.items[0]": { "Next": "1__result = await echoStringFunc( input.obj.str "hello" partOfTheTemplateSt", "Parameters": { - "string.$": "States.Format('{} hello {} {}',$.heap5,$.heap6,$.heap7)", + "string.$": "States.Format('{} hello {} {}',$.input.obj.str,$.heap2.string,$.input.obj.items[0])", }, "ResultPath": "$.heap8", "Type": "Pass", @@ -38708,15 +32342,9 @@ exports[`templates 1`] = ` "Default": "false__ input.obj.str === "hullo"", "Type": "Choice", }, - " partOfTheTemplateString": { - "InputPath": "$.partOfTheTemplateString", - "Next": "input.obj.items[0]", - "ResultPath": "$.heap6", - "Type": "Pass", - }, "1__result = await echoStringFunc( input.obj.str "hello" partOfTheTemplateSt": { "InputPath": "$.heap8.string", - "Next": "result", + "Next": " input.obj.str === "hullo"", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap9", "Type": "Task", @@ -38739,43 +32367,25 @@ exports[`templates 1`] = ` "Type": "Pass", }, "false__ input.obj.str === "hullo"": { - "Next": "templateWithSpecial 1", + "Next": "the result: result.str input.obj.str === "hullo"templateWithSpecial", "Result": false, "ResultPath": "$.heap11", "Type": "Pass", }, "false__partOfTheTemplateString = hello input.obj.str2 ?? "default"": { - "Next": "input.obj.str2 ?? "default"", + "Next": "hello input.obj.str2 ?? "default"", "Result": "default", "ResultPath": "$.heap0", "Type": "Pass", }, "hello input.obj.str2 ?? "default"": { - "Next": "partOfTheTemplateString", + "Next": "{{'\\\\\\\\'}}input.obj.str", "Parameters": { - "string.$": "States.Format('hello {}',$.heap1)", + "string.$": "States.Format('hello {}',$.heap0)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "input.obj.items[0]": { - "InputPath": "$.input.obj.items[0]", - "Next": " input.obj.str "hello" partOfTheTemplateStringinput.obj.items[0]", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "input.obj.str2 ?? "default"": { - "InputPath": "$.heap0", - "Next": "hello input.obj.str2 ?? "default"", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "partOfTheTemplateString": { - "InputPath": "$.heap2.string", - "Next": "templateWithSpecial = {{'\\\\\\\\'}}input.obj.str", - "ResultPath": "$.partOfTheTemplateString", - "Type": "Pass", - }, "partOfTheTemplateString = hello input.obj.str2 ?? "default"": { "Choices": [ { @@ -38795,66 +32405,30 @@ exports[`templates 1`] = ` "Default": "false__partOfTheTemplateString = hello input.obj.str2 ?? "default"", "Type": "Choice", }, - "result": { - "InputPath": "$.heap9", - "Next": "return the result: result.str input.obj.str === "hullo"templateWithSpecial", - "ResultPath": "$.result", - "Type": "Pass", - }, - "result = await echoStringFunc( input.obj.str "hello" partOfTheTemplateStrin": { - "InputPath": "$.input.obj.str", - "Next": " partOfTheTemplateString", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "return the result: result.str input.obj.str === "hullo"templateWithSpecial": { - "InputPath": "$.result.str", - "Next": " input.obj.str === "hullo"", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "templateWithSpecial": { - "InputPath": "$.heap4.string", - "Next": "result = await echoStringFunc( input.obj.str "hello" partOfTheTemplateStrin", - "ResultPath": "$.templateWithSpecial", - "Type": "Pass", - }, - "templateWithSpecial 1": { - "InputPath": "$.templateWithSpecial", - "Next": "the result: result.str input.obj.str === "hullo"templateWithSpecial", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "templateWithSpecial = {{'\\\\\\\\'}}input.obj.str": { - "InputPath": "$.input.obj.str", - "Next": "{{'\\\\\\\\'}}input.obj.str", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "the result: result.str input.obj.str === "hullo"templateWithSpecial": { "Next": "1__return the result: result.str input.obj.str === "hullo"templateWithSpec", "Parameters": { - "string.$": "States.Format('the result: {} {} {}',$.heap10,$.heap11,$.heap12)", + "string.$": "States.Format('the result: {} {} {}',$.heap9.str,$.heap11,$.heap4.string)", }, "ResultPath": "$.heap13", "Type": "Pass", }, "true__ input.obj.str === "hullo"": { - "Next": "templateWithSpecial 1", + "Next": "the result: result.str input.obj.str === "hullo"templateWithSpecial", "Result": true, "ResultPath": "$.heap11", "Type": "Pass", }, "true__partOfTheTemplateString = hello input.obj.str2 ?? "default"": { "InputPath": "$.input.obj.str2", - "Next": "input.obj.str2 ?? "default"", + "Next": "hello input.obj.str2 ?? "default"", "ResultPath": "$.heap0", "Type": "Pass", }, "{{'\\\\\\\\'}}input.obj.str": { - "Next": "templateWithSpecial", + "Next": " input.obj.str "hello" partOfTheTemplateStringinput.obj.items[0]", "Parameters": { - "string.$": "States.Format('\\{\\{\\'\\\\{}\\\\\\'\\}\\}',$.heap3)", + "string.$": "States.Format('\\{\\{\\'\\\\{}\\\\\\'\\}\\}',$.input.obj.str)", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -38867,52 +32441,22 @@ exports[`ternary 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "1__a = 1a": { - "InputPath": "$.heap1.string", - "Next": "if(input.f)", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "1__a = 2a": { - "InputPath": "$.heap4.string", - "Next": "if(input.t) 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "1__a = 3a": { - "InputPath": "$.heap6.string", - "Next": "if(input.t) 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "1__a = 4a": { - "InputPath": "$.heap9.string", - "Next": "return {true: if(input.t), false: if(input.f), constantTrue: if(true), cons", - "ResultPath": "$.heap10", - "Type": "Pass", - }, "1__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c": { "End": true, "Parameters": { - "constantFalse.$": "$.heap18", - "constantTrue.$": "$.heap16", - "false.$": "$.heap14", + "constantFalse.$": "$.heap17", + "constantTrue.$": "$.heap15", + "false.$": "$.heap13", "result.$": "$.a", - "true.$": "$.heap12", + "true.$": "$.heap11", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c 1": { - "InputPath": "$.heap11", - "Next": "if(input.f) 1", - "ResultPath": "$.heap12", - "Type": "Pass", - }, "1a": { "Next": "a = 1a 1", "Parameters": { - "string.$": "States.Format('{}1',$.heap0)", + "string.$": "States.Format('{}1',$.a)", }, "ResultPath": "$.heap1", "Type": "Pass", @@ -38920,21 +32464,15 @@ exports[`ternary 1`] = ` "2a": { "Next": "a = 2a 1", "Parameters": { - "string.$": "States.Format('{}2',$.heap3)", + "string.$": "States.Format('{}2',$.a)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "3__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c": { - "InputPath": "$.heap13", - "Next": "if(true)", - "ResultPath": "$.heap14", - "Type": "Pass", - }, "3a": { "Next": "a = 3a 1", "Parameters": { - "string.$": "States.Format('{}3',$.heap5)", + "string.$": "States.Format('{}3',$.a)", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -38942,17 +32480,11 @@ exports[`ternary 1`] = ` "4a": { "Next": "a = 4a 1", "Parameters": { - "string.$": "States.Format('{}4',$.heap8)", + "string.$": "States.Format('{}4',$.a)", }, "ResultPath": "$.heap9", "Type": "Pass", }, - "5__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c": { - "InputPath": "$.heap15", - "Next": "if(false)", - "ResultPath": "$.heap16", - "Type": "Pass", - }, "7__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c": { "InputPath": "$.heap17", "Next": "1__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c", @@ -38976,51 +32508,27 @@ exports[`ternary 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = 1a": { - "InputPath": "$.a", - "Next": "1a", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = 1a 1": { "InputPath": "$.heap1.string", - "Next": "1__a = 1a", + "Next": "if(input.f)", "ResultPath": "$.a", "Type": "Pass", }, - "a = 2a": { - "InputPath": "$.a", - "Next": "2a", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "a = 2a 1": { "InputPath": "$.heap4.string", - "Next": "1__a = 2a", + "Next": "if(input.t) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = 3a": { - "InputPath": "$.a", - "Next": "3a", - "ResultPath": "$.heap5", - "Type": "Pass", - }, "a = 3a 1": { "InputPath": "$.heap6.string", - "Next": "1__a = 3a", + "Next": "if(input.t) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = 4a": { - "InputPath": "$.a", - "Next": "4a", - "ResultPath": "$.heap8", - "Type": "Pass", - }, "a = 4a 1": { "InputPath": "$.heap9.string", - "Next": "1__a = 4a", + "Next": "return {true: if(input.t), false: if(input.f), constantTrue: if(true), cons", "ResultPath": "$.a", "Type": "Pass", }, @@ -39031,25 +32539,19 @@ exports[`ternary 1`] = ` "Type": "Pass", }, "false__if(input.f) 1": { - "Next": "3__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c", + "Next": "if(true)", "Result": "b", "ResultPath": "$.heap13", "Type": "Pass", }, - "false__if(input.t)": { - "InputPath": "$.fnl_context.null", - "Next": "if(input.f)", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "false__if(true)": { - "Next": "5__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c", + "Next": "if(false)", "Result": "d", "ResultPath": "$.heap15", "Type": "Pass", }, "false__return {true: if(input.t), false: if(input.f), constantTrue: if(true": { - "Next": "1__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c 1", + "Next": "if(input.f) 1", "Result": "b", "ResultPath": "$.heap11", "Type": "Pass", @@ -39160,10 +32662,10 @@ exports[`ternary 1`] = ` ], }, ], - "Next": "a = 2a", + "Next": "2a", }, ], - "Default": "a = 3a", + "Default": "3a", "Type": "Choice", }, "if(input.f) 1": { @@ -39362,10 +32864,10 @@ exports[`ternary 1`] = ` ], }, ], - "Next": "a = 1a", + "Next": "1a", }, ], - "Default": "false__if(input.t)", + "Default": "if(input.f)", "Type": "Choice", }, "if(input.t) 1": { @@ -39463,10 +32965,10 @@ exports[`ternary 1`] = ` ], }, ], - "Next": "true__if(input.t) 1", + "Next": "return {true: if(input.t), false: if(input.f), constantTrue: if(true), cons", }, ], - "Default": "a = 4a", + "Default": "4a", "Type": "Choice", }, "if(true)": { @@ -39588,25 +33090,19 @@ exports[`ternary 1`] = ` "Type": "Pass", }, "true__if(input.f) 1": { - "Next": "3__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c", + "Next": "if(true)", "Result": "a", "ResultPath": "$.heap13", "Type": "Pass", }, - "true__if(input.t) 1": { - "InputPath": "$.fnl_context.null", - "Next": "return {true: if(input.t), false: if(input.f), constantTrue: if(true), cons", - "ResultPath": "$.heap10", - "Type": "Pass", - }, "true__if(true)": { - "Next": "5__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c", + "Next": "if(false)", "Result": "c", "ResultPath": "$.heap15", "Type": "Pass", }, "true__return {true: if(input.t), false: if(input.f), constantTrue: if(true)": { - "Next": "1__return {true: if(input.t), false: if(input.f), constantTrue: if(true), c 1", + "Next": "if(input.f) 1", "Result": "a", "ResultPath": "$.heap11", "Type": "Pass", @@ -39653,42 +33149,42 @@ exports[`throw catch finally 1`] = ` "a.$": "$.a", "fnl_context.$": "$.fnl_context", }, - "ResultPath": "$.heap40", + "ResultPath": null, "Type": "Map", }, "1__catch__try 10": { "InputPath": "$.fnl_tmp_11.0_ParsedError", - "Next": "catch(err) 4", + "Next": "sfnmapaerr.errorMessage", "ResultPath": "$.fnl_tmp_11", "Type": "Pass", }, "1__catch__try 11": { "InputPath": "$.fnl_tmp_12.0_ParsedError", - "Next": "catch(err) 5", + "Next": "arrmapaerr.errorMessage", "ResultPath": "$.fnl_tmp_12", "Type": "Pass", }, "1__catch__try 5": { "InputPath": "$.fnl_tmp_4.0_ParsedError", - "Next": "catch(err)", + "Next": "aerr.errorMessage", "ResultPath": "$.fnl_tmp_4", "Type": "Pass", }, "1__catch__try 6": { "InputPath": "$.fnl_tmp_5.0_ParsedError", - "Next": "catch(err) 1", + "Next": "foraerr.errorMessage", "ResultPath": "$.fnl_tmp_5", "Type": "Pass", }, "1__catch__try 8": { "InputPath": "$.fnl_tmp_9.0_ParsedError", - "Next": "catch(err) 2", + "Next": "whileaerr.errorMessage", "ResultPath": "$.fnl_tmp_9", "Type": "Pass", }, "1__catch__try 9": { "InputPath": "$.fnl_tmp_10.0_ParsedError", - "Next": "catch(err) 3", + "Next": "doaerr.errorMessage", "ResultPath": "$.fnl_tmp_10", "Type": "Pass", }, @@ -39696,7 +33192,7 @@ exports[`throw catch finally 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "throw__1__finally", + "Next": "recatchaerr.message", "Variable": "$.fnl_tmp_8", }, { @@ -39722,7 +33218,9 @@ exports[`throw catch finally 1`] = ` "1__try 11": { "Next": "check__1__try 11", "Parameters": { - "arr.$": "$.heap44", + "arr": [ + 1, + ], "arrStr": "[null", }, "ResultPath": "$.heap45", @@ -39758,60 +33256,30 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "_": { - "InputPath": "$.heap21[0].index", - "Next": "assignValue___", - "ResultPath": "$._", - "Type": "Pass", - }, "a = """: { "Next": "try", "Result": "", "ResultPath": "$.a", "Type": "Pass", }, - "a = aerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage", - "ResultPath": "$.heap17", - "Type": "Pass", - }, "a = aerr.errorMessage 1": { "InputPath": "$.heap19.string", "Next": "try 6", "ResultPath": "$.a", "Type": "Pass", }, - "a = aerr.message": { - "InputPath": "$.a", - "Next": "err.message", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "a = aerr.message 1": { "InputPath": "$.heap4.string", "Next": "try 2", "ResultPath": "$.a", "Type": "Pass", }, - "a = arrmapaerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage 5", - "ResultPath": "$.heap47", - "Type": "Pass", - }, "a = arrmapaerr.errorMessage 1": { "InputPath": "$.heap49.string", "Next": "return a", "ResultPath": "$.a", "Type": "Pass", }, - "a = doaerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage 3", - "ResultPath": "$.heap35", - "Type": "Pass", - }, "a = doaerr.errorMessage 1": { "InputPath": "$.heap37.string", "Next": "try 10", @@ -39826,7 +33294,7 @@ exports[`throw catch finally 1`] = ` }, "a = error3a": { "InputPath": "$.heap6.string", - "Next": "a = finally1a", + "Next": "finally1a", "ResultPath": "$.a", "Type": "Pass", }, @@ -39836,24 +33304,12 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = finally1a": { - "InputPath": "$.a", - "Next": "finally1a", - "ResultPath": "$.heap7", - "Type": "Pass", - }, "a = finally1a 1": { "InputPath": "$.heap8.string", - "Next": "try 3", + "Next": "seta", "ResultPath": "$.a", "Type": "Pass", }, - "a = finally2a": { - "InputPath": "$.a", - "Next": "finally2a", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "a = finally2a 1": { "InputPath": "$.heap12.string", "Next": "try 4", @@ -39866,24 +33322,12 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = foraerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage 1", - "ResultPath": "$.heap22", - "Type": "Pass", - }, "a = foraerr.errorMessage 1": { "InputPath": "$.heap24.string", "Next": "try 7", "ResultPath": "$.a", "Type": "Pass", }, - "a = recatchaerr.message": { - "InputPath": "$.a", - "Next": "err.message 1", - "ResultPath": "$.heap27", - "Type": "Pass", - }, "a = recatchaerr.message 1": { "InputPath": "$.heap29.string", "Next": "try 8", @@ -39892,28 +33336,16 @@ exports[`throw catch finally 1`] = ` }, "a = seta": { "InputPath": "$.heap10.string", - "Next": "a = finally2a", + "Next": "finally2a", "ResultPath": "$.a", "Type": "Pass", }, - "a = sfnmapaerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage 4", - "ResultPath": "$.heap41", - "Type": "Pass", - }, "a = sfnmapaerr.errorMessage 1": { "InputPath": "$.heap43.string", "Next": "try 11", "ResultPath": "$.a", "Type": "Pass", }, - "a = whileaerr.errorMessage": { - "InputPath": "$.a", - "Next": "err.errorMessage 2", - "ResultPath": "$.heap31", - "Type": "Pass", - }, "a = whileaerr.errorMessage 1": { "InputPath": "$.heap33.string", "Next": "try 9", @@ -39923,7 +33355,7 @@ exports[`throw catch finally 1`] = ` "aerr.errorMessage": { "Next": "a = aerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap17,$.heap18)", + "string.$": "States.Format('{}{}',$.a,$.fnl_tmp_4.errorMessage)", }, "ResultPath": "$.heap19", "Type": "Pass", @@ -39931,7 +33363,7 @@ exports[`throw catch finally 1`] = ` "aerr.message": { "Next": "a = aerr.message 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap2,$.heap3)", + "string.$": "States.Format('{}{}',$.a,'Error2')", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -39939,17 +33371,11 @@ exports[`throw catch finally 1`] = ` "arrmapaerr.errorMessage": { "Next": "a = arrmapaerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}arrmap{}',$.heap47,$.heap48)", + "string.$": "States.Format('{}arrmap{}',$.a,$.fnl_tmp_12.errorMessage)", }, "ResultPath": "$.heap49", "Type": "Pass", }, - "assignValue___": { - "InputPath": "$.heap21[0].item", - "Next": "await func()", - "ResultPath": "$.0___", - "Type": "Pass", - }, "await func()": { "Catch": [ { @@ -39963,7 +33389,7 @@ exports[`throw catch finally 1`] = ` "InputPath": "$.fnl_context.null", "Next": "tail__try 6", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap20", + "ResultPath": null, "Type": "Task", }, "await func() 1": { @@ -39979,7 +33405,7 @@ exports[`throw catch finally 1`] = ` "InputPath": "$.fnl_context.null", "Next": "try 8", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap30", + "ResultPath": null, "Type": "Task", }, "await func() 2": { @@ -39995,54 +33421,14 @@ exports[`throw catch finally 1`] = ` "InputPath": "$.fnl_context.null", "Next": "try 9", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap34", + "ResultPath": null, "Type": "Task", }, - "catch(err)": { - "InputPath": "$.fnl_tmp_4", - "Next": "a = aerr.errorMessage", - "ResultPath": "$.err__1", - "Type": "Pass", - }, - "catch(err) 1": { - "InputPath": "$.fnl_tmp_5", - "Next": "a = foraerr.errorMessage", - "ResultPath": "$.err__2", - "Type": "Pass", - }, - "catch(err) 2": { - "InputPath": "$.fnl_tmp_9", - "Next": "a = whileaerr.errorMessage", - "ResultPath": "$.err__4", - "Type": "Pass", - }, - "catch(err) 3": { - "InputPath": "$.fnl_tmp_10", - "Next": "a = doaerr.errorMessage", - "ResultPath": "$.err__5", - "Type": "Pass", - }, - "catch(err) 4": { - "InputPath": "$.fnl_tmp_11", - "Next": "a = sfnmapaerr.errorMessage", - "ResultPath": "$.err__6", - "Type": "Pass", - }, - "catch(err) 5": { - "InputPath": "$.fnl_tmp_12", - "Next": "a = arrmapaerr.errorMessage", - "ResultPath": "$.err__7", - "Type": "Pass", - }, - "catch__try": { - "InputPath": "$.a", - "Next": "error1a", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "catch__try 1": { - "InputPath": "$.fnl_tmp_1", - "Next": "a = aerr.message", + "Next": "aerr.message", + "Parameters": { + "message": "Error2", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -40062,18 +33448,6 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.fnl_tmp_12", "Type": "Pass", }, - "catch__try 2": { - "InputPath": "$.a", - "Next": "error3a", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "catch__try 4": { - "InputPath": "$.a", - "Next": "error4a", - "ResultPath": "$.heap14", - "Type": "Pass", - }, "catch__try 5": { "Next": "1__catch__try 5", "Parameters": { @@ -40090,14 +33464,8 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.fnl_tmp_5", "Type": "Pass", }, - "catch__try 7": { - "InputPath": "$.fnl_tmp_6", - "Next": "a = recatchaerr.message", - "ResultPath": "$.err__3", - "Type": "Pass", - }, "catch__try 7 1": { - "Next": "finally", + "Next": "finallya", "Result": { "message": "error6", }, @@ -40134,7 +33502,7 @@ exports[`throw catch finally 1`] = ` "doaerr.errorMessage": { "Next": "a = doaerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}do{}',$.heap35,$.heap36)", + "string.$": "States.Format('{}do{}',$.a,$.fnl_tmp_10.errorMessage)", }, "ResultPath": "$.heap37", "Type": "Pass", @@ -40147,58 +33515,10 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.heap45", "Type": "Pass", }, - "err.errorMessage": { - "InputPath": "$.err__1.errorMessage", - "Next": "aerr.errorMessage", - "ResultPath": "$.heap18", - "Type": "Pass", - }, - "err.errorMessage 1": { - "InputPath": "$.err__2.errorMessage", - "Next": "foraerr.errorMessage", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "err.errorMessage 2": { - "InputPath": "$.err__4.errorMessage", - "Next": "whileaerr.errorMessage", - "ResultPath": "$.heap32", - "Type": "Pass", - }, - "err.errorMessage 3": { - "InputPath": "$.err__5.errorMessage", - "Next": "doaerr.errorMessage", - "ResultPath": "$.heap36", - "Type": "Pass", - }, - "err.errorMessage 4": { - "InputPath": "$.err__6.errorMessage", - "Next": "sfnmapaerr.errorMessage", - "ResultPath": "$.heap42", - "Type": "Pass", - }, - "err.errorMessage 5": { - "InputPath": "$.err__7.errorMessage", - "Next": "arrmapaerr.errorMessage", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "err.message": { - "InputPath": "$.err.message", - "Next": "aerr.message", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "err.message 1": { - "InputPath": "$.err__3.message", - "Next": "recatchaerr.message", - "ResultPath": "$.heap28", - "Type": "Pass", - }, "error1a": { "Next": "a = error1a", "Parameters": { - "string.$": "States.Format('{}error1',$.heap0)", + "string.$": "States.Format('{}error1',$.a)", }, "ResultPath": "$.heap1", "Type": "Pass", @@ -40206,7 +33526,7 @@ exports[`throw catch finally 1`] = ` "error3a": { "Next": "a = error3a", "Parameters": { - "string.$": "States.Format('{}error3',$.heap5)", + "string.$": "States.Format('{}error3',$.a)", }, "ResultPath": "$.heap6", "Type": "Pass", @@ -40214,21 +33534,15 @@ exports[`throw catch finally 1`] = ` "error4a": { "Next": "a = error4a", "Parameters": { - "string.$": "States.Format('{}error4',$.heap14)", + "string.$": "States.Format('{}error4',$.a)", }, "ResultPath": "$.heap15", "Type": "Pass", }, - "finally": { - "InputPath": "$.a", - "Next": "finallya", - "ResultPath": "$.heap25", - "Type": "Pass", - }, "finally1a": { "Next": "a = finally1a 1", "Parameters": { - "string.$": "States.Format('{}finally1',$.heap7)", + "string.$": "States.Format('{}finally1',$.a)", }, "ResultPath": "$.heap8", "Type": "Pass", @@ -40236,7 +33550,7 @@ exports[`throw catch finally 1`] = ` "finally2a": { "Next": "a = finally2a 1", "Parameters": { - "string.$": "States.Format('{}finally2',$.heap11)", + "string.$": "States.Format('{}finally2',$.a)", }, "ResultPath": "$.heap12", "Type": "Pass", @@ -40244,7 +33558,7 @@ exports[`throw catch finally 1`] = ` "finallya": { "Next": "a = finallya", "Parameters": { - "string.$": "States.Format('{}finally',$.heap25)", + "string.$": "States.Format('{}finally',$.a)", }, "ResultPath": "$.heap26", "Type": "Pass", @@ -40252,7 +33566,7 @@ exports[`throw catch finally 1`] = ` "foraerr.errorMessage": { "Next": "a = foraerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}for{}',$.heap22,$.heap23)", + "string.$": "States.Format('{}for{}',$.a,$.fnl_tmp_5.errorMessage)", }, "ResultPath": "$.heap24", "Type": "Pass", @@ -40270,7 +33584,7 @@ exports[`throw catch finally 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "_", + "Next": "await func()", "Variable": "$.heap21[0]", }, ], @@ -40280,7 +33594,7 @@ exports[`throw catch finally 1`] = ` "recatchaerr.message": { "Next": "a = recatchaerr.message 1", "Parameters": { - "string.$": "States.Format('{}recatch{}',$.heap27,$.heap28)", + "string.$": "States.Format('{}recatch{}',$.a,$.fnl_tmp_8.message)", }, "ResultPath": "$.heap29", "Type": "Pass", @@ -40316,7 +33630,7 @@ exports[`throw catch finally 1`] = ` "seta": { "Next": "a = seta", "Parameters": { - "string.$": "States.Format('{}set',$.heap9)", + "string.$": "States.Format('{}set',$.a)", }, "ResultPath": "$.heap10", "Type": "Pass", @@ -40324,7 +33638,7 @@ exports[`throw catch finally 1`] = ` "sfnmapaerr.errorMessage": { "Next": "a = sfnmapaerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}sfnmap{}',$.heap41,$.heap42)", + "string.$": "States.Format('{}sfnmap{}',$.a,$.fnl_tmp_11.errorMessage)", }, "ResultPath": "$.heap43", "Type": "Pass", @@ -40335,14 +33649,8 @@ exports[`throw catch finally 1`] = ` "ResultPath": "$.heap21", "Type": "Pass", }, - "throw__1__finally": { - "InputPath": "$.fnl_tmp_8", - "Next": "catch__try 7", - "ResultPath": "$.fnl_tmp_6", - "Type": "Pass", - }, "try": { - "Next": "catch__try", + "Next": "error1a", "Result": { "message": "Error1", }, @@ -40374,33 +33682,27 @@ exports[`throw catch finally 1`] = ` "Type": "Pass", }, "try 2": { - "Next": "catch__try 2", + "Next": "error3a", "Result": { "message": null, }, "ResultPath": null, "Type": "Pass", }, - "try 3": { - "InputPath": "$.a", - "Next": "seta", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "try 4": { "Catch": [ { "ErrorEquals": [ "States.ALL", ], - "Next": "catch__try 4", + "Next": "error4a", "ResultPath": null, }, ], "InputPath": "$.fnl_context.null", "Next": "try 5", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap13", + "ResultPath": null, "Type": "Task", }, "try 5": { @@ -40416,7 +33718,7 @@ exports[`throw catch finally 1`] = ` "InputPath": "$.fnl_context.null", "Next": "try 6", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap16", + "ResultPath": null, "Type": "Task", }, "try 6": { @@ -40465,7 +33767,7 @@ exports[`throw catch finally 1`] = ` "whileaerr.errorMessage": { "Next": "a = whileaerr.errorMessage 1", "Parameters": { - "string.$": "States.Format('{}while{}',$.heap31,$.heap32)", + "string.$": "States.Format('{}while{}',$.a,$.fnl_tmp_9.errorMessage)", }, "ResultPath": "$.heap33", "Type": "Pass", @@ -40478,70 +33780,22 @@ exports[`typeof 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "12__return {isString: typeof input.str === "string", stringType: typeof inp": { - "InputPath": "$.heap11", - "Next": "input.num 1", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "14__return {isString: typeof input.str === "string", stringType: typeof inp": { - "InputPath": "$.heap13", - "Next": "input.obj", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "17__return {isString: typeof input.str === "string", stringType: typeof inp": { - "InputPath": "$.heap16", - "Next": "input.obj 1", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "19__return {isString: typeof input.str === "string", stringType: typeof inp": { - "InputPath": "$.heap18", - "Next": "input.arr", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "1__return {isString: typeof input.str === "string", stringType: typeof inpu": { "End": true, "Parameters": { "arrType.$": "$.heap20", - "booleanType.$": "$.heap9", - "isBool.$": "$.heap7", - "isNumber.$": "$.heap12", - "isObject.$": "$.heap17", - "isString.$": "$.heap2", - "numberType.$": "$.heap14", - "objectType.$": "$.heap19", - "stringType.$": "$.heap4", + "booleanType.$": "$.heap8", + "isBool.$": "$.heap6", + "isNumber.$": "$.heap11", + "isObject.$": "$.heap16", + "isString.$": "$.heap1", + "numberType.$": "$.heap13", + "objectType.$": "$.heap18", + "stringType.$": "$.heap3", }, "ResultPath": "$", "Type": "Pass", }, - "2__return {isString: typeof input.str === "string", stringType: typeof inpu": { - "InputPath": "$.heap1", - "Next": "input.str", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "4__return {isString: typeof input.str === "string", stringType: typeof inpu": { - "InputPath": "$.heap3", - "Next": "input.bool", - "ResultPath": "$.heap4", - "Type": "Pass", - }, - "7__return {isString: typeof input.str === "string", stringType: typeof inpu": { - "InputPath": "$.heap6", - "Next": "input.bool 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "9__return {isString: typeof input.str === "string", stringType: typeof inpu": { - "InputPath": "$.heap8", - "Next": "input.num", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "return {isString: typeof input.str === "string", stringType: typeof input.s", "Parameters": { @@ -40566,7 +33820,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "boolean__input.bool 1": { - "Next": "9__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.num", "Result": "boolean", "ResultPath": "$.heap8", "Type": "Pass", @@ -40578,7 +33832,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "boolean__input.num 1": { - "Next": "14__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj", "Result": "boolean", "ResultPath": "$.heap13", "Type": "Pass", @@ -40590,13 +33844,13 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "boolean__input.obj 1": { - "Next": "19__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.arr", "Result": "boolean", "ResultPath": "$.heap18", "Type": "Pass", }, "boolean__input.str": { - "Next": "4__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool", "Result": "boolean", "ResultPath": "$.heap3", "Type": "Pass", @@ -40608,25 +33862,25 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "false__typeof input.bool === "boolean"": { - "Next": "7__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool 1", "Result": false, "ResultPath": "$.heap6", "Type": "Pass", }, "false__typeof input.num === "number"": { - "Next": "12__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.num 1", "Result": false, "ResultPath": "$.heap11", "Type": "Pass", }, "false__typeof input.obj === "object"": { - "Next": "17__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj 1", "Result": false, "ResultPath": "$.heap16", "Type": "Pass", }, "false__typeof input.str === "string"": { - "Next": "2__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.str", "Result": false, "ResultPath": "$.heap1", "Type": "Pass", @@ -41044,7 +34298,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "number__input.bool 1": { - "Next": "9__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.num", "Result": "number", "ResultPath": "$.heap8", "Type": "Pass", @@ -41056,7 +34310,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "number__input.num 1": { - "Next": "14__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj", "Result": "number", "ResultPath": "$.heap13", "Type": "Pass", @@ -41068,13 +34322,13 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "number__input.obj 1": { - "Next": "19__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.arr", "Result": "number", "ResultPath": "$.heap18", "Type": "Pass", }, "number__input.str": { - "Next": "4__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool", "Result": "number", "ResultPath": "$.heap3", "Type": "Pass", @@ -41098,7 +34352,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "object__input.bool 1": { - "Next": "9__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.num", "Result": "object", "ResultPath": "$.heap8", "Type": "Pass", @@ -41110,7 +34364,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "object__input.num 1": { - "Next": "14__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj", "Result": "object", "ResultPath": "$.heap13", "Type": "Pass", @@ -41122,13 +34376,13 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "object__input.obj 1": { - "Next": "19__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.arr", "Result": "object", "ResultPath": "$.heap18", "Type": "Pass", }, "object__input.str": { - "Next": "4__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool", "Result": "object", "ResultPath": "$.heap3", "Type": "Pass", @@ -41202,7 +34456,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "string__input.bool 1": { - "Next": "9__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.num", "Result": "string", "ResultPath": "$.heap8", "Type": "Pass", @@ -41214,7 +34468,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "string__input.num 1": { - "Next": "14__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj", "Result": "string", "ResultPath": "$.heap13", "Type": "Pass", @@ -41226,13 +34480,13 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "string__input.obj 1": { - "Next": "19__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.arr", "Result": "string", "ResultPath": "$.heap18", "Type": "Pass", }, "string__input.str": { - "Next": "4__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool", "Result": "string", "ResultPath": "$.heap3", "Type": "Pass", @@ -41244,25 +34498,25 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "true__typeof input.bool === "boolean"": { - "Next": "7__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool 1", "Result": true, "ResultPath": "$.heap6", "Type": "Pass", }, "true__typeof input.num === "number"": { - "Next": "12__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.num 1", "Result": true, "ResultPath": "$.heap11", "Type": "Pass", }, "true__typeof input.obj === "object"": { - "Next": "17__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj 1", "Result": true, "ResultPath": "$.heap16", "Type": "Pass", }, "true__typeof input.str === "string"": { - "Next": "2__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.str", "Result": true, "ResultPath": "$.heap1", "Type": "Pass", @@ -41420,7 +34674,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "undefined__input.bool 1": { - "Next": "9__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.num", "Result": "undefined", "ResultPath": "$.heap8", "Type": "Pass", @@ -41432,7 +34686,7 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "undefined__input.num 1": { - "Next": "14__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.obj", "Result": "undefined", "ResultPath": "$.heap13", "Type": "Pass", @@ -41444,13 +34698,13 @@ exports[`typeof 1`] = ` "Type": "Pass", }, "undefined__input.obj 1": { - "Next": "19__return {isString: typeof input.str === "string", stringType: typeof inp", + "Next": "input.arr", "Result": "undefined", "ResultPath": "$.heap18", "Type": "Pass", }, "undefined__input.str": { - "Next": "4__return {isString: typeof input.str === "string", stringType: typeof inpu", + "Next": "input.bool", "Result": "undefined", "ResultPath": "$.heap3", "Type": "Pass", diff --git a/test/__snapshots__/step-function.test.ts.snap b/test/__snapshots__/step-function.test.ts.snap index bdc6b76e..71bf58f9 100644 --- a/test/__snapshots__/step-function.test.ts.snap +++ b/test/__snapshots__/step-function.test.ts.snap @@ -41,7 +41,7 @@ exports[`$SFN.forEach(list, (item) => task(item)) 1`] = ` "input.$": "$.input", "item.$": "$$.Map.Item.Value", }, - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Map", }, "return null": { @@ -54,6 +54,76 @@ exports[`$SFN.forEach(list, (item) => task(item)) 1`] = ` } `; +exports[`$SFN.map([1, 2, 3], (item) => naitem) 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "$SFN.map([1, 2, 3], function (item))": { + "ItemsPath": "$.heap3", + "Iterator": { + "StartAt": "return naitem", + "States": { + "1__return naitem": { + "End": true, + "InputPath": "$.heap2.string", + "ResultPath": "$", + "Type": "Pass", + }, + "naitem": { + "Next": "1__return naitem", + "Parameters": { + "string.$": "States.Format('n{}{}',$.a,$.item)", + }, + "ResultPath": "$.heap2", + "Type": "Pass", + }, + "return naitem": { + "InputPath": "$.a", + "Next": "naitem", + "ResultPath": null, + "Type": "Pass", + }, + }, + }, + "Next": "1__return $SFN.map([1, 2, 3], function (item))", + "Parameters": { + "a": "a", + "fnl_context.$": "$.fnl_context", + "item.$": "$$.Map.Item.Value", + }, + "ResultPath": "$.heap4", + "Type": "Map", + }, + "1__return $SFN.map([1, 2, 3], function (item))": { + "End": true, + "InputPath": "$.heap4", + "ResultPath": "$", + "Type": "Pass", + }, + "Initialize Functionless Context": { + "Next": "return $SFN.map([1, 2, 3], function (item))", + "Parameters": { + "fnl_context": { + "null": null, + }, + }, + "ResultPath": "$", + "Type": "Pass", + }, + "return $SFN.map([1, 2, 3], function (item))": { + "Next": "$SFN.map([1, 2, 3], function (item))", + "Result": [ + 1, + 2, + 3, + ], + "ResultPath": "$.heap3", + "Type": "Pass", + }, + }, +} +`; + exports[`$SFN.map([1, 2, 3], (item) => nitem) 1`] = ` { "StartAt": "Initialize Functionless Context", @@ -72,7 +142,7 @@ exports[`$SFN.map([1, 2, 3], (item) => nitem) 1`] = ` "nitem": { "Next": "1__return nitem", "Parameters": { - "string.$": "States.Format('n{}',$.heap0)", + "string.$": "States.Format('n{}',$.item)", }, "ResultPath": "$.heap1", "Type": "Pass", @@ -80,7 +150,7 @@ exports[`$SFN.map([1, 2, 3], (item) => nitem) 1`] = ` "return nitem": { "InputPath": "$.item", "Next": "nitem", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Pass", }, }, @@ -164,7 +234,7 @@ exports[`$SFN.map(list, (item) => task(item)) 1`] = ` "input.$": "$.input", "item.$": "$$.Map.Item.Value", }, - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Map", }, "return null": { @@ -516,12 +586,6 @@ exports[`[1,2,3,4].filter((item, index, array) => item > 1 + 2) 1`] = ` }, "Type": "Map", }, - "_": { - "InputPath": "$.heap1.arr[0].index", - "Next": "arr", - "ResultPath": "$._", - "Type": "Pass", - }, "arr": { "InputPath": "$.heap0", "Next": "return item > arr[0]", @@ -555,7 +619,7 @@ exports[`[1,2,3,4].filter((item, index, array) => item > 1 + 2) 1`] = ` }, "function (item,_,arr)": { "InputPath": "$.heap1.arr[0].item", - "Next": "_", + "Next": "arr", "ResultPath": "$.item", "Type": "Pass", }, @@ -811,12 +875,6 @@ exports[`[1,2,3,4].filter((item, index, array) => item > 1 + 2) 2`] = ` }, "Type": "Map", }, - "_": { - "InputPath": "$.heap1.arr[0].index", - "Next": "first", - "ResultPath": "$._", - "Type": "Pass", - }, "check__[1, 2, 3, 4].filter(function (item,_,[ first ]))": { "Choices": [ { @@ -850,7 +908,7 @@ exports[`[1,2,3,4].filter((item, index, array) => item > 1 + 2) 2`] = ` }, "function (item,_,[ first ])": { "InputPath": "$.heap1.arr[0].item", - "Next": "_", + "Next": "first", "ResultPath": "$.item", "Type": "Pass", }, @@ -1085,7 +1143,9 @@ exports[`[1,2,3,4].filter(item => item > {}) 1`] = ` "[{}].filter(function (item))": { "Next": "check__[{}].filter(function (item))", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + {}, + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -1318,7 +1378,11 @@ exports[`[1,2,3,4].filter(item => item > {}) 2`] = ` "[{value: "a"}].filter(function (item))": { "Next": "check__[{value: "a"}].filter(function (item))", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + { + "value": "a", + }, + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -1334,7 +1398,7 @@ exports[`[1,2,3,4].filter(item => item > {}) 2`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "a = "a"", "Variable": "$.heap1.arr[0]", }, ], @@ -1456,12 +1520,6 @@ exports[`[1,2,3,4].filter(item => item > {}) 2`] = ` "Default": "tail__[{value: "a"}].filter(function (item))", "Type": "Choice", }, - "item": { - "InputPath": "$.heap1.arr[0]", - "Next": "a = "a"", - "ResultPath": "$.item", - "Type": "Pass", - }, "predicateTrue__handleResult__[{value: "a"}].filter(function (item))": { "Next": "check__[{value: "a"}].filter(function (item))", "Parameters": { @@ -1603,7 +1661,7 @@ exports[`[1,2,3,4].filter(item => item > {}) 2`] = ` "Type": "Pass", }, "{ value } = item": { - "InputPath": "$.item['value']", + "InputPath": "$.heap1.arr[0].value", "Next": "return value === a", "ResultPath": "$.value", "Type": "Pass", @@ -1682,6 +1740,84 @@ exports[`[1,2,3,4].filter(item => item > 2) 1`] = ` } `; +exports[`[1,2,3,4].filter(item => item > 2) assign 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "Initialize Functionless Context": { + "Next": "a = [1, 2, 3, 4].filter(function (item))", + "Parameters": { + "fnl_context": { + "null": null, + }, + }, + "ResultPath": "$", + "Type": "Pass", + }, + "a": { + "InputPath": "$.heap0[?(@>2)]", + "Next": "return a", + "ResultPath": "$.a", + "Type": "Pass", + }, + "a = [1, 2, 3, 4].filter(function (item))": { + "Next": "a", + "Result": [ + 1, + 2, + 3, + 4, + ], + "ResultPath": "$.heap0", + "Type": "Pass", + }, + "return a": { + "End": true, + "InputPath": "$.a", + "ResultPath": "$", + "Type": "Pass", + }, + }, +} +`; + +exports[`[1,2,3,4].filter(item => item > 2) assign obj 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "1__return {a: [1, 2, 3, 4].filter(function (item))}": { + "End": true, + "Parameters": { + "a.$": "$.heap0[?(@>2)]", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "Initialize Functionless Context": { + "Next": "return {a: [1, 2, 3, 4].filter(function (item))}", + "Parameters": { + "fnl_context": { + "null": null, + }, + }, + "ResultPath": "$", + "Type": "Pass", + }, + "return {a: [1, 2, 3, 4].filter(function (item))}": { + "Next": "1__return {a: [1, 2, 3, 4].filter(function (item))}", + "Result": [ + 1, + 2, + 3, + 4, + ], + "ResultPath": "$.heap0", + "Type": "Pass", + }, + }, +} +`; + exports[`[1,2,3].map(item => item) 1`] = ` { "StartAt": "Initialize Functionless Context", @@ -1695,7 +1831,11 @@ exports[`[1,2,3].map(item => item) 1`] = ` "1__return [1, 2, 3].map(function (item)) 1": { "Next": "check__1__return [1, 2, 3].map(function (item)) 1", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + 1, + 2, + 3, + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -1715,7 +1855,7 @@ exports[`[1,2,3].map(item => item) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return item", "Variable": "$.heap1.arr[0]", }, ], @@ -1739,12 +1879,6 @@ exports[`[1,2,3].map(item => item) 1`] = ` "ResultPath": "$.heap1", "Type": "Pass", }, - "item": { - "InputPath": "$.heap1.arr[0]", - "Next": "return item", - "ResultPath": "$.item", - "Type": "Pass", - }, "return [1, 2, 3].map(function (item))": { "Next": "1__return [1, 2, 3].map(function (item)) 1", "Result": [ @@ -1756,7 +1890,7 @@ exports[`[1,2,3].map(item => item) 1`] = ` "Type": "Pass", }, "return item": { - "InputPath": "$.item", + "InputPath": "$.heap1.arr[0]", "Next": "handleResult__1__return [1, 2, 3].map(function (item)) 1", "ResultPath": "$.heap1.arr[0]", "Type": "Pass", @@ -1792,15 +1926,9 @@ exports[`\`template me \${await task(input.value)}\` 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "await task(input.value)": { - "InputPath": "$.heap0", - "Next": "template me await task(input.value)", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "return template me await task(input.value)": { "InputPath": "$.input.value", - "Next": "await task(input.value)", + "Next": "template me await task(input.value)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", @@ -1808,7 +1936,7 @@ exports[`\`template me \${await task(input.value)}\` 1`] = ` "template me await task(input.value)": { "Next": "1__return template me await task(input.value)", "Parameters": { - "string.$": "States.Format('template me {}',$.heap1)", + "string.$": "States.Format('template me {}',$.heap0)", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -1828,7 +1956,7 @@ exports[`\`template me \${input.value}\` 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "return template me input.value", + "Next": "template me input.value", "Parameters": { "fnl_context": { "null": null, @@ -1838,16 +1966,10 @@ exports[`\`template me \${input.value}\` 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return template me input.value": { - "InputPath": "$.input.value", - "Next": "template me input.value", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "template me input.value": { "Next": "1__return template me input.value", "Parameters": { - "string.$": "States.Format('template me {}',$.heap0)", + "string.$": "States.Format('template me {}',$.input.value)", }, "ResultPath": "$.heap1", "Type": "Pass", @@ -2189,7 +2311,7 @@ exports[`add iamConditions AWS.SDK.CloudWatch.describeAlarms 1`] = ` "fnRole50A611CF", ], "Properties": { - "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0['MetricAlarms']"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.MetricAlarms"}}}", + "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0.MetricAlarms"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.heap0.MetricAlarms"}}}", "RoleArn": { "Fn::GetAtt": [ "fnRole50A611CF", @@ -2315,7 +2437,7 @@ exports[`await Promise.all(input.list.map((item) => task(item)))).filter 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -2339,12 +2461,6 @@ exports[`await Promise.all(input.list.map((item) => task(item)))).filter 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return await Promise.all(input.list.map(function (item))).filter(function (": { "Next": "check__return await Promise.all(input.list.map(function (item))).filter(fun", "Parameters": { @@ -2355,7 +2471,7 @@ exports[`await Promise.all(input.list.map((item) => task(item)))).filter 1`] = ` "Type": "Pass", }, "return task(item)": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -2392,7 +2508,7 @@ exports[`binding catch 1`] = ` "Type": "Pass", }, "catch({ message })": { - "InputPath": "$.fnl_tmp_0['message']", + "InputPath": "$.fnl_tmp_0.message", "Next": "return message", "ResultPath": "$.message", "Type": "Pass", @@ -2413,7 +2529,7 @@ exports[`binding catch 1`] = ` }, "return message": { "End": true, - "InputPath": "$.message", + "InputPath": "$.fnl_tmp_0.message", "ResultPath": "$", "Type": "Pass", }, @@ -2433,7 +2549,7 @@ exports[`binding catch 1`] = ` "name": "name", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, }, @@ -2469,29 +2585,17 @@ exports[`binding for 1`] = ` "keyvalue": { "Next": "1__return keyvalue", "Parameters": { - "string.$": "States.Format('{}{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}{}','x','y')", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return keyvalue": { - "InputPath": "$.key", - "Next": "value 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "value": { - "Next": "return keyvalue", + "Next": "keyvalue", "Result": "y", "ResultPath": "$.value", "Type": "Pass", }, - "value 1": { - "InputPath": "$.value", - "Next": "keyvalue", - "ResultPath": "$.heap1", - "Type": "Pass", - }, }, } `; @@ -2511,24 +2615,12 @@ exports[`binding forOf 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a": { - "InputPath": "$.a", - "Next": "keyvaluea", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "a = """: { "Next": "for({ key, value } of input.value)", "Result": "", "ResultPath": "$.a", "Type": "Pass", }, - "a = keyvaluea": { - "InputPath": "$.key", - "Next": "value 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = keyvaluea 1": { "InputPath": "$.heap3.string", "Next": "tail__for({ key, value } of input.value)", @@ -2545,7 +2637,7 @@ exports[`binding forOf 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "{ key, value }", + "Next": "keyvaluea", "Variable": "$.heap4[0]", }, ], @@ -2555,7 +2647,7 @@ exports[`binding forOf 1`] = ` "keyvaluea": { "Next": "a = keyvaluea 1", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap0,$.heap1,$.heap2)", + "string.$": "States.Format('{}{}{}',$.heap4[0].key,$.heap4[0].value,$.a)", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -2572,24 +2664,6 @@ exports[`binding forOf 1`] = ` "ResultPath": "$.heap4", "Type": "Pass", }, - "value": { - "InputPath": "$.heap4[0]['value']", - "Next": "a = keyvaluea", - "ResultPath": "$.value", - "Type": "Pass", - }, - "value 1": { - "InputPath": "$.value", - "Next": "a", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "{ key, value }": { - "InputPath": "$.heap4[0]['key']", - "Next": "value", - "ResultPath": "$.key", - "Type": "Pass", - }, }, } `; @@ -2609,60 +2683,24 @@ exports[`binding forOf weird values 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a": { - "InputPath": "$.a", - "Next": "vala", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "a 1": { - "InputPath": "$.a", - "Next": "vala 1", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "a 2": { - "InputPath": "$.a", - "Next": "vala 2", - "ResultPath": "$.heap11", - "Type": "Pass", - }, "a = """: { "Next": "for(val of input.value ?? [1, 2, 3])", "Result": "", "ResultPath": "$.a", "Type": "Pass", }, - "a = vala": { - "InputPath": "$.val", - "Next": "a", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "a = vala 1": { "InputPath": "$.heap3.string", "Next": "tail__for(val of input.value ?? [1, 2, 3]) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = vala 2": { - "InputPath": "$.val__1", - "Next": "a 1", - "ResultPath": "$.heap6", - "Type": "Pass", - }, "a = vala 3": { "InputPath": "$.heap8.string", "Next": "tail__for(val of input.value || [1, 2, 3]) 1", "ResultPath": "$.a", "Type": "Pass", }, - "a = vala 4": { - "InputPath": "$.val__2", - "Next": "a 2", - "ResultPath": "$.heap10", - "Type": "Pass", - }, "a = vala 5": { "InputPath": "$.heap12.string", "Next": "tail__for(val of a = "b" , true && [1, 2, 3]) 1", @@ -2730,30 +2768,8 @@ exports[`binding forOf weird values 1`] = ` "ResultPath": "$.heap4", "Type": "Pass", }, - "for(val of input.value || [1, 2, 3]) 1": { - "InputPath": "$.heap5", - "Next": "hasNext__for(val of input.value || [1, 2, 3]) 1", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "hasNext__for(val of a = "b" , true && [1, 2, 3]) 1": { + "for(val of input.value || [1, 2, 3])": { "Choices": [ - { - "IsPresent": true, - "Next": "val 2", - "Variable": "$.heap13[0]", - }, - ], - "Default": "return a", - "Type": "Choice", - }, - "hasNext__for(val of input.value ?? [1, 2, 3]) 1": { - "Choices": [ - { - "IsPresent": true, - "Next": "val", - "Variable": "$.heap4[0]", - }, { "And": [ { @@ -2853,11 +2869,39 @@ exports[`binding forOf weird values 1`] = ` "Default": "false__for(val of input.value || [1, 2, 3])", "Type": "Choice", }, + "for(val of input.value || [1, 2, 3]) 1": { + "InputPath": "$.heap5", + "Next": "hasNext__for(val of input.value || [1, 2, 3]) 1", + "ResultPath": "$.heap9", + "Type": "Pass", + }, + "hasNext__for(val of a = "b" , true && [1, 2, 3]) 1": { + "Choices": [ + { + "IsPresent": true, + "Next": "vala 2", + "Variable": "$.heap13[0]", + }, + ], + "Default": "return a", + "Type": "Choice", + }, + "hasNext__for(val of input.value ?? [1, 2, 3]) 1": { + "Choices": [ + { + "IsPresent": true, + "Next": "vala", + "Variable": "$.heap4[0]", + }, + ], + "Default": "for(val of input.value || [1, 2, 3])", + "Type": "Choice", + }, "hasNext__for(val of input.value || [1, 2, 3]) 1": { "Choices": [ { "IsPresent": true, - "Next": "val 1", + "Next": "vala 1", "Variable": "$.heap9[0]", }, ], @@ -2900,28 +2944,10 @@ exports[`binding forOf weird values 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "val": { - "InputPath": "$.heap4[0]", - "Next": "a = vala", - "ResultPath": "$.val", - "Type": "Pass", - }, - "val 1": { - "InputPath": "$.heap9[0]", - "Next": "a = vala 2", - "ResultPath": "$.val__1", - "Type": "Pass", - }, - "val 2": { - "InputPath": "$.heap13[0]", - "Next": "a = vala 4", - "ResultPath": "$.val__2", - "Type": "Pass", - }, "vala": { "Next": "a = vala 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}{}',$.heap4[0],$.a)", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -2929,7 +2955,7 @@ exports[`binding forOf weird values 1`] = ` "vala 1": { "Next": "a = vala 3", "Parameters": { - "string.$": "States.Format('{}{}',$.heap6,$.heap7)", + "string.$": "States.Format('{}{}',$.heap9[0],$.a)", }, "ResultPath": "$.heap8", "Type": "Pass", @@ -2937,7 +2963,7 @@ exports[`binding forOf weird values 1`] = ` "vala 2": { "Next": "a = vala 5", "Parameters": { - "string.$": "States.Format('{}{}',$.heap10,$.heap11)", + "string.$": "States.Format('{}{}',$.heap13[0],$.a)", }, "ResultPath": "$.heap12", "Type": "Pass", @@ -2975,33 +3001,15 @@ exports[`binding functions $SFN.forEach 1`] = ` "bc": { "Next": "1__return bc", "Parameters": { - "string.$": "States.Format('{}{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}{}',$.heap3.value,$.heap3.arr[0])", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "c": { - "InputPath": "$.heap3['arr'][0]", - "Next": "return bc", - "ResultPath": "$.c", - "Type": "Pass", - }, - "c 1": { - "InputPath": "$.c", - "Next": "bc", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "function ({ value: b, arr: [ c ] })": { - "InputPath": "$.heap3['value']", - "Next": "c", - "ResultPath": "$.b", - "Type": "Pass", - }, - "return bc": { - "InputPath": "$.b", - "Next": "c 1", - "ResultPath": "$.heap0", + "InputPath": "$.heap3.value", + "Next": "bc", + "ResultPath": null, "Type": "Pass", }, }, @@ -3012,7 +3020,7 @@ exports[`binding functions $SFN.forEach 1`] = ` "heap3.$": "$$.Map.Item.Value", "input.$": "$.input", }, - "ResultPath": "$.heap4", + "ResultPath": null, "Type": "Map", }, "return "success"": { @@ -3158,33 +3166,15 @@ exports[`binding functions $SFN.map 1`] = ` "bc": { "Next": "1__return bc", "Parameters": { - "string.$": "States.Format('{}{}',$.heap0,$.heap1)", + "string.$": "States.Format('{}{}',$.heap3.value,$.heap3.arr[0])", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "c": { - "InputPath": "$.heap3['arr'][0]", - "Next": "return bc", - "ResultPath": "$.c", - "Type": "Pass", - }, - "c 1": { - "InputPath": "$.c", - "Next": "bc", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "function ({ value: b, arr: [ c ] })": { - "InputPath": "$.heap3['value']", - "Next": "c", - "ResultPath": "$.b", - "Type": "Pass", - }, - "return bc": { - "InputPath": "$.b", - "Next": "c 1", - "ResultPath": "$.heap0", + "InputPath": "$.heap3.value", + "Next": "bc", + "ResultPath": null, "Type": "Pass", }, }, @@ -3231,7 +3221,7 @@ exports[`binding functions filter 1`] = ` }, "return input.value.filter(function ({ value: b, arr: [ c ] }))": { "End": true, - "InputPath": "$.input.value[?(@['value']==@['arr'][0])]", + "InputPath": "$.input.value[?(@.value==@.arr[0])]", "ResultPath": "$", "Type": "Pass", }, @@ -3263,28 +3253,16 @@ exports[`binding functions forEach 1`] = ` "bc": { "Next": "1__return bc", "Parameters": { - "string.$": "States.Format('{}{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}{}',$.heap0.arr[0].value,$.heap0.arr[0].arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "c": { - "InputPath": "$.heap0.arr[0]['arr'][0]", - "Next": "return bc", - "ResultPath": "$.c", - "Type": "Pass", - }, - "c 1": { - "InputPath": "$.c", - "Next": "bc", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "check__input.value.forEach(function ({ value: b, arr: [ c ] }))": { "Choices": [ { "IsPresent": true, - "Next": "{ value: b, arr: [ c ] }", + "Next": "bc", "Variable": "$.heap0.arr[0]", }, ], @@ -3311,24 +3289,12 @@ exports[`binding functions forEach 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return bc": { - "InputPath": "$.b", - "Next": "c 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "tail__input.value.forEach(function ({ value: b, arr: [ c ] }))": { "InputPath": "$.heap0.arr[1:]", "Next": "check__input.value.forEach(function ({ value: b, arr: [ c ] }))", "ResultPath": "$.heap0.arr", "Type": "Pass", }, - "{ value: b, arr: [ c ] }": { - "InputPath": "$.heap0.arr[0]['value']", - "Next": "c", - "ResultPath": "$.b", - "Type": "Pass", - }, }, } `; @@ -3416,28 +3382,16 @@ exports[`binding functions map 1`] = ` "bc": { "Next": "1__return bc", "Parameters": { - "string.$": "States.Format('{}{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}{}',$.heap0.arr[0].value,$.heap0.arr[0].arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "c": { - "InputPath": "$.heap0.arr[0]['arr'][0]", - "Next": "return bc", - "ResultPath": "$.c", - "Type": "Pass", - }, - "c 1": { - "InputPath": "$.c", - "Next": "bc", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "check__return input.value.map(function ({ value: b, arr: [ c ] })).join()": { "Choices": [ { "IsPresent": true, - "Next": "{ value: b, arr: [ c ] }", + "Next": "bc", "Variable": "$.heap0.arr[0]", }, ], @@ -3506,12 +3460,6 @@ exports[`binding functions map 1`] = ` "ResultPath": "$.heap5.string", "Type": "Pass", }, - "return bc": { - "InputPath": "$.b", - "Next": "c 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "return input.value.map(function ({ value: b, arr: [ c ] })).join()": { "Next": "check__return input.value.map(function ({ value: b, arr: [ c ] })).join()", "Parameters": { @@ -3539,12 +3487,6 @@ exports[`binding functions map 1`] = ` "ResultPath": "$.heap4", "Type": "Pass", }, - "{ value: b, arr: [ c ] }": { - "InputPath": "$.heap0.arr[0]['value']", - "Next": "c", - "ResultPath": "$.b", - "Type": "Pass", - }, }, } `; @@ -3607,7 +3549,11 @@ exports[`binding functions use in map 1`] = ` "1__return [1, 2, 3].map(function ()).join() 2": { "Next": "check__1__return [1, 2, 3].map(function ()).join() 2", "Parameters": { - "arr.$": "$.heap0", + "arr": [ + 1, + 2, + 3, + ], "arrStr": "[null", }, "ResultPath": "$.heap1", @@ -3620,7 +3566,7 @@ exports[`binding functions use in map 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "{ value, obj }", + "Next": "return [1, 2, 3].map(function ()).join()", "Parameters": { "fnl_context": { "null": null, @@ -3641,7 +3587,7 @@ exports[`binding functions use in map 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "return valuev", + "Next": "valuev", "Variable": "$.heap1.arr[0]", }, ], @@ -3710,12 +3656,6 @@ exports[`binding functions use in map 1`] = ` "ResultPath": "$.heap6.string", "Type": "Pass", }, - "obj": { - "InputPath": "$$.Execution.Input['obj']", - "Next": "{ value: v } = obj", - "ResultPath": "$.obj", - "Type": "Pass", - }, "return [1, 2, 3].map(function ()).join()": { "Next": "1__return [1, 2, 3].map(function ()).join() 2", "Result": [ @@ -3726,12 +3666,6 @@ exports[`binding functions use in map 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "return valuev": { - "InputPath": "$.value", - "Next": "v", - "ResultPath": "$.heap2", - "Type": "Pass", - }, "returnEmpty__1__return [1, 2, 3].map(function ()).join() 1": { "Next": "1__return [1, 2, 3].map(function ()).join()", "Result": "", @@ -3750,32 +3684,14 @@ exports[`binding functions use in map 1`] = ` "ResultPath": "$.heap5", "Type": "Pass", }, - "v": { - "InputPath": "$.v", - "Next": "valuev", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "valuev": { "Next": "1__return valuev", "Parameters": { - "string.$": "States.Format('{}{}',$.heap2,$.heap3)", + "string.$": "States.Format('{}{}',$$.Execution.Input.value,$$.Execution.Input.obj.value)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "{ value, obj }": { - "InputPath": "$$.Execution.Input['value']", - "Next": "obj", - "ResultPath": "$.value", - "Type": "Pass", - }, - "{ value: v } = obj": { - "InputPath": "$.obj['value']", - "Next": "return [1, 2, 3].map(function ()).join()", - "ResultPath": "$.v", - "Type": "Pass", - }, }, } `; @@ -3795,14 +3711,14 @@ exports[`binding prop array 1`] = ` "Type": "Pass", }, "b": { - "InputPath": "$$.Execution.Input['arr'][0]", + "InputPath": "$$.Execution.Input.arr[0]", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$$.Execution.Input.arr[0]", "ResultPath": "$", "Type": "Pass", }, @@ -3825,7 +3741,7 @@ exports[`binding prop array rest 1`] = ` "Type": "Pass", }, "b": { - "InputPath": "$$.Execution.Input['arr'][1:]", + "InputPath": "$$.Execution.Input.arr[1:]", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", @@ -3856,12 +3772,12 @@ exports[`binding prop binding 1`] = ` }, "return value": { "End": true, - "InputPath": "$.value", + "InputPath": "$$.Execution.Input.value", "ResultPath": "$", "Type": "Pass", }, "value": { - "InputPath": "$$.Execution.Input['value']", + "InputPath": "$$.Execution.Input.value", "Next": "return value", "ResultPath": "$.value", "Type": "Pass", @@ -3885,14 +3801,14 @@ exports[`binding prop nested 1`] = ` "Type": "Pass", }, "b": { - "InputPath": "$$.Execution.Input['value']['b']", + "InputPath": "$$.Execution.Input.value.b", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$$.Execution.Input.value.b", "ResultPath": "$", "Type": "Pass", }, @@ -3915,14 +3831,14 @@ exports[`binding prop rename 1`] = ` "Type": "Pass", }, "b": { - "InputPath": "$$.Execution.Input['value']", + "InputPath": "$$.Execution.Input.value", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$$.Execution.Input.value", "ResultPath": "$", "Type": "Pass", }, @@ -3952,7 +3868,7 @@ exports[`binding prop with default 1`] = ` }, "return value": { "End": true, - "InputPath": "$.value", + "InputPath": "$.heap0", "ResultPath": "$", "Type": "Pass", }, @@ -3967,14 +3883,14 @@ exports[`binding prop with default 1`] = ` { "IsPresent": true, "Next": "value__value = "b"", - "Variable": "$$.Execution.Input['value']", + "Variable": "$$.Execution.Input.value", }, ], "Default": "default__value = "b"", "Type": "Choice", }, "value__value = "b"": { - "InputPath": "$$.Execution.Input['value']", + "InputPath": "$$.Execution.Input.value", "Next": "value", "ResultPath": "$.heap0", "Type": "Pass", @@ -3988,7 +3904,7 @@ exports[`binding prop with self default 1`] = ` "StartAt": "Initialize Functionless Context", "States": { "Initialize Functionless Context": { - "Next": "{ value, value2 = value }", + "Next": "value2 = value", "Parameters": { "fnl_context": { "null": null, @@ -3998,14 +3914,14 @@ exports[`binding prop with self default 1`] = ` "Type": "Pass", }, "default__value2 = value": { - "InputPath": "$.value", + "InputPath": "$$.Execution.Input.value", "Next": "value2", "ResultPath": "$.heap0", "Type": "Pass", }, "return value2": { "End": true, - "InputPath": "$.value2", + "InputPath": "$.heap0", "ResultPath": "$", "Type": "Pass", }, @@ -4020,22 +3936,104 @@ exports[`binding prop with self default 1`] = ` { "IsPresent": true, "Next": "value__value2 = value", - "Variable": "$$.Execution.Input['value2']", + "Variable": "$$.Execution.Input.value2", }, ], "Default": "default__value2 = value", "Type": "Choice", }, "value__value2 = value": { - "InputPath": "$$.Execution.Input['value2']", + "InputPath": "$$.Execution.Input.value2", "Next": "value2", "ResultPath": "$.heap0", "Type": "Pass", }, + }, +} +`; + +exports[`binding unicode variable names 1`] = ` +Object { + "StartAt": "Initialize Functionless Context", + "States": Object { + "$ = \\"$$\\"": Object { + "Next": "ƒ = {π: Math.PI, ø: [], Ø: NaN, e: 2.718281828459045, root2: 2.718281828459", + "Result": "$$", + "ResultPath": "$.$", + "Type": "Pass", + }, + "1__return {ƒ: ƒ, out: H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗": Object { + "End": true, + "Parameters": Object { + "out.$": "$.heap5.string", + "ƒ.$": "$.heap1", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙": Object { + "Next": "await task(H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍", + "Result": 42, + "ResultPath": "$.H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜", + "Type": "Pass", + }, + "H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙ 2": Object { + "Next": "1__return {ƒ: ƒ, out: H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗", + "Parameters": Object { + "string.$": "States.Format('{}{}{}',$.H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜,'___',$.$)", + }, + "ResultPath": "$.heap5", + "Type": "Pass", + }, + "Initialize Functionless Context": Object { + "Next": "H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙", + "Parameters": Object { + "fnl_context": Object { + "null": null, + }, + }, + "ResultPath": "$", + "Type": "Pass", + }, + "await task(H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍": Object { + "InputPath": "$.H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜", + "Next": "$ = \\"$$\\"", + "Resource": "__REPLACED_TOKEN", + "ResultPath": null, + "Type": "Task", + }, + "return {ƒ: ƒ, out: H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍": Object { + "InputPath": "$.ƒ", + "Next": "H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙ 2", + "ResultPath": "$.heap1", + "Type": "Pass", + }, + "ƒ = {π: Math.PI, ø: [], Ø: NaN, e: 2.718281828459045, root2: 2.718281828459": Object { + "Next": "return {ƒ: ƒ, out: H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍", + "Result": Object { + "A": 1.2824271291, + "C10": 0.12345678910111213, + "K": 2.685452001, + "c": 299792458, + "e": 2.718281828459045, + "oo": null, + "root2": 2.718281828459045, + "Ø": null, + "ø": Array [], + "α": 2.5029, + "γ": 1.30357, + "δ": 4.6692, + "ζ": 1.2020569, + "π": 3.141592653589793, + "φ": 1.61803398874, + }, + "ResultPath": "$.ƒ", +======= "{ value, value2 = value }": { "InputPath": "$$.Execution.Input['value']", "Next": "value2 = value", "ResultPath": "$.value", +>>>>>>> main "Type": "Pass", }, }, @@ -4059,12 +4057,12 @@ exports[`binding variable array 1`] = ` }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$.input.arr[0]", "ResultPath": "$", "Type": "Pass", }, "{ arr: [ b ] } = input": { - "InputPath": "$.input['arr'][0]", + "InputPath": "$.input.arr[0]", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", @@ -4090,12 +4088,12 @@ exports[`binding variable binding 1`] = ` }, "return value": { "End": true, - "InputPath": "$.value", + "InputPath": "$.input.value", "ResultPath": "$", "Type": "Pass", }, "{ value } = input": { - "InputPath": "$.input['value']", + "InputPath": "$.input.value", "Next": "return value", "ResultPath": "$.value", "Type": "Pass", @@ -4121,12 +4119,12 @@ exports[`binding variable nested 1`] = ` }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$.input.value.b", "ResultPath": "$", "Type": "Pass", }, "{ value: { b } } = input": { - "InputPath": "$.input['value']['b']", + "InputPath": "$.input.value.b", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", @@ -4152,12 +4150,12 @@ exports[`binding variable rename 1`] = ` }, "return b": { "End": true, - "InputPath": "$.b", + "InputPath": "$.input.value", "ResultPath": "$", "Type": "Pass", }, "{ value: b } = input": { - "InputPath": "$.input['value']", + "InputPath": "$.input.value", "Next": "return b", "ResultPath": "$.b", "Type": "Pass", @@ -4189,7 +4187,7 @@ exports[`binding variable with default 1`] = ` }, "return value": { "End": true, - "InputPath": "$.value", + "InputPath": "$.heap0", "ResultPath": "$", "Type": "Pass", }, @@ -4200,7 +4198,7 @@ exports[`binding variable with default 1`] = ` "Type": "Pass", }, "value__{ value = "b" } = input": { - "InputPath": "$.input['value']", + "InputPath": "$.input.value", "Next": "value", "ResultPath": "$.heap0", "Type": "Pass", @@ -4210,7 +4208,7 @@ exports[`binding variable with default 1`] = ` { "IsPresent": true, "Next": "value__{ value = "b" } = input", - "Variable": "$.input['value']", + "Variable": "$.input.value", }, ], "Default": "default__{ value = "b" } = input", @@ -4546,36 +4544,6 @@ exports[`boolean logic 1`] = ` "Default": "false__!true", "Type": "Choice", }, - "11__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.heap10", - "Next": "input.a && input.b", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "13__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.heap13", - "Next": "input.a || input.b 1", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "15__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.heap16", - "Next": "input.a || input.b && input.a", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "17__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.heap20", - "Next": "18__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", - "ResultPath": "$.heap21", - "Type": "Pass", - }, - "18__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.input.s", - "Next": "input.a && input.s", - "ResultPath": "$.heap22", - "Type": "Pass", - }, "1__input.b && input.a": { "InputPath": "$.heap18", "Next": "!input.a || input.b && input.a", @@ -4585,69 +4553,27 @@ exports[`boolean logic 1`] = ` "1__return {and: input.a && input.b, or: input.a || input.b, andCondition: i": { "End": true, "Parameters": { - "and.$": "$.heap1", + "and.$": "$.heap0", "andAllConstant": false, - "andCondition.$": "$.heap5", + "andCondition.$": "$.heap4", "andFalsyConstantString": "", - "andTruthyConstantString.$": "$.heap22", - "andVariable.$": "$.heap24", - "chain.$": "$.heap21", - "not.$": "$.heap11", - "notAnd.$": "$.heap14", - "notOr.$": "$.heap17", - "nullCondition.$": "$.heap9", - "or.$": "$.heap3", + "andTruthyConstantString.$": "$.input.s", + "andVariable.$": "$.heap23", + "chain.$": "$.heap20", + "not.$": "$.heap10", + "notAnd.$": "$.heap13", + "notOr.$": "$.heap16", + "nullCondition.$": "$.heap8", + "or.$": "$.heap2", "orAllConstant": true, - "orCondition.$": "$.heap7", - "orFalsyConstantString.$": "$.heap25", + "orCondition.$": "$.heap6", + "orFalsyConstantString.$": "$.input.s", "orTruthyConstantString": "hi", "orVariable.$": "$.heap26", }, "ResultPath": "$", "Type": "Pass", }, - "1__return {and: input.a && input.b, or: input.a || input.b, andCondition: i 1": { - "InputPath": "$.heap0", - "Next": "input.a || input.b", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "20__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.heap23", - "Next": "21__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", - "ResultPath": "$.heap24", - "Type": "Pass", - }, - "21__return {and: input.a && input.b, or: input.a || input.b, andCondition: ": { - "InputPath": "$.input.s", - "Next": "input.b || input.s", - "ResultPath": "$.heap25", - "Type": "Pass", - }, - "3__return {and: input.a && input.b, or: input.a || input.b, andCondition: i": { - "InputPath": "$.heap2", - "Next": "input.a === input.b && input.s === "hello"", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "5__return {and: input.a && input.b, or: input.a || input.b, andCondition: i": { - "InputPath": "$.heap4", - "Next": "input.a === input.b || input.s === "hello"", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "7__return {and: input.a && input.b, or: input.a || input.b, andCondition: i": { - "InputPath": "$.heap6", - "Next": "input.a === input.b ?? input.s === "hello"", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "9__return {and: input.a && input.b, or: input.a || input.b, andCondition: i": { - "InputPath": "$.heap8", - "Next": "!true", - "ResultPath": "$.heap9", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "return {and: input.a && input.b, or: input.a || input.b, andCondition: inpu", "Parameters": { @@ -4660,25 +4586,25 @@ exports[`boolean logic 1`] = ` "Type": "Pass", }, "false__!input.a && input.b": { - "Next": "13__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a || input.b 1", "Result": false, "ResultPath": "$.heap13", "Type": "Pass", }, "false__!input.a || input.b": { - "Next": "15__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a || input.b && input.a", "Result": false, "ResultPath": "$.heap16", "Type": "Pass", }, "false__!input.a || input.b && input.a": { - "Next": "17__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a && input.s", "Result": false, "ResultPath": "$.heap20", "Type": "Pass", }, "false__!true": { - "Next": "11__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a && input.b", "Result": false, "ResultPath": "$.heap10", "Type": "Pass", @@ -4691,31 +4617,31 @@ exports[`boolean logic 1`] = ` }, "false__input.a && input.s": { "InputPath": "$.input.s", - "Next": "20__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.b || input.s", "ResultPath": "$.heap23", "Type": "Pass", }, "false__input.a === input.b && input.s === "hello"": { - "Next": "5__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b || input.s === "hello"", "Result": false, "ResultPath": "$.heap4", "Type": "Pass", }, "false__input.a === input.b ?? input.s === "hello"": { - "Next": "9__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "!true", "Result": false, "ResultPath": "$.heap8", "Type": "Pass", }, "false__input.a === input.b || input.s === "hello"": { - "Next": "7__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b ?? input.s === "hello"", "Result": false, "ResultPath": "$.heap6", "Type": "Pass", }, "false__input.a || input.b": { "InputPath": "$.input.b", - "Next": "3__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b && input.s === "hello"", "ResultPath": "$.heap2", "Type": "Pass", }, @@ -4739,7 +4665,7 @@ exports[`boolean logic 1`] = ` }, "false__return {and: input.a && input.b, or: input.a || input.b, andConditio": { "InputPath": "$.input.b", - "Next": "1__return {and: input.a && input.b, or: input.a || input.b, andCondition: i 1", + "Next": "input.a || input.b", "ResultPath": "$.heap0", "Type": "Pass", }, @@ -5927,25 +5853,25 @@ exports[`boolean logic 1`] = ` "Type": "Choice", }, "true__!input.a && input.b": { - "Next": "13__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a || input.b 1", "Result": true, "ResultPath": "$.heap13", "Type": "Pass", }, "true__!input.a || input.b": { - "Next": "15__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a || input.b && input.a", "Result": true, "ResultPath": "$.heap16", "Type": "Pass", }, "true__!input.a || input.b && input.a": { - "Next": "17__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a && input.s", "Result": true, "ResultPath": "$.heap20", "Type": "Pass", }, "true__!true": { - "Next": "11__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.a && input.b", "Result": true, "ResultPath": "$.heap10", "Type": "Pass", @@ -5958,31 +5884,31 @@ exports[`boolean logic 1`] = ` }, "true__input.a && input.s": { "InputPath": "$.input.a", - "Next": "20__return {and: input.a && input.b, or: input.a || input.b, andCondition: ", + "Next": "input.b || input.s", "ResultPath": "$.heap23", "Type": "Pass", }, "true__input.a === input.b && input.s === "hello"": { - "Next": "5__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b || input.s === "hello"", "Result": true, "ResultPath": "$.heap4", "Type": "Pass", }, "true__input.a === input.b ?? input.s === "hello"": { - "Next": "9__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "!true", "Result": true, "ResultPath": "$.heap8", "Type": "Pass", }, "true__input.a === input.b || input.s === "hello"": { - "Next": "7__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b ?? input.s === "hello"", "Result": true, "ResultPath": "$.heap6", "Type": "Pass", }, "true__input.a || input.b": { "InputPath": "$.input.a", - "Next": "3__return {and: input.a && input.b, or: input.a || input.b, andCondition: i", + "Next": "input.a === input.b && input.s === "hello"", "ResultPath": "$.heap2", "Type": "Pass", }, @@ -6012,7 +5938,7 @@ exports[`boolean logic 1`] = ` }, "true__return {and: input.a && input.b, or: input.a || input.b, andCondition": { "InputPath": "$.input.a", - "Next": "1__return {and: input.a && input.b, or: input.a || input.b, andCondition: i 1", + "Next": "input.a || input.b", "ResultPath": "$.heap0", "Type": "Pass", }, @@ -6326,9 +6252,9 @@ exports[`call AWS.DynamoDB.GetItem, then Lambda and return LiteralExpr 1`] = ` "1__return {id: person.Item.id.S, name: person.Item.name.S, score: score}": { "End": true, "Parameters": { - "id.$": "$.heap3", - "name.$": "$.heap4", - "score.$": "$.score", + "id.$": "$.person.Item.id.S", + "name.$": "$.person.Item.name.S", + "score.$": "$.heap2", }, "ResultPath": "$", "Type": "Pass", @@ -6342,7 +6268,7 @@ exports[`call AWS.DynamoDB.GetItem, then Lambda and return LiteralExpr 1`] = ` "1__score = await computeScore({id: person.Item.id.S, name: person.Item.name": { "Next": "score", "Parameters": { - "id.$": "$.heap1", + "id.$": "$.person.Item.id.S", "name.$": "$.person.Item.name.S", }, "Resource": "__REPLACED_TOKEN", @@ -6392,7 +6318,7 @@ exports[`call AWS.DynamoDB.GetItem, then Lambda and return LiteralExpr 1`] = ` ], }, ], - "Default": "score = await computeScore({id: person.Item.id.S, name: person.Item.name.S}", + "Default": "1__score = await computeScore({id: person.Item.id.S, name: person.Item.name", "Type": "Choice", }, "person": { @@ -6433,12 +6359,6 @@ exports[`call AWS.DynamoDB.GetItem, then Lambda and return LiteralExpr 1`] = ` "ResultPath": "$.score", "Type": "Pass", }, - "score = await computeScore({id: person.Item.id.S, name: person.Item.name.S}": { - "InputPath": "$.person.Item.id.S", - "Next": "1__score = await computeScore({id: person.Item.id.S, name: person.Item.name", - "ResultPath": "$.heap1", - "Type": "Pass", - }, }, } `; @@ -6475,7 +6395,7 @@ exports[`call Lambda Function, store as variable, return variable 1`] = ` }, "return person": { "End": true, - "InputPath": "$.person", + "InputPath": "$.heap0", "ResultPath": "$", "Type": "Pass", }, @@ -6878,19 +6798,13 @@ exports[`catch and throw Error 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "catch__try": { - "InputPath": "$.fnl_tmp_0", - "Next": "throw new StepFunctionError("CustomError", {property: "custom cause"})", - "ResultPath": "$.err", - "Type": "Pass", - }, "throw new StepFunctionError("CustomError", {property: "custom cause"})": { "Cause": "{"property":"custom cause"}", "Error": "CustomError", "Type": "Fail", }, "try": { - "Next": "catch__try", + "Next": "throw new StepFunctionError("CustomError", {property: "custom cause"})", "Result": { "message": "cause", }, @@ -6915,19 +6829,13 @@ exports[`catch and throw new Error 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "catch__try": { - "InputPath": "$.fnl_tmp_0", - "Next": "throw new StepFunctionError("CustomError", {property: "custom cause"})", - "ResultPath": "$.err", - "Type": "Pass", - }, "throw new StepFunctionError("CustomError", {property: "custom cause"})": { "Cause": "{"property":"custom cause"}", "Error": "CustomError", "Type": "Fail", }, "try": { - "Next": "catch__try", + "Next": "throw new StepFunctionError("CustomError", {property: "custom cause"})", "Result": { "message": "cause", }, @@ -6974,7 +6882,7 @@ exports[`closure from map 1`] = ` "aitem": { "Next": "1__return aitem", "Parameters": { - "string.$": "States.Format('{}{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}{}','x',$.heap0.arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -6983,7 +6891,7 @@ exports[`closure from map 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "aitem", "Variable": "$.heap0.arr[0]", }, ], @@ -7007,24 +6915,6 @@ exports[`closure from map 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return aitem", - "ResultPath": "$.item", - "Type": "Pass", - }, - "item 1": { - "InputPath": "$.item", - "Next": "aitem", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "return aitem": { - "InputPath": "$.a", - "Next": "item 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "return input.list.map(function (item))": { "Next": "check__return input.list.map(function (item))", "Parameters": { @@ -7142,7 +7032,7 @@ exports[`conditionally call DynamoDB and then void 1`] = ` "TableName": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:dynamodb:getItem", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "if(input.id === "hello")": { @@ -7341,7 +7231,7 @@ exports[`continue in do..while loop 1`] = ` "InputPath": "$.input.key", "Next": "if(input.key === "sam")", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "if(input.key === "sam")": { @@ -7510,7 +7400,7 @@ exports[`continue in while loop 1`] = ` "InputPath": "$.input.key", "Next": "while (true)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -7812,12 +7702,6 @@ exports[`empty for 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "1__for(_ of [await task(input.items)])": { - "InputPath": "$.heap0", - "Next": "[await task(input.items)]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "for(_ of [await task(input.items)])", "Parameters": { @@ -7832,20 +7716,14 @@ exports[`empty for 1`] = ` "[await task(input.items)]": { "Next": "for(_ of [await task(input.items)]) 1", "Parameters": { - "out.$": "States.Array($.heap1)", + "out.$": "States.Array($.heap0)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "_": { - "InputPath": "$.heap3[0]", - "Next": "tail__for(_ of [await task(input.items)]) 1", - "ResultPath": "$._", - "Type": "Pass", - }, "for(_ of [await task(input.items)])": { "InputPath": "$.input.items", - "Next": "1__for(_ of [await task(input.items)])", + "Next": "[await task(input.items)]", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", @@ -7860,7 +7738,7 @@ exports[`empty for 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "_", + "Next": "tail__for(_ of [await task(input.items)]) 1", "Variable": "$.heap3[0]", }, ], @@ -7915,15 +7793,9 @@ exports[`for (const i in [task(input)]) 1`] = ` "InputPath": "$.heap3", "Next": "tail__for(i in [await task(input)]) 1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap4", + "ResultPath": null, "Type": "Task", }, - "1__for(i in [await task(input)])": { - "InputPath": "$.heap0", - "Next": "[await task(input)]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "1__for(i in [await task(input)]) 1": { "ItemsPath": "$.heap5", "Iterator": { @@ -7958,19 +7830,13 @@ exports[`for (const i in [task(input)]) 1`] = ` "[await task(input)]": { "Next": "for(i in [await task(input)]) 1", "Parameters": { - "out.$": "States.Array($.heap1)", + "out.$": "States.Array($.heap0)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "assignValue__i": { - "InputPath": "$.heap5[0].item", - "Next": "await task(await task(i))", - "ResultPath": "$.0__i", - "Type": "Pass", - }, "await task(await task(i))": { - "InputPath": "$.i", + "InputPath": "$.heap5[0].index", "Next": "1__await task(await task(i))", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap3", @@ -7978,7 +7844,7 @@ exports[`for (const i in [task(input)]) 1`] = ` }, "for(i in [await task(input)])": { "InputPath": "$.input", - "Next": "1__for(i in [await task(input)])", + "Next": "[await task(input)]", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", @@ -7993,19 +7859,13 @@ exports[`for (const i in [task(input)]) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "await task(await task(i))", "Variable": "$.heap5[0]", }, ], "Default": "return null", "Type": "Choice", }, - "i": { - "InputPath": "$.heap5[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -8030,15 +7890,9 @@ exports[`for (const i of [task(input)]) 1`] = ` "InputPath": "$.heap3", "Next": "tail__for(i of [await task(input)]) 1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap4", + "ResultPath": null, "Type": "Task", }, - "1__for(i of [await task(input)])": { - "InputPath": "$.heap0", - "Next": "[await task(input)]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "for(i of [await task(input)])", "Parameters": { @@ -8053,13 +7907,13 @@ exports[`for (const i of [task(input)]) 1`] = ` "[await task(input)]": { "Next": "for(i of [await task(input)]) 1", "Parameters": { - "out.$": "States.Array($.heap1)", + "out.$": "States.Array($.heap0)", }, "ResultPath": "$.heap2", "Type": "Pass", }, "await task(await task(i))": { - "InputPath": "$.i", + "InputPath": "$.heap5[0]", "Next": "1__await task(await task(i))", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap3", @@ -8067,7 +7921,7 @@ exports[`for (const i of [task(input)]) 1`] = ` }, "for(i of [await task(input)])": { "InputPath": "$.input", - "Next": "1__for(i of [await task(input)])", + "Next": "[await task(input)]", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", @@ -8082,19 +7936,13 @@ exports[`for (const i of [task(input)]) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "await task(await task(i))", "Variable": "$.heap5[0]", }, ], "Default": "return null", "Type": "Choice", }, - "i": { - "InputPath": "$.heap5[0]", - "Next": "await task(await task(i))", - "ResultPath": "$.i", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -8152,36 +8000,18 @@ exports[`for assign 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = i": { - "InputPath": "$.i", - "Next": "i 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "a = i 1": { "InputPath": "$.heap1.string", "Next": "tail__for(i in input.items)", "ResultPath": "$.a", "Type": "Pass", }, - "a = i 2": { - "InputPath": "$.i__1", - "Next": "i 3", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "a = i 3": { "InputPath": "$.heap4.string", "Next": "tail__for(i of input.items)", "ResultPath": "$.a", "Type": "Pass", }, - "assignValue__i": { - "InputPath": "$.heap2[0].item", - "Next": "a = i", - "ResultPath": "$.0__i", - "Type": "Pass", - }, "for(i in input.items)": { "InputPath": "$.input.items", "Next": "1__for(i in input.items)", @@ -8198,7 +8028,7 @@ exports[`for assign 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "i 1", "Variable": "$.heap2[0]", }, ], @@ -8209,37 +8039,25 @@ exports[`for assign 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i 2", + "Next": "i 3", "Variable": "$.heap5[0]", }, ], "Default": "return a", "Type": "Choice", }, - "i": { - "InputPath": "$.heap2[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { "Next": "a = i 1", "Parameters": { - "string.$": "States.Format('{}',$.heap0)", + "string.$": "States.Format('{}',$.heap2[0].index)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "i 2": { - "InputPath": "$.heap5[0]", - "Next": "a = i 2", - "ResultPath": "$.i__1", - "Type": "Pass", - }, "i 3": { "Next": "a = i 3", "Parameters": { - "string.$": "States.Format('{}',$.heap3)", + "string.$": "States.Format('{}',$.heap5[0])", }, "ResultPath": "$.heap4", "Type": "Pass", @@ -8304,7 +8122,7 @@ exports[`for break 1`] = ` "assignValue__i": { "InputPath": "$.heap0[0].item", "Next": "if(input.items[i] === "1")", - "ResultPath": "$.0__i", + "ResultPath": "$.fnls__0__i", "Type": "Pass", }, "for(i in input.items)": { @@ -8323,7 +8141,7 @@ exports[`for break 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "assignValue__i", "Variable": "$.heap0[0]", }, ], @@ -8341,12 +8159,6 @@ exports[`for break 1`] = ` "Default": "return "end"", "Type": "Choice", }, - "i": { - "InputPath": "$.heap0[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { "InputPath": "$.heap1[0]", "Next": "if(i === "1")", @@ -8394,23 +8206,23 @@ exports[`for break 1`] = ` "And": [ { "IsPresent": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsNull": false, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsString": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "StringEquals": "1", - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, ], }, @@ -8437,7 +8249,7 @@ exports[`for break 1`] = ` }, "return input.items[i]": { "End": true, - "InputPath": "$.0__i", + "InputPath": "$.fnls__0__i", "ResultPath": "$", "Type": "Pass", }, @@ -8480,18 +8292,6 @@ exports[`for const i in items, items[i] 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a = items[i]": { - "InputPath": "$.0__i", - "Next": "tail__for(i in input.items)", - "ResultPath": "$.a", - "Type": "Pass", - }, - "assignValue__i": { - "InputPath": "$.heap0[0].item", - "Next": "a = items[i]", - "ResultPath": "$.0__i", - "Type": "Pass", - }, "for(i in input.items)": { "InputPath": "$.input.items", "Next": "1__for(i in input.items)", @@ -8502,19 +8302,13 @@ exports[`for const i in items, items[i] 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "tail__for(i in input.items)", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "i": { - "InputPath": "$.heap0[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -8569,7 +8363,7 @@ exports[`for continue 1`] = ` "assignValue__i": { "InputPath": "$.heap0[0].item", "Next": "if(input.items[i] === "1")", - "ResultPath": "$.0__i", + "ResultPath": "$.fnls__0__i", "Type": "Pass", }, "for(i in input.items)": { @@ -8588,7 +8382,7 @@ exports[`for continue 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "assignValue__i", "Variable": "$.heap0[0]", }, ], @@ -8606,12 +8400,6 @@ exports[`for continue 1`] = ` "Default": "return "end"", "Type": "Choice", }, - "i": { - "InputPath": "$.heap0[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { "InputPath": "$.heap1[0]", "Next": "if(i === "1")", @@ -8659,23 +8447,23 @@ exports[`for continue 1`] = ` "And": [ { "IsPresent": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsNull": false, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsString": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "StringEquals": "1", - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, ], }, @@ -8702,7 +8490,7 @@ exports[`for continue 1`] = ` }, "return input.items[i]": { "End": true, - "InputPath": "$.0__i", + "InputPath": "$.fnls__0__i", "ResultPath": "$", "Type": "Pass", }, @@ -8757,18 +8545,6 @@ exports[`for i in items, items[i] 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a = items[i]": { - "InputPath": "$.0__i", - "Next": "tail__for(i in input.items)", - "ResultPath": "$.a", - "Type": "Pass", - }, - "assignValue__i": { - "InputPath": "$.heap0[0].item", - "Next": "a = items[i]", - "ResultPath": "$.0__i", - "Type": "Pass", - }, "for(i in input.items)": { "InputPath": "$.input.items", "Next": "1__for(i in input.items)", @@ -8779,19 +8555,13 @@ exports[`for i in items, items[i] 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "tail__for(i in input.items)", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "i": { - "InputPath": "$.heap0[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -8846,7 +8616,7 @@ exports[`for return 1`] = ` "assignValue__i": { "InputPath": "$.heap0[0].item", "Next": "if(input.items[i] === "1")", - "ResultPath": "$.0__i", + "ResultPath": "$.fnls__0__i", "Type": "Pass", }, "for(i in input.items)": { @@ -8865,7 +8635,7 @@ exports[`for return 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "i", + "Next": "assignValue__i", "Variable": "$.heap0[0]", }, ], @@ -8883,12 +8653,6 @@ exports[`for return 1`] = ` "Default": "return "end"", "Type": "Choice", }, - "i": { - "InputPath": "$.heap0[0].index", - "Next": "assignValue__i", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { "InputPath": "$.heap1[0]", "Next": "if(i === "1")", @@ -8936,23 +8700,23 @@ exports[`for return 1`] = ` "And": [ { "IsPresent": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsNull": false, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "And": [ { "IsString": true, - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, { "StringEquals": "1", - "Variable": "$.0__i", + "Variable": "$.fnls__0__i", }, ], }, @@ -8979,7 +8743,7 @@ exports[`for return 1`] = ` }, "return input.items[i]": { "End": true, - "InputPath": "$.0__i", + "InputPath": "$.fnls__0__i", "ResultPath": "$", "Type": "Pass", }, @@ -9088,7 +8852,7 @@ exports[`for(;;) loop 1`] = ` "InputPath": "$.i", "Next": "i = if(i === 0)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "false__if(i === 1)": { @@ -9202,11 +8966,11 @@ exports[`for(;;) loop complex 1`] = ` "1__await task({i: i, j: j})": { "Next": "i = i.slice(1) , j = j.slice(1)", "Parameters": { - "i.$": "$.heap0", + "i.$": "$.i", "j.$": "$.j", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "2__for(i = [1, 2],j = [3, 4];i[0];i = i.slice(1) , j = j.slice(1))": { @@ -9304,7 +9068,7 @@ exports[`for(;;) loop complex 1`] = ` ], }, ], - "Next": "await task({i: i, j: j})", + "Next": "1__await task({i: i, j: j})", }, ], "Default": "return null", @@ -9320,12 +9084,6 @@ exports[`for(;;) loop complex 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "await task({i: i, j: j})": { - "InputPath": "$.i", - "Next": "1__await task({i: i, j: j})", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "for(i = [1, 2],j = [3, 4];i[0];i = i.slice(1) , j = j.slice(1))": { "Next": "j", "Result": [ @@ -9375,124 +9133,94 @@ exports[`for(;;) loop empty body 1`] = ` { "And": [ { - "And": [ - { - "IsPresent": true, - "Variable": "$.i", - }, - { - "And": [ - { - "IsNull": false, - "Variable": "$.i", - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.i", - }, - { - "NumericLessThan": 3, - "Variable": "$.i", - }, - ], - }, - ], - }, - ], + "IsPresent": true, + "Variable": "$.i", }, { "And": [ { - "IsPresent": true, + "IsNull": false, "Variable": "$.i", }, { "And": [ { - "IsNull": false, + "IsNumeric": true, "Variable": "$.i", }, { - "And": [ - { - "IsNumeric": true, - "Variable": "$.i", - }, - { - "NumericEquals": 0, - "Variable": "$.i", - }, - ], + "NumericLessThan": 3, + "Variable": "$.i", }, ], }, ], }, ], - "Next": "true__i = if(i === 0)", + "Next": "i = if(i === 0)", + }, + ], + "Default": "return null", + "Type": "Choice", + }, + "1__if(i === 1)": { + "InputPath": "$.heap0", + "Next": "i = if(i === 0) 1", + "ResultPath": "$.heap1", + "Type": "Pass", + }, + "Initialize Functionless Context": { + "Next": "for(i = 0;i < 3;i = if(i === 0))", + "Parameters": { + "fnl_context": { + "null": null, }, + }, + "ResultPath": "$", + "Type": "Pass", + }, + "false__if(i === 1)": { + "Next": "1__if(i === 1)", + "Result": 3, + "ResultPath": "$.heap0", + "Type": "Pass", + }, + "for(i = 0;i < 3;i = if(i === 0))": { + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", + "Result": 0, + "ResultPath": "$.i", + "Type": "Pass", + }, + "i = if(i === 0)": { + "Choices": [ { "And": [ { - "And": [ - { - "IsPresent": true, - "Variable": "$.i", - }, - { - "And": [ - { - "IsNull": false, - "Variable": "$.i", - }, - { - "And": [ - { - "IsNumeric": true, - "Variable": "$.i", - }, - { - "NumericLessThan": 3, - "Variable": "$.i", - }, - ], - }, - ], - }, - ], + "IsPresent": true, + "Variable": "$.i", }, { "And": [ { - "IsPresent": true, + "IsNull": false, "Variable": "$.i", }, { "And": [ { - "IsNull": false, + "IsNumeric": true, "Variable": "$.i", }, { - "And": [ - { - "IsNumeric": true, - "Variable": "$.i", - }, - { - "NumericEquals": 1, - "Variable": "$.i", - }, - ], + "NumericEquals": 0, + "Variable": "$.i", }, ], }, ], }, ], - "Next": "true__if(i === 1)", + "Next": "true__i = if(i === 0)", }, { "And": [ @@ -9513,7 +9241,7 @@ exports[`for(;;) loop empty body 1`] = ` "Variable": "$.i", }, { - "NumericLessThan": 3, + "NumericEquals": 1, "Variable": "$.i", }, ], @@ -9521,44 +9249,16 @@ exports[`for(;;) loop empty body 1`] = ` ], }, ], - "Next": "false__if(i === 1)", + "Next": "true__if(i === 1)", }, ], - "Default": "return null", + "Default": "false__if(i === 1)", "Type": "Choice", }, - "1__if(i === 1)": { - "InputPath": "$.heap0", - "Next": "i = if(i === 0) 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "Initialize Functionless Context": { - "Next": "for(i = 0;i < 3;i = if(i === 0))", - "Parameters": { - "fnl_context": { - "null": null, - }, - }, - "ResultPath": "$", - "Type": "Pass", - }, - "false__if(i === 1)": { - "Next": "1__if(i === 1)", - "Result": 3, - "ResultPath": "$.heap0", - "Type": "Pass", - }, - "for(i = 0;i < 3;i = if(i === 0))": { - "Next": "1__for(i = 0;i < 3;i = if(i === 0))", - "Result": 0, - "ResultPath": "$.i", - "Type": "Pass", - }, - "i = if(i === 0) 1": { - "InputPath": "$.heap1", - "Next": "1__for(i = 0;i < 3;i = if(i === 0))", - "ResultPath": "$.i", + "i = if(i === 0) 1": { + "InputPath": "$.heap1", + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", + "ResultPath": "$.i", "Type": "Pass", }, "return null": { @@ -9601,7 +9301,7 @@ exports[`for(;;) no statement 1`] = ` "InputPath": "$.fnl_context.null", "Next": "return null", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -9654,7 +9354,7 @@ exports[`for-in-loop variable initializer 1`] = ` }, "return x": { "End": true, - "InputPath": "$.x", + "InputPath": "$.heap0[0]", "ResultPath": "$", "Type": "Pass", }, @@ -9683,12 +9383,6 @@ exports[`for-loop and do nothing 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a = item": { - "InputPath": "$.item", - "Next": "tail__for(item of input.items)", - "ResultPath": "$.a", - "Type": "Pass", - }, "for(item of input.items)": { "InputPath": "$.input.items", "Next": "hasNext__for(item of input.items)", @@ -9699,19 +9393,13 @@ exports[`for-loop and do nothing 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "tail__for(item of input.items)", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "a = item", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -9742,12 +9430,6 @@ exports[`for-loop inline array 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a = item": { - "InputPath": "$.item", - "Next": "tail__for(item of [1, 2, 3])", - "ResultPath": "$.a", - "Type": "Pass", - }, "for(item of [1, 2, 3])": { "Next": "hasNext__for(item of [1, 2, 3])", "Result": [ @@ -9762,19 +9444,13 @@ exports[`for-loop inline array 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "tail__for(item of [1, 2, 3])", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "a = item", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -9798,11 +9474,11 @@ exports[`for-loop over a list literal 1`] = ` "1__await computeScore({id: input.id, name: name})": { "Next": "tail__for(name of people)", "Parameters": { - "id.$": "$.heap0", - "name.$": "$.name", + "id.$": "$.input.id", + "name.$": "$.heap2[0]", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "Initialize Functionless Context": { @@ -9816,15 +9492,12 @@ exports[`for-loop over a list literal 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "await computeScore({id: input.id, name: name})": { - "InputPath": "$.input.id", - "Next": "1__await computeScore({id: input.id, name: name})", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "for(name of people)": { - "InputPath": "$.people", "Next": "hasNext__for(name of people)", + "Parameters": [ + "sam", + "sam", + ], "ResultPath": "$.heap2", "Type": "Pass", }, @@ -9832,19 +9505,13 @@ exports[`for-loop over a list literal 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "name", + "Next": "1__await computeScore({id: input.id, name: name})", "Variable": "$.heap2[0]", }, ], "Default": "return null", "Type": "Choice", }, - "name": { - "InputPath": "$.heap2[0]", - "Next": "await computeScore({id: input.id, name: name})", - "ResultPath": "$.name", - "Type": "Pass", - }, "people = ["sam", "sam"]": { "Next": "for(name of people)", "Result": [ @@ -9920,7 +9587,7 @@ exports[`for-of { try { task() } catch (err) { if(err) throw } finally { task() "Next": "1__finally", "Parameters": "2", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "for(item of input.items)": { @@ -9933,7 +9600,7 @@ exports[`for-of { try { task() } catch (err) { if(err) throw } finally { task() "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "try", "Variable": "$.heap2[0]", }, ], @@ -9975,12 +9642,6 @@ exports[`for-of { try { task() } catch (err) { if(err) throw } finally { task() "Default": "finally", "Type": "Choice", }, - "item": { - "InputPath": "$.heap2[0]", - "Next": "try", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -10016,10 +9677,10 @@ exports[`for-of { try { task() } catch (err) { if(err) throw } finally { task() "ResultPath": "$.fnl_tmp_0", }, ], - "InputPath": "$.item", + "InputPath": "$.heap2[0]", "Next": "finally", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, }, @@ -10064,7 +9725,7 @@ exports[`for-of-loop variable initializer 1`] = ` "assignValue__x": { "InputPath": "$.heap0[0].item", "Next": "return x", - "ResultPath": "$.0__x", + "ResultPath": "$.fnls__0__x", "Type": "Pass", }, "for(x in input.items)": { @@ -10092,7 +9753,7 @@ exports[`for-of-loop variable initializer 1`] = ` }, "return x": { "End": true, - "InputPath": "$.x", + "InputPath": "$.heap0[0].index", "ResultPath": "$", "Type": "Pass", }, @@ -10291,7 +9952,7 @@ exports[`iam policy for AWS.SDK.CloudWatch.describeAlarms 1`] = ` "fnRole50A611CF", ], "Properties": { - "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0['MetricAlarms']"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.MetricAlarms"}}}", + "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0.MetricAlarms"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.heap0.MetricAlarms"}}}", "RoleArn": { "Fn::GetAtt": [ "fnRole50A611CF", @@ -11899,6 +11560,143 @@ exports[`if if 1`] = ` } `; +exports[`if ifelse 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "Initialize Functionless Context": { + "Next": "if(input.val !== "a")", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "if(input.val !== "a")": { + "Choices": [ + { + "And": [ + { + "Not": { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsString": true, + "Variable": "$.input.val", + }, + { + "StringEquals": "a", + "Variable": "$.input.val", + }, + ], + }, + ], + }, + ], + }, + }, + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsString": true, + "Variable": "$.input.val", + }, + { + "StringEquals": "b", + "Variable": "$.input.val", + }, + ], + }, + ], + }, + ], + }, + ], + "Next": "return "hullo"", + }, + { + "Next": "return "wat"", + "Not": { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsNull": false, + "Variable": "$.input.val", + }, + { + "And": [ + { + "IsString": true, + "Variable": "$.input.val", + }, + { + "StringEquals": "a", + "Variable": "$.input.val", + }, + ], + }, + ], + }, + ], + }, + }, + ], + "Default": "return "woop"", + "Type": "Choice", + }, + "return "hullo"": { + "End": true, + "Result": "hullo", + "ResultPath": "$", + "Type": "Pass", + }, + "return "wat"": { + "End": true, + "Result": "wat", + "ResultPath": "$", + "Type": "Pass", + }, + "return "woop"": { + "End": true, + "Result": "woop", + "ResultPath": "$", + "Type": "Pass", + }, + }, +} +`; + exports[`if invoke 1`] = ` { "StartAt": "Initialize Functionless Context", @@ -12227,7 +12025,7 @@ exports[`import from express state machine into machine 1`] = ` "StateMachineArn": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sfn:startSyncExecution", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -12263,7 +12061,7 @@ exports[`import from state machine into state machine 1`] = ` "StateMachineArn": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sfn:startExecution", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -12453,7 +12251,7 @@ exports[`input.list.map((item) => item).filter((item) => item.length > 2) 1`] = "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return item", "Variable": "$.heap0.arr[0]", }, ], @@ -12477,12 +12275,6 @@ exports[`input.list.map((item) => item).filter((item) => item.length > 2) 1`] = "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return item", - "ResultPath": "$.item", - "Type": "Pass", - }, "return input.list.map(function (item)).filter(function (item))": { "Next": "check__return input.list.map(function (item)).filter(function (item))", "Parameters": { @@ -12493,7 +12285,7 @@ exports[`input.list.map((item) => item).filter((item) => item.length > 2) 1`] = "Type": "Pass", }, "return item": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "handleResult__return input.list.map(function (item)).filter(function (item)", "ResultPath": "$.heap0.arr[0]", "Type": "Pass", @@ -12860,7 +12652,7 @@ exports[`let empty 1`] = ` }, "return a": { "End": true, - "InputPath": "$.a", + "Parameters": "b", "ResultPath": "$", "Type": "Pass", }, @@ -12893,7 +12685,7 @@ exports[`list.filter(item => item.length > 2).map(item => item) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return item", "Variable": "$.heap0.arr[0]", }, ], @@ -12917,12 +12709,6 @@ exports[`list.filter(item => item.length > 2).map(item => item) 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return item", - "ResultPath": "$.item", - "Type": "Pass", - }, "return input.list.filter(function (item)).map(function (item))": { "Next": "check__return input.list.filter(function (item)).map(function (item))", "Parameters": { @@ -12933,7 +12719,7 @@ exports[`list.filter(item => item.length > 2).map(item => item) 1`] = ` "Type": "Pass", }, "return item": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "handleResult__return input.list.filter(function (item)).map(function (item)", "ResultPath": "$.heap0.arr[0]", "Type": "Pass", @@ -12979,7 +12765,7 @@ exports[`list.filter(item => item.length > 2).map(item => task(item)) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -13003,12 +12789,6 @@ exports[`list.filter(item => item.length > 2).map(item => task(item)) 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return Promise.all(input.list.filter(function (item)).map(function (item)))": { "Next": "check__return Promise.all(input.list.filter(function (item)).map(function (", "Parameters": { @@ -13019,7 +12799,7 @@ exports[`list.filter(item => item.length > 2).map(item => task(item)) 1`] = ` "Type": "Pass", }, "return task(item)": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -13337,12 +13117,6 @@ exports[`list.forEach(item => ) 1`] = ` "ResultPath": "$.a", "Type": "Pass", }, - "a = aitem": { - "InputPath": "$.a", - "Next": "item 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "a = aitem 1": { "InputPath": "$.heap3.string", "Next": "return null 1", @@ -13352,7 +13126,7 @@ exports[`list.forEach(item => ) 1`] = ` "aitem": { "Next": "a = aitem 1", "Parameters": { - "string.$": "States.Format('{}{}',$.heap1,$.heap2)", + "string.$": "States.Format('{}{}',$.a,$.heap0.arr[0])", }, "ResultPath": "$.heap3", "Type": "Pass", @@ -13361,7 +13135,7 @@ exports[`list.forEach(item => ) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "aitem", "Variable": "$.heap0.arr[0]", }, ], @@ -13382,22 +13156,10 @@ exports[`list.forEach(item => ) 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "a = aitem", - "ResultPath": "$.item", - "Type": "Pass", - }, - "item 1": { - "InputPath": "$.item", - "Next": "aitem", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "return null": { - "End": true, - "InputPath": "$.fnl_context.null", - "ResultPath": "$", + "return null": { + "End": true, + "InputPath": "$.fnl_context.null", + "ResultPath": "$", "Type": "Pass", }, "return null 1": { @@ -13447,7 +13209,7 @@ exports[`list.forEach(item => task(item)) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -13460,12 +13222,6 @@ exports[`list.forEach(item => task(item)) 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return input.list.forEach(function (item))": { "Next": "check__return input.list.forEach(function (item))", "Parameters": { @@ -13475,7 +13231,7 @@ exports[`list.forEach(item => task(item)) 1`] = ` "Type": "Pass", }, "return task(item)": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -13827,7 +13583,7 @@ exports[`list.map(item => task(item)) 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -13851,12 +13607,6 @@ exports[`list.map(item => task(item)) 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return Promise.all(input.list.map(function (item)))": { "Next": "check__return Promise.all(input.list.map(function (item)))", "Parameters": { @@ -13867,7 +13617,7 @@ exports[`list.map(item => task(item)) 1`] = ` "Type": "Pass", }, "return task(item)": { - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -13932,7 +13682,7 @@ exports[`non-literal params AWS.SDK.CloudWatch.deleteAlarms 1`] = ` "AlarmNames.$": "$.heap1", }, "Resource": "arn:aws:states:::aws-sdk:cloudwatch:deleteAlarms", - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Task", }, "Initialize Functionless Context": { @@ -13946,17 +13696,11 @@ exports[`non-literal params AWS.SDK.CloudWatch.deleteAlarms 1`] = ` "Type": "Pass", }, "MetricAlarms": { - "InputPath": "$.heap0['MetricAlarms']", + "InputPath": "$.heap0.MetricAlarms", "Next": "if(MetricAlarms === undefined)", "ResultPath": "$.MetricAlarms", "Type": "Pass", }, - "a": { - "InputPath": "$.heap1.arr[0]", - "Next": "return a.AlarmName", - "ResultPath": "$.a", - "Type": "Pass", - }, "await $AWS.SDK.CloudWatch.deleteAlarms({AlarmNames: MetricAlarms.map(functi": { "Next": "check__await $AWS.SDK.CloudWatch.deleteAlarms({AlarmNames: MetricAlarms.map", "Parameters": { @@ -13970,7 +13714,7 @@ exports[`non-literal params AWS.SDK.CloudWatch.deleteAlarms 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "a", + "Next": "return a.AlarmName", "Variable": "$.heap1.arr[0]", }, ], @@ -14036,7 +13780,7 @@ exports[`non-literal params AWS.SDK.CloudWatch.deleteAlarms 1`] = ` "Type": "Pass", }, "return a.AlarmName": { - "InputPath": "$.a.AlarmName", + "InputPath": "$.heap1.arr[0].AlarmName", "Next": "handleResult__await $AWS.SDK.CloudWatch.deleteAlarms({AlarmNames: MetricAla", "ResultPath": "$.heap1.arr[0]", "Type": "Pass", @@ -14137,14 +13881,14 @@ exports[`overwrite aslServiceName AWS.SDK.CloudWatch.describeAlarms 1`] = ` "Type": "Pass", }, "MetricAlarms": { - "InputPath": "$.heap0['MetricAlarms']", + "InputPath": "$.heap0.MetricAlarms", "Next": "return MetricAlarms", "ResultPath": "$.MetricAlarms", "Type": "Pass", }, "return MetricAlarms": { "End": true, - "InputPath": "$.MetricAlarms", + "InputPath": "$.heap0.MetricAlarms", "ResultPath": "$", "Type": "Pass", }, @@ -14344,7 +14088,7 @@ exports[`overwrite iamActions AWS.SDK.CloudWatch.describeAlarms 1`] = ` "fnRole50A611CF", ], "Properties": { - "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0['MetricAlarms']"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.MetricAlarms"}}}", + "DefinitionString": "{"StartAt":"Initialize Functionless Context","States":{"Initialize Functionless Context":{"Type":"Pass","Parameters":{"fnl_context":{"null":null}},"ResultPath":"$","Next":"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso"},"{ MetricAlarms } = await $AWS.SDK.CloudWatch.describeAlarms({}, {iam: {reso":{"Type":"Task","Resource":"arn:aws:states:::aws-sdk:cloudwatch:describeAlarms","Next":"MetricAlarms","Parameters":{},"ResultPath":"$.heap0"},"MetricAlarms":{"Type":"Pass","Next":"return MetricAlarms","ResultPath":"$.MetricAlarms","InputPath":"$.heap0.MetricAlarms"},"return MetricAlarms":{"Type":"Pass","End":true,"ResultPath":"$","InputPath":"$.heap0.MetricAlarms"}}}", "RoleArn": { "Fn::GetAtt": [ "fnRole50A611CF", @@ -14445,13 +14189,13 @@ exports[`parse json 1`] = ` "1__return JSON.parse("{ a: 'a', b: { c: 'c' } }") 1": { "Next": "1__return JSON.parse("{ a: 'a', b: { c: 'c' } }")", "Parameters": { - "out.$": "States.StringToJson($.heap0)", + "out.$": "States.StringToJson('{ a: 'a', b: { c: 'c' } }')", }, "ResultPath": "$.heap1", "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "return JSON.parse("{ a: 'a', b: { c: 'c' } }")", + "Next": "1__return JSON.parse("{ a: 'a', b: { c: 'c' } }") 1", "Parameters": { "fnl_context": { "null": null, @@ -14460,12 +14204,6 @@ exports[`parse json 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return JSON.parse("{ a: 'a', b: { c: 'c' } }")": { - "Next": "1__return JSON.parse("{ a: 'a', b: { c: 'c' } }") 1", - "Result": "{ a: 'a', b: { c: 'c' } }", - "ResultPath": "$.heap0", - "Type": "Pass", - }, }, } `; @@ -14541,7 +14279,7 @@ exports[`put an event bus event 1`] = ` ], }, "Resource": "__REPLACED_ARN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -14593,7 +14331,7 @@ exports[`put multiple event bus events 1`] = ` ], }, "Resource": "__REPLACED_ARN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -14818,7 +14556,7 @@ exports[`result = $SFN.map(list, (item) => task(item)) 1`] = ` }, "return result": { "End": true, - "InputPath": "$.result", + "InputPath": "$.heap1", "ResultPath": "$", "Type": "Pass", }, @@ -14856,7 +14594,7 @@ exports[`return $SFN.forEach(list, (item) => task(item)) 1`] = ` "InputPath": "$.item", "Next": "return null", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -14919,7 +14657,7 @@ exports[`return $SFN.forEach(list, (item) => try { task(item)) } catch { return "InputPath": "$.item", "Next": "return null", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch__await task(item)": { @@ -14979,7 +14717,7 @@ exports[`return $SFN.forEach(list, {maxConcurrency: 2} (item) => task(item)) 1`] "InputPath": "$.item", "Next": "return null", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -15363,7 +15101,7 @@ exports[`return AWS.DynamoDB.GetItem 1`] = ` "1__return {id: person.Item.id.S, name: person.Item.name.S}": { "End": true, "Parameters": { - "id.$": "$.heap1", + "id.$": "$.person.Item.id.S", "name.$": "$.person.Item.name.S", }, "ResultPath": "$", @@ -15472,7 +15210,7 @@ exports[`return AWS.DynamoDB.GetItem dynamic parameters 1`] = ` "1__return {id: person.Item.id.S, name: person.Item.name.S}": { "End": true, "Parameters": { - "id.$": "$.heap2", + "id.$": "$.person.Item.id.S", "name.$": "$.person.Item.name.S", }, "ResultPath": "$", @@ -15852,7 +15590,7 @@ exports[`return ElementAccessExpr 1`] = ` }, "return input.input["id special"]": { "End": true, - "InputPath": "$.input.input['id special']", + "InputPath": "$.input.input.id special", "ResultPath": "$", "Type": "Pass", }, @@ -15896,7 +15634,7 @@ exports[`return ElementAccessExpr number reference 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "id = 0", + "Next": "return input.input.arr[id]", "Parameters": { "fnl_context": { "null": null, @@ -15909,7 +15647,7 @@ exports[`return ElementAccessExpr number reference 1`] = ` "array__return input.input.arr[id]": { "Next": "1__return input.input.arr[id]", "Parameters": { - "out.$": "States.ArrayGetItem($.input.input.arr,$.id)", + "out.$": "States.ArrayGetItem($.input.input.arr,0)", }, "ResultPath": "$.heap0", "Type": "Pass", @@ -15933,12 +15671,6 @@ exports[`return ElementAccessExpr number reference 1`] = ` "Default": "object__return input.input.arr[id]", "Type": "Choice", }, - "id = 0": { - "Next": "return input.input.arr[id]", - "Result": 0, - "ResultPath": "$.id", - "Type": "Pass", - }, "object__return input.input.arr[id]": { "Cause": "Reference element access is not valid for objects.", "Error": "Functionless.InvalidAccess", @@ -16720,11 +16452,11 @@ exports[`sendMessage JSON array 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Task", }, "Initialize Functionless Context": { - "Next": "await queue.sendMessage({MessageBody: [input]})", + "Next": "[input]", "Parameters": { "fnl_context": { "null": null, @@ -16737,17 +16469,11 @@ exports[`sendMessage JSON array 1`] = ` "[input]": { "Next": "1__await queue.sendMessage({MessageBody: [input]})", "Parameters": { - "out.$": "States.Array($.heap0)", + "out.$": "States.Array($.input)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "await queue.sendMessage({MessageBody: [input]})": { - "InputPath": "$.input", - "Next": "[input]", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -16780,7 +16506,7 @@ exports[`sendMessage TextSerializer 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -16814,7 +16540,7 @@ exports[`sendMessage TextSerializer literal string 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -16838,7 +16564,7 @@ exports[`sendMessage object literal with JSON Path to SQS Queue 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "Initialize Functionless Context": { @@ -16892,7 +16618,7 @@ exports[`sendMessage when whole message is JSON Path 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessage", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -16920,18 +16646,12 @@ exports[`sendMessageBatch with JSON serialization 1`] = ` "1__return {Id: i, MessageBody: message}": { "Next": "handleResult__await queue.sendMessageBatch({Entries: input.messages.map(fun", "Parameters": { - "Id.$": "$.heap3", - "MessageBody.$": "$.message", + "Id.$": "$.heap2.string", + "MessageBody.$": "$.heap0.arr[0].item", }, "ResultPath": "$.heap0.arr[0]", "Type": "Pass", }, - "1__return {Id: i, MessageBody: message} 1": { - "InputPath": "$.heap2.string", - "Next": "1__return {Id: i, MessageBody: message}", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "2__await queue.sendMessageBatch({Entries: input.messages.map(function (mess": { "ItemsPath": "$.heap4.Entries", "Iterator": { @@ -17000,7 +16720,7 @@ exports[`sendMessageBatch with JSON serialization 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "function (message,i)", + "Next": "i 1", "Variable": "$.heap0.arr[0]", }, ], @@ -17015,12 +16735,6 @@ exports[`sendMessageBatch with JSON serialization 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "function (message,i)": { - "InputPath": "$.heap0.arr[0].item", - "Next": "i", - "ResultPath": "$.message", - "Type": "Pass", - }, "handleResult__await queue.sendMessageBatch({Entries: input.messages.map(fun": { "Next": "check__await queue.sendMessageBatch({Entries: input.messages.map(function (", "Parameters": { @@ -17030,16 +16744,10 @@ exports[`sendMessageBatch with JSON serialization 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "i": { - "InputPath": "$.heap0.arr[0].index", - "Next": "return {Id: i, MessageBody: message}", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { - "Next": "1__return {Id: i, MessageBody: message} 1", + "Next": "1__return {Id: i, MessageBody: message}", "Parameters": { - "string.$": "States.Format('{}',$.heap1)", + "string.$": "States.Format('{}',$.heap0.arr[0].index)", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -17050,12 +16758,6 @@ exports[`sendMessageBatch with JSON serialization 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return {Id: i, MessageBody: message}": { - "InputPath": "$.i", - "Next": "i 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "send message batch__2__await queue.sendMessageBatch({Entries: input.message": { "Next": "return null", "Parameters": { @@ -17087,24 +16789,18 @@ exports[`sendMessageBatch with Text serialization 1`] = ` "QueueUrl": "__REPLACED_TOKEN", }, "Resource": "arn:aws:states:::aws-sdk:sqs:sendMessageBatch", - "ResultPath": "$.heap4", + "ResultPath": null, "Type": "Task", }, "1__return {Id: i, MessageBody: message}": { "Next": "handleResult__await queue.sendMessageBatch({Entries: input.messages.map(fun", "Parameters": { - "Id.$": "$.heap3", - "MessageBody.$": "$.message", + "Id.$": "$.heap2.string", + "MessageBody.$": "$.heap0.arr[0].item", }, "ResultPath": "$.heap0.arr[0]", "Type": "Pass", }, - "1__return {Id: i, MessageBody: message} 1": { - "InputPath": "$.heap2.string", - "Next": "1__return {Id: i, MessageBody: message}", - "ResultPath": "$.heap3", - "Type": "Pass", - }, "Initialize Functionless Context": { "Next": "await queue.sendMessageBatch({Entries: input.messages.map(function (message", "Parameters": { @@ -17144,7 +16840,7 @@ exports[`sendMessageBatch with Text serialization 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "function (message,i)", + "Next": "i 1", "Variable": "$.heap0.arr[0]", }, ], @@ -17159,12 +16855,6 @@ exports[`sendMessageBatch with Text serialization 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "function (message,i)": { - "InputPath": "$.heap0.arr[0].item", - "Next": "i", - "ResultPath": "$.message", - "Type": "Pass", - }, "handleResult__await queue.sendMessageBatch({Entries: input.messages.map(fun": { "Next": "check__await queue.sendMessageBatch({Entries: input.messages.map(function (", "Parameters": { @@ -17174,16 +16864,10 @@ exports[`sendMessageBatch with Text serialization 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "i": { - "InputPath": "$.heap0.arr[0].index", - "Next": "return {Id: i, MessageBody: message}", - "ResultPath": "$.i", - "Type": "Pass", - }, "i 1": { - "Next": "1__return {Id: i, MessageBody: message} 1", + "Next": "1__return {Id: i, MessageBody: message}", "Parameters": { - "string.$": "States.Format('{}',$.heap1)", + "string.$": "States.Format('{}',$.heap0.arr[0].index)", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -17194,12 +16878,6 @@ exports[`sendMessageBatch with Text serialization 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return {Id: i, MessageBody: message}": { - "InputPath": "$.i", - "Next": "i 1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "set__end__await queue.sendMessageBatch({Entries: input.messages.map(functio": { "InputPath": "$.heap0.result[1:]", "Next": "1__await queue.sendMessageBatch({Entries: input.messages.map(function (mess", @@ -17217,15 +16895,15 @@ exports[`set obj 1`] = ` "1__return {a: a, b: b, c: c}": { "End": true, "Parameters": { - "a.$": "$.heap0", - "b.$": "$.heap1", - "c.$": "$.c", + "a.$": "$.a", + "b.$": "$.a[1]", + "c.$": "$.a['1']", }, "ResultPath": "$", "Type": "Pass", }, "1__return {a: a, b: b, c: c} 1": { - "InputPath": "$.b", + "InputPath": "$.a[1]", "Next": "1__return {a: a, b: b, c: c}", "ResultPath": "$.heap1", "Type": "Pass", @@ -17307,7 +16985,7 @@ exports[`shadow 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "a = """, + "Next": "a = "1"", "Parameters": { "fnl_context": { "null": null, @@ -17316,52 +16994,40 @@ exports[`shadow 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "a = """: { - "Next": "a__2 = """, - "Result": "", + "a = "1"": { + "Next": "a__2 = "2"", + "Result": "1", "ResultPath": "$.a", "Type": "Pass", }, - "a = "" 1": { - "Next": "a__1 = """, - "Result": "", + "a = "3"": { + "Next": "a__1 = "4"", + "Result": "3", "ResultPath": "$.a__1", "Type": "Pass", }, - "a = "" 2": { - "Next": "return aba__1", - "Result": "", - "ResultPath": "$.a__3", - "Type": "Pass", - }, - "a__1": { - "InputPath": "$.a__1__1", + "a = "6"": { "Next": "aba__1", - "ResultPath": "$.heap2", + "Result": "6", + "ResultPath": "$.a__3", "Type": "Pass", }, - "a__1 = """: { - "Next": "if(a === "")", - "Result": "", + "a__1 = "4"": { + "Next": "if(a === "3")", + "Result": "4", "ResultPath": "$.a__1__1", "Type": "Pass", }, - "a__2": { - "InputPath": "$.a__2", - "Next": "aa__2", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "a__2 = """: { + "a__2 = "2"": { "Next": "for(b in [1, 2, 3])", - "Result": "", + "Result": "2", "ResultPath": "$.a__2", "Type": "Pass", }, "aa__2": { "Next": "1__return aa__2", "Parameters": { - "string.$": "States.Format('{}{}',$.heap5,$.heap6)", + "string.$": "States.Format('{}{}','1','2')", }, "ResultPath": "$.heap7", "Type": "Pass", @@ -17369,29 +17035,17 @@ exports[`shadow 1`] = ` "aba__1": { "Next": "1__return aba__1", "Parameters": { - "string.$": "States.Format('{}{}{}',$.heap0,$.heap1,$.heap2)", + "string.$": "States.Format('{}{}{}','6',$.b,'4')", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignValue__b": { - "InputPath": "$.heap4[0].item", - "Next": "a = "" 1", - "ResultPath": "$.0__b", - "Type": "Pass", - }, "b": { "InputPath": "$.heap4[0].index", - "Next": "assignValue__b", + "Next": "a = "3"", "ResultPath": "$.b", "Type": "Pass", }, - "b 1": { - "InputPath": "$.b", - "Next": "a__1", - "ResultPath": "$.heap1", - "Type": "Pass", - }, "for(b in [1, 2, 3])": { "Next": "1__for(b in [1, 2, 3])", "Result": [ @@ -17410,10 +17064,10 @@ exports[`shadow 1`] = ` "Variable": "$.heap4[0]", }, ], - "Default": "return aa__2", + "Default": "aa__2", "Type": "Choice", }, - "if(a === "")": { + "if(a === "3")": { "Choices": [ { "And": [ @@ -17434,7 +17088,7 @@ exports[`shadow 1`] = ` "Variable": "$.a__1", }, { - "StringEquals": "", + "StringEquals": "3", "Variable": "$.a__1", }, ], @@ -17442,24 +17096,12 @@ exports[`shadow 1`] = ` ], }, ], - "Next": "a = "" 2", + "Next": "a = "6"", }, ], "Default": "tail__for(b in [1, 2, 3])", "Type": "Choice", }, - "return aa__2": { - "InputPath": "$.a", - "Next": "a__2", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "return aba__1": { - "InputPath": "$.a__3", - "Next": "b 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "tail__for(b in [1, 2, 3])": { "InputPath": "$.heap4[1:]", "Next": "hasNext__for(b in [1, 2, 3])", @@ -17511,9 +17153,9 @@ exports[`spread any object 1`] = ` "1__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i": { "End": true, "Parameters": { - "a.$": "$.heap0", - "b.$": "$.heap4", - "c.$": "$.heap8", + "a.$": "$.input", + "b.$": "$.heap3.out", + "c.$": "$.heap7.out", "d": { "x": 1, "y": 3, @@ -17523,12 +17165,6 @@ exports[`spread any object 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "1__{...input, ...input, ...input}": { - "InputPath": "$.input", - "Next": "2__{...input, ...input, ...input}", - "ResultPath": "$.heap6", - "Type": "Pass", - }, "1__{x: 1, ...input, y: input}": { "Next": "2__{x: 1, ...input, y: input}", "Parameters": { @@ -17537,34 +17173,22 @@ exports[`spread any object 1`] = ` "ResultPath": "$.heap2", "Type": "Pass", }, - "2__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i": { - "InputPath": "$.heap3.out", - "Next": "{...input, ...input, ...input}", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "2__{...input, ...input, ...input}": { - "Next": "4__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i", + "Next": "5__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i", "Parameters": { - "out.$": "States.JsonMerge(States.JsonMerge($.heap5,$.heap6,false),$.input,false)", + "out.$": "States.JsonMerge(States.JsonMerge($.input,$.input,false),$.input,false)", }, "ResultPath": "$.heap7", "Type": "Pass", }, "2__{x: 1, ...input, y: input}": { - "Next": "2__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i", + "Next": "2__{...input, ...input, ...input}", "Parameters": { - "out.$": "States.JsonMerge(States.JsonMerge(States.StringToJson('{"x":1}'),$.heap1,false),$.heap2,false)", + "out.$": "States.JsonMerge(States.JsonMerge(States.StringToJson('{"x":1}'),$.input,false),$.heap2,false)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "4__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i": { - "InputPath": "$.heap7.out", - "Next": "5__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i", - "ResultPath": "$.heap8", - "Type": "Pass", - }, "5__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i": { "Next": "1__return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...i", "Parameters": { @@ -17574,7 +17198,7 @@ exports[`spread any object 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...inpu", + "Next": "1__{x: 1, ...input, y: input}", "Parameters": { "fnl_context": { "null": null, @@ -17584,24 +17208,6 @@ exports[`spread any object 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "return {a: {...input}, b: {x: 1, ...input, y: input}, c: {...input, ...inpu": { - "InputPath": "$.input", - "Next": "{x: 1, ...input, y: input}", - "ResultPath": "$.heap0", - "Type": "Pass", - }, - "{...input, ...input, ...input}": { - "InputPath": "$.input", - "Next": "1__{...input, ...input, ...input}", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "{x: 1, ...input, y: input}": { - "InputPath": "$.input", - "Next": "1__{x: 1, ...input, y: input}", - "ResultPath": "$.heap1", - "Type": "Pass", - }, }, } `; @@ -17645,70 +17251,10 @@ exports[`spread limits 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - "10__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "11__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap10", - "Type": "Pass", - }, - "11__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "12__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap11", - "Type": "Pass", - }, - "12__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "13__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap12", - "Type": "Pass", - }, - "13__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "14__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap13", - "Type": "Pass", - }, - "14__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "15__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap14", - "Type": "Pass", - }, - "15__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "16__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap15", - "Type": "Pass", - }, - "16__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "17__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap16", - "Type": "Pass", - }, - "17__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "18__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap17", - "Type": "Pass", - }, - "18__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "19__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap18", - "Type": "Pass", - }, - "19__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "20__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap19", - "Type": "Pass", - }, "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu": { "Next": "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", "Parameters": { - "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0,$.heap64,false),$.heap65,false),$.heap73.out.d1,false),$.heap66,false),$.heap67,false),$.heap68,false),$.heap69,false),$.heap70,false),$.heap71,false),$.heap72,false)", + "out.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0,$.input,false),$.input,false),$.heap73.out.d1,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.heap72,false)", }, "ResultPath": "$.heap73", "Type": "Pass", @@ -17716,7 +17262,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 1": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0,$.heap54,false),$.heap55,false),$.heap56,false),$.heap57,false),$.heap58,false),$.heap59,false),$.heap60,false),$.heap61,false),$.heap62,false),$.heap63,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", "d1.$": "States.StringToJson('{"x":7,"y":8,"z":9,"a":1,"m":4}')", }, "ResultPath": "$.heap73.out", @@ -17725,7 +17271,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 2": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 1", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0,$.heap44,false),$.heap45,false),$.heap46,false),$.heap47,false),$.heap48,false),$.heap49,false),$.heap50,false),$.heap51,false),$.heap52,false),$.heap53,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap73.out.d0", "Type": "Pass", @@ -17733,7 +17279,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 3": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 2", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0,$.heap34,false),$.heap35,false),$.heap36,false),$.heap37,false),$.heap38,false),$.heap39,false),$.heap40,false),$.heap41,false),$.heap42,false),$.heap43,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap73.out.d0.d0", "Type": "Pass", @@ -17741,7 +17287,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 4": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 3", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0,$.heap24,false),$.heap25,false),$.heap26,false),$.heap27,false),$.heap28,false),$.heap29,false),$.heap30,false),$.heap31,false),$.heap32,false),$.heap33,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap73.out.d0.d0.d0", "Type": "Pass", @@ -17749,7 +17295,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 5": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 4", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0.d0,$.heap15,false),$.heap16,false),$.heap17,false),$.heap18,false),$.heap73.out.d0.d0.d0.d0.d0.d1,false),$.heap19,false),$.heap20,false),$.heap21,false),$.heap22,false),$.heap23,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.heap73.out.d0.d0.d0.d0.d0.d1,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", }, "ResultPath": "$.heap73.out.d0.d0.d0.d0", "Type": "Pass", @@ -17757,7 +17303,7 @@ exports[`spread limits 1`] = ` "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6": { "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 5", "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0.d0.d0,$.heap5,false),$.heap6,false),$.heap7,false),$.heap8,false),$.heap9,false),$.heap10,false),$.heap11,false),$.heap12,false),$.heap13,false),$.heap14,false)", + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge($.heap73.out.d0.d0.d0.d0.d0.d0.d0,$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", "d1.$": "States.StringToJson('{"m":0,"n":5,"o":6}')", }, "ResultPath": "$.heap73.out.d0.d0.d0.d0.d0", @@ -17769,417 +17315,45 @@ exports[`spread limits 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, . 1": { - "InputPath": "$.input", - "Next": "2__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "20__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "21__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap20", + "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { + "Next": "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", + "Parameters": { + "someKey.$": "$.input", + }, + "ResultPath": "$.heap72", "Type": "Pass", }, - "21__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "22__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap21", + "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { + "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6", + "Parameters": { + "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.StringToJson('{"a":0,"b":2,"c":3}'),$.input,false),$.input,false),$.input,false),$.input,false),$.input,false)", + }, + "ResultPath": "$.heap73.out.d0.d0.d0.d0.d0.d0", "Type": "Pass", }, - "22__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "23__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap22", + "Initialize Functionless Context": { + "Next": "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", "Type": "Pass", }, - "23__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "24__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap23", - "Type": "Pass", - }, - "24__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "25__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap24", - "Type": "Pass", - }, - "25__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "26__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap25", - "Type": "Pass", - }, - "26__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "27__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap26", - "Type": "Pass", - }, - "27__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "28__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap27", - "Type": "Pass", - }, - "28__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "29__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap28", - "Type": "Pass", - }, - "29__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "30__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap29", - "Type": "Pass", - }, - "2__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "3__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap2", - "Type": "Pass", - }, - "30__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "31__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap30", - "Type": "Pass", - }, - "31__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "32__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap31", - "Type": "Pass", - }, - "32__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "33__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap32", - "Type": "Pass", - }, - "33__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "34__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap33", - "Type": "Pass", - }, - "34__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "35__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap34", - "Type": "Pass", - }, - "35__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "36__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap35", - "Type": "Pass", - }, - "36__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "37__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap36", - "Type": "Pass", - }, - "37__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "38__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap37", - "Type": "Pass", - }, - "38__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "39__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap38", - "Type": "Pass", - }, - "39__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "40__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap39", - "Type": "Pass", - }, - "3__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "4__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap3", - "Type": "Pass", - }, - "40__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "41__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap40", - "Type": "Pass", - }, - "41__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "42__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap41", - "Type": "Pass", - }, - "42__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "43__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap42", - "Type": "Pass", - }, - "43__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "44__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap43", - "Type": "Pass", - }, - "44__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "45__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap44", - "Type": "Pass", - }, - "45__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "46__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap45", - "Type": "Pass", - }, - "46__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "47__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap46", - "Type": "Pass", - }, - "47__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "48__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap47", - "Type": "Pass", - }, - "48__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "49__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap48", - "Type": "Pass", - }, - "49__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "50__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap49", - "Type": "Pass", - }, - "4__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "5__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap4", - "Type": "Pass", - }, - "50__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "51__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap50", - "Type": "Pass", - }, - "51__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "52__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap51", - "Type": "Pass", - }, - "52__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "53__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap52", - "Type": "Pass", - }, - "53__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "54__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap53", - "Type": "Pass", - }, - "54__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "55__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap54", - "Type": "Pass", - }, - "55__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "56__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap55", - "Type": "Pass", - }, - "56__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "57__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap56", - "Type": "Pass", - }, - "57__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "58__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap57", - "Type": "Pass", - }, - "58__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "59__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap58", - "Type": "Pass", - }, - "59__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "60__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap59", - "Type": "Pass", - }, - "5__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "6__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap5", - "Type": "Pass", - }, - "60__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "61__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap60", - "Type": "Pass", - }, - "61__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "62__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap61", - "Type": "Pass", - }, - "62__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "63__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap62", - "Type": "Pass", - }, - "63__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "64__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap63", - "Type": "Pass", - }, - "64__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "65__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap64", - "Type": "Pass", - }, - "65__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "66__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap65", - "Type": "Pass", - }, - "66__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "67__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap66", - "Type": "Pass", - }, - "67__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "68__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap67", - "Type": "Pass", - }, - "68__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "69__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap68", - "Type": "Pass", - }, - "69__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "70__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap69", - "Type": "Pass", - }, - "6__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "7__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap6", - "Type": "Pass", - }, - "70__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "71__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap70", - "Type": "Pass", - }, - "71__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "InputPath": "$.input", - "Next": "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap71", - "Type": "Pass", - }, - "72__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "Next": "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "Parameters": { - "someKey.$": "$.input", - }, - "ResultPath": "$.heap72", - "Type": "Pass", - }, - "73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ": { - "Next": "1__73__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...inpu 6", - "Parameters": { - "d0.$": "States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.JsonMerge(States.StringToJson('{"a":0,"b":2,"c":3}'),$.heap0,false),$.heap1,false),$.heap2,false),$.heap3,false),$.heap4,false)", - }, - "ResultPath": "$.heap73.out.d0.d0.d0.d0.d0.d0", - "Type": "Pass", - }, - "7__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "8__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap7", - "Type": "Pass", - }, - "8__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "9__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .", - "ResultPath": "$.heap8", - "Type": "Pass", - }, - "9__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, .": { - "InputPath": "$.input", - "Next": "10__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ", - "ResultPath": "$.heap9", - "Type": "Pass", - }, - "Initialize Functionless Context": { - "Next": "return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ...i", - "Parameters": { - "fnl_context": { - "null": null, - }, - "input.$": "$$.Execution.Input", - }, - "ResultPath": "$", - "Type": "Pass", - }, - "return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, ...i": { - "InputPath": "$.input", - "Next": "1__return {...{a: 0, b: 2, c: 3}, ...input, ...input, ...input, ...input, . 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, - }, -} -`; - -exports[`stringify json 1`] = ` -{ - "StartAt": "Initialize Functionless Context", - "States": { - "1__return JSON.stringify(input)": { - "End": true, - "InputPath": "$.heap0.out", - "ResultPath": "$", + }, +} +`; + +exports[`stringify json 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "1__return JSON.stringify(input)": { + "End": true, + "InputPath": "$.heap0.out", + "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": { @@ -18321,91 +17495,91 @@ exports[`task(any) 1`] = ` "Next": "await task("hello" + 1)", "Parameters": "hello world", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap9", + "ResultPath": null, "Type": "Task", }, "await task("hello" + 1)": { "Next": "await task(1 + "hello")", "Parameters": "hello1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap10", + "ResultPath": null, "Type": "Task", }, "await task("hello" + ["world"])": { "Next": "return null", "Parameters": "helloworld", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap23", + "ResultPath": null, "Type": "Task", }, "await task("hello" + null)": { "Next": "await task([null])", "Parameters": "hellonull", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap15", + "ResultPath": null, "Type": "Task", }, "await task("hello" + true)": { "Next": "await task(false + "hello")", "Parameters": "hellotrue", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap12", + "ResultPath": null, "Type": "Task", }, "await task("hello" + {place: "world"})": { "Next": "await task("hello" + ["world"])", "Parameters": "hello[object Object]", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap22", + "ResultPath": null, "Type": "Task", }, "await task("hello")": { "Next": "await task("hello" + " world")", "Parameters": "hello", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap8", + "ResultPath": null, "Type": "Task", }, "await task()": { "InputPath": "$.fnl_context.null", "Next": "await task(null)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "await task(-1)": { "Next": "await task(-100)", "Parameters": -1, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap5", + "ResultPath": null, "Type": "Task", }, "await task(-100)": { "Next": "await task(1 + 2)", "Parameters": -100, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap6", + "ResultPath": null, "Type": "Task", }, "await task(0)": { "Next": "await task(-1)", "Parameters": 0, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap4", + "ResultPath": null, "Type": "Task", }, "await task(1 + "hello")": { "Next": "await task("hello" + true)", "Parameters": "1hello", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap11", + "ResultPath": null, "Type": "Task", }, "await task(1 + 2)": { "Next": "await task("hello")", "Parameters": 3, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap7", + "ResultPath": null, "Type": "Task", }, "await task([-1])": { @@ -18414,7 +17588,7 @@ exports[`task(any) 1`] = ` -1, ], "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap18", + "ResultPath": null, "Type": "Task", }, "await task([1])": { @@ -18423,7 +17597,7 @@ exports[`task(any) 1`] = ` 1, ], "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap17", + "ResultPath": null, "Type": "Task", }, "await task([null])": { @@ -18432,7 +17606,7 @@ exports[`task(any) 1`] = ` null, ], "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap16", + "ResultPath": null, "Type": "Task", }, "await task([true])": { @@ -18441,7 +17615,7 @@ exports[`task(any) 1`] = ` true, ], "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap19", + "ResultPath": null, "Type": "Task", }, "await task([{key: "value"}])": { @@ -18452,42 +17626,42 @@ exports[`task(any) 1`] = ` }, ], "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap20", + "ResultPath": null, "Type": "Task", }, "await task(false + "hello")": { "Next": "await task(null + "hello")", "Parameters": "falsehello", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap13", + "ResultPath": null, "Type": "Task", }, "await task(false)": { "Next": "await task(0)", "Parameters": false, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap3", + "ResultPath": null, "Type": "Task", }, "await task(null + "hello")": { "Next": "await task("hello" + null)", "Parameters": "nullhello", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap14", + "ResultPath": null, "Type": "Task", }, "await task(null)": { "InputPath": "$.fnl_context.null", "Next": "await task(true)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "await task(true)": { "Next": "await task(false)", "Parameters": true, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Task", }, "await task({key: "value"})": { @@ -18496,7 +17670,7 @@ exports[`task(any) 1`] = ` "key": "value", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap21", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -18548,7 +17722,7 @@ exports[`template literal strings 1`] = ` " input.obj.str "hello"input.obj.items[0]": { "Next": "1__return task({key: input.obj.str "hello"input.obj.items[0]}) 1", "Parameters": { - "string.$": "States.Format('{} hello {}',$.heap0,$.heap1)", + "string.$": "States.Format('{} hello {}',$.input.obj.str,$.input.obj.items[0])", }, "ResultPath": "$.heap2", "Type": "Pass", @@ -18569,7 +17743,7 @@ exports[`template literal strings 1`] = ` "Type": "Task", }, "Initialize Functionless Context": { - "Next": "return task({key: input.obj.str "hello"input.obj.items[0]})", + "Next": " input.obj.str "hello"input.obj.items[0]", "Parameters": { "fnl_context": { "null": null, @@ -18579,18 +17753,6 @@ exports[`template literal strings 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "input.obj.items[0]": { - "InputPath": "$.input.obj.items[0]", - "Next": " input.obj.str "hello"input.obj.items[0]", - "ResultPath": "$.heap1", - "Type": "Pass", - }, - "return task({key: input.obj.str "hello"input.obj.items[0]})": { - "InputPath": "$.input.obj.str", - "Next": "input.obj.items[0]", - "ResultPath": "$.heap0", - "Type": "Pass", - }, }, } `; @@ -18599,23 +17761,17 @@ exports[`template literal strings complex 1`] = ` { "StartAt": "Initialize Functionless Context", "States": { - " hello input.obj.str ?? "default"": { - "InputPath": "$.heap0", - "Next": "input.obj.items[0] ?? await task()", - "ResultPath": "$.heap1", - "Type": "Pass", - }, " hello input.obj.str ?? "default" "hello"input.obj.items[0] ?? await task()": { "Next": "1__return task({key: hello input.obj.str ?? "default" "hello"input.obj.ite 1", "Parameters": { - "string.$": "States.Format('{} hello hello {}',$.heap1,$.heap4)", + "string.$": "States.Format('{} hello hello {}',$.heap0,$.heap3)", }, "ResultPath": "$.heap5", "Type": "Pass", }, "1__false__input.obj.items[0] ?? await task()": { "InputPath": "$.heap2", - "Next": "input.obj.items[0] ?? await task() 1", + "Next": " hello input.obj.str ?? "default" "hello"input.obj.items[0] ?? await task()", "ResultPath": "$.heap3", "Type": "Pass", }, @@ -18653,7 +17809,7 @@ exports[`template literal strings complex 1`] = ` "Type": "Task", }, "false__return task({key: hello input.obj.str ?? "default" "hello"input.obj": { - "Next": " hello input.obj.str ?? "default"", + "Next": "input.obj.items[0] ?? await task()", "Result": "default", "ResultPath": "$.heap0", "Type": "Pass", @@ -18677,12 +17833,6 @@ exports[`template literal strings complex 1`] = ` "Default": "false__input.obj.items[0] ?? await task()", "Type": "Choice", }, - "input.obj.items[0] ?? await task() 1": { - "InputPath": "$.heap3", - "Next": " hello input.obj.str ?? "default" "hello"input.obj.items[0] ?? await task()", - "ResultPath": "$.heap4", - "Type": "Pass", - }, "return task({key: hello input.obj.str ?? "default" "hello"input.obj.items[": { "Choices": [ { @@ -18704,13 +17854,13 @@ exports[`template literal strings complex 1`] = ` }, "true__input.obj.items[0] ?? await task()": { "InputPath": "$.input.obj.items[0]", - "Next": "input.obj.items[0] ?? await task() 1", + "Next": " hello input.obj.str ?? "default" "hello"input.obj.items[0] ?? await task()", "ResultPath": "$.heap3", "Type": "Pass", }, "true__return task({key: hello input.obj.str ?? "default" "hello"input.obj.": { "InputPath": "$.input.obj.str", - "Next": " hello input.obj.str ?? "default"", + "Next": "input.obj.items[0] ?? await task()", "ResultPath": "$.heap0", "Type": "Pass", }, @@ -18766,19 +17916,13 @@ exports[`throw in for-of 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "throw new Error("err")", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "throw new Error("err")", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -19043,10 +18187,10 @@ exports[`try { for-of } catch { (maybe) throw } finally { task } 1`] = ` "ResultPath": "$.fnl_tmp_0", }, ], - "InputPath": "$.item", + "InputPath": "$.heap1[0]", "Next": "tail__for(item of input.items)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch(err)": { @@ -19067,7 +18211,7 @@ exports[`try { for-of } catch { (maybe) throw } finally { task } 1`] = ` "Next": "1__finally", "Parameters": "2", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Task", }, "for(item of input.items)": { @@ -19080,7 +18224,7 @@ exports[`try { for-of } catch { (maybe) throw } finally { task } 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "await task(item)", "Variable": "$.heap1[0]", }, ], @@ -19122,12 +18266,6 @@ exports[`try { for-of } catch { (maybe) throw } finally { task } 1`] = ` "Default": "finally", "Type": "Choice", }, - "item": { - "InputPath": "$.heap1[0]", - "Next": "await task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -19194,7 +18332,7 @@ exports[`try { list.forEach(item => task(item)) } 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -19207,12 +18345,6 @@ exports[`try { list.forEach(item => task(item)) } 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return task(item)": { "Catch": [ { @@ -19223,7 +18355,7 @@ exports[`try { list.forEach(item => task(item)) } 1`] = ` "ResultPath": null, }, ], - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -19284,7 +18416,7 @@ exports[`try { list.forEach(item => task(item)) } 2`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "try", "Variable": "$.heap0.arr[0]", }, ], @@ -19297,12 +18429,6 @@ exports[`try { list.forEach(item => task(item)) } 2`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "try", - "ResultPath": "$.item", - "Type": "Pass", - }, "return input.list.forEach(function (item))": { "Next": "check__return input.list.forEach(function (item))", "Parameters": { @@ -19327,7 +18453,7 @@ exports[`try { list.forEach(item => task(item)) } 2`] = ` "ResultPath": null, }, ], - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__try", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -19423,8 +18549,10 @@ exports[`try { list.forEach(item => throw) } catch (err) 1`] = ` "Type": "Pass", }, "catch__try": { - "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", + "Parameters": { + "message": "cause", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -19549,7 +18677,7 @@ exports[`try { list.map(item => task(item)) } 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "return task(item)", "Variable": "$.heap0.arr[0]", }, ], @@ -19573,12 +18701,6 @@ exports[`try { list.map(item => task(item)) } 1`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "return task(item)", - "ResultPath": "$.item", - "Type": "Pass", - }, "return task(item)": { "Catch": [ { @@ -19589,7 +18711,7 @@ exports[`try { list.map(item => task(item)) } 1`] = ` "ResultPath": null, }, ], - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__return task(item)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -19651,7 +18773,7 @@ exports[`try { list.map(item => task(item)) } 2`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "try", "Variable": "$.heap0.arr[0]", }, ], @@ -19675,12 +18797,6 @@ exports[`try { list.map(item => task(item)) } 2`] = ` "ResultPath": "$.heap0", "Type": "Pass", }, - "item": { - "InputPath": "$.heap0.arr[0]", - "Next": "try", - "ResultPath": "$.item", - "Type": "Pass", - }, "return Promise.all(input.list.map(function (item)))": { "Next": "check__return Promise.all(input.list.map(function (item)))", "Parameters": { @@ -19706,7 +18822,7 @@ exports[`try { list.map(item => task(item)) } 2`] = ` "ResultPath": null, }, ], - "InputPath": "$.item", + "InputPath": "$.heap0.arr[0]", "Next": "1__try", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap1", @@ -19811,8 +18927,10 @@ exports[`try { list.map(item => throw) } catch (err) 1`] = ` "Type": "Pass", }, "catch__try": { - "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", + "Parameters": { + "message": "cause", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -20023,14 +19141,14 @@ exports[`try { return $SFN.parallel(() => "hello", async () => { await task(); a "InputPath": "$.fnl_context.null", "Next": "await task() 1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "await task() 1": { "InputPath": "$.fnl_context.null", "Next": "return null", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20097,7 +19215,7 @@ exports[`try { task } catch { throw } finally { task() } 1`] = ` "InputPath": "$.fnl_context.null", "Next": "finally", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch__await task()": { @@ -20112,7 +19230,7 @@ exports[`try { task } catch { throw } finally { task() } 1`] = ` "Next": "1__finally", "Parameters": "recover", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20169,7 +19287,7 @@ exports[`try { task() } catch { (maybe) throw } finally { task } 1`] = ` "Next": "finally", "Parameters": "1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch__await task("1")": { @@ -20211,7 +19329,7 @@ exports[`try { task() } catch { (maybe) throw } finally { task } 1`] = ` "Next": "1__finally", "Parameters": "2", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20275,7 +19393,7 @@ exports[`try { task() } catch { task() } finally { task() } 1`] = ` "Next": "finally", "Parameters": "1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch__await task("1")": { @@ -20291,14 +19409,14 @@ exports[`try { task() } catch { task() } finally { task() } 1`] = ` "Next": "finally", "Parameters": "2", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "finally": { "Next": "1__finally", "Parameters": "3", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap2", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20360,7 +19478,7 @@ exports[`try { task() } catch(err) { (maybe) throw } finally { task } 1`] = ` "Next": "finally", "Parameters": "1", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "catch(err)": { @@ -20381,7 +19499,7 @@ exports[`try { task() } catch(err) { (maybe) throw } finally { task } 1`] = ` "Next": "1__finally", "Parameters": "2", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "if(err.message === "sam")": { @@ -20507,7 +19625,7 @@ exports[`try { throw } catch { (maybe) throw } finally { task } 1`] = ` "InputPath": "$.fnl_context.null", "Next": "1__finally", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20571,7 +19689,7 @@ exports[`try, task, empty catch 1`] = ` "name": "name", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "return null": { @@ -20735,8 +19853,10 @@ exports[`try-catch with guaranteed throw new Error 1`] = ` "Type": "Pass", }, "catch__try": { - "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", + "Parameters": { + "message": "cause", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -20841,7 +19961,7 @@ exports[`try-catch with inner return and a catch variable 1`] = ` }, "return err.message": { "End": true, - "InputPath": "$.err.message", + "InputPath": "$.fnl_tmp_0.message", "ResultPath": "$", "Type": "Pass", }, @@ -20861,7 +19981,7 @@ exports[`try-catch with inner return and a catch variable 1`] = ` "name": "name", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, }, @@ -20910,7 +20030,7 @@ exports[`try-catch with inner return and no catch variable 1`] = ` "name": "name", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, }, @@ -20933,11 +20053,11 @@ exports[`try-catch with optional return of task 1`] = ` ], "Next": "return "hello world"", "Parameters": { - "id.$": "$.heap0", + "id.$": "$.input.id", "name": "sam", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "1__catch__try": { @@ -20957,12 +20077,6 @@ exports[`try-catch with optional return of task 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "await computeScore({id: input.id, name: "sam"})": { - "InputPath": "$.input.id", - "Next": "1__await computeScore({id: input.id, name: "sam"})", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "catch(err)": { "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", @@ -21059,7 +20173,7 @@ exports[`try-catch with optional return of task 1`] = ` ], }, ], - "Next": "await computeScore({id: input.id, name: "sam"})", + "Next": "1__await computeScore({id: input.id, name: "sam"})", }, ], "Default": "return "hello world"", @@ -21097,7 +20211,7 @@ exports[`try-catch with optional return of task 2`] = ` ], "Next": "1__return await computeScore({id: input.id, name: "sam"})", "Parameters": { - "id.$": "$.heap0", + "id.$": "$.input.id", "name": "sam", }, "Resource": "__REPLACED_TOKEN", @@ -21182,12 +20296,6 @@ exports[`try-catch with optional return of task 2`] = ` "ResultPath": "$", "Type": "Pass", }, - "return await computeScore({id: input.id, name: "sam"})": { - "InputPath": "$.input.id", - "Next": "1__return await computeScore({id: input.id, name: "sam"}) 1", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "try": { "Choices": [ { @@ -21217,7 +20325,7 @@ exports[`try-catch with optional return of task 2`] = ` ], }, ], - "Next": "return await computeScore({id: input.id, name: "sam"})", + "Next": "1__return await computeScore({id: input.id, name: "sam"}) 1", }, ], "Default": "return "hello world"", @@ -21243,11 +20351,11 @@ exports[`try-catch with optional task 1`] = ` ], "Next": "return "hello world"", "Parameters": { - "id.$": "$.heap0", + "id.$": "$.input.id", "name": "sam", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap1", + "ResultPath": null, "Type": "Task", }, "1__catch__try": { @@ -21267,12 +20375,6 @@ exports[`try-catch with optional task 1`] = ` "ResultPath": "$", "Type": "Pass", }, - "await computeScore({id: input.id, name: "sam"})": { - "InputPath": "$.input.id", - "Next": "1__await computeScore({id: input.id, name: "sam"})", - "ResultPath": "$.heap0", - "Type": "Pass", - }, "catch(err)": { "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", @@ -21369,7 +20471,7 @@ exports[`try-catch with optional task 1`] = ` ], }, ], - "Next": "await computeScore({id: input.id, name: "sam"})", + "Next": "1__await computeScore({id: input.id, name: "sam"})", }, ], "Default": "return "hello world"", @@ -21395,8 +20497,10 @@ exports[`try-catch with optional throw of an Error 1`] = ` "Type": "Pass", }, "catch__try": { - "InputPath": "$.fnl_tmp_0", "Next": "if(err.message === "cause")", + "Parameters": { + "message": "cause", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -21516,8 +20620,10 @@ exports[`try-catch, err variable, contains for-of, throw Error 1`] = ` "Type": "Pass", }, "catch__for(item of input.items)": { - "InputPath": "$.fnl_tmp_0", "Next": "return err.message", + "Parameters": { + "message": "err", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -21531,22 +20637,16 @@ exports[`try-catch, err variable, contains for-of, throw Error 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "throw Error("err")", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "throw Error("err")", - "ResultPath": "$.item", - "Type": "Pass", - }, "return err.message": { "End": true, - "InputPath": "$.err.message", + "Parameters": "err", "ResultPath": "$", "Type": "Pass", }, @@ -21584,8 +20684,10 @@ exports[`try-catch, err variable, contains for-of, throw new Error 1`] = ` "Type": "Pass", }, "catch__for(item of input.items)": { - "InputPath": "$.fnl_tmp_0", "Next": "return err.message", + "Parameters": { + "message": "err", + }, "ResultPath": "$.err", "Type": "Pass", }, @@ -21599,22 +20701,16 @@ exports[`try-catch, err variable, contains for-of, throw new Error 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "throw new Error("err")", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "throw new Error("err")", - "ResultPath": "$.item", - "Type": "Pass", - }, "return err.message": { "End": true, - "InputPath": "$.err.message", + "Parameters": "err", "ResultPath": "$", "Type": "Pass", }, @@ -21667,19 +20763,13 @@ exports[`try-catch, no variable, contains for-of, throw 1`] = ` "Choices": [ { "IsPresent": true, - "Next": "item", + "Next": "throw new Error("err")", "Variable": "$.heap0[0]", }, ], "Default": "return null", "Type": "Choice", }, - "item": { - "InputPath": "$.heap0[0]", - "Next": "throw new Error("err")", - "ResultPath": "$.item", - "Type": "Pass", - }, "return null": { "End": true, "InputPath": "$.fnl_context.null", @@ -21734,7 +20824,7 @@ exports[`try-catch-finally 1`] = ` "name": "name", }, "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, }, @@ -21868,7 +20958,7 @@ exports[`use context parameter in template 1`] = ` "Type": "Pass", }, "Initialize Functionless Context": { - "Next": "return name: context.Execution.Id", + "Next": "name: context.Execution.Id", "Parameters": { "_.$": "$$.Execution.Input", "fnl_context": { @@ -21881,17 +20971,11 @@ exports[`use context parameter in template 1`] = ` "name: context.Execution.Id": { "Next": "1__return name: context.Execution.Id", "Parameters": { - "string.$": "States.Format('name: {}',$.heap0)", + "string.$": "States.Format('name: {}',$$.Execution.Id)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "return name: context.Execution.Id": { - "InputPath": "$$.Execution.Id", - "Next": "name: context.Execution.Id", - "ResultPath": "$.heap0", - "Type": "Pass", - }, }, } `; @@ -22332,7 +21416,7 @@ exports[`while(true) { try { } catch { wait } 1`] = ` "InputPath": "$.fnl_context.null", "Next": "while (true)", "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", + "ResultPath": null, "Type": "Task", }, "while (true)": { @@ -22349,3 +21433,1325 @@ exports[`while(true) { try { } catch { wait } 1`] = ` }, } `; + +exports[`with optimizer 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "End": true, + "Parameters": { + "a.$": "$.input.obj.a", + "b.$": "$.input.arr[0]", + "c": "a", + "d": 1, + "t.$": "$.heap11.string", + "u": { + "f": "e", + }, + "v": "d", + "w.$": "$.d.c", + "x.$": "$.c.c", + "y.$": "$.b", + "z.$": "$.a", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": "a", + "ResultPath": "$.heap2", + "Type": "Pass", + }, + "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": 1, + "ResultPath": "$.heap3", + "Type": "Pass", + }, + "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": "d", + "ResultPath": "$.heap8", + "Type": "Pass", + }, + "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "Next": "this g.e 1", + "Parameters": { + "f": "e", + }, + "ResultPath": "$.heap9", + "Type": "Pass", + }, + "Initialize Functionless Context": { + "Next": "obj = {1: "a"}", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "a = "a"": { + "Next": "b = {c: ""}", + "Result": "a", + "ResultPath": "$.a", + "Type": "Pass", + }, + "a = "b"": { + "Next": "b = {c: ""}", + "Result": "b", + "ResultPath": "$.a", + "Type": "Pass", + }, + "arr = [1]": { + "Next": "if(input.x)", + "Result": [ + 1, + ], + "ResultPath": "$.arr", + "Type": "Pass", + }, + "b = {c: ""}": { + "Next": "if(input.x) 1", + "Result": { + "c": "", + }, + "ResultPath": "$.b", + "Type": "Pass", + }, + "b.c = "a"": { + "Next": "c = {c: ""}", + "Result": "a", + "ResultPath": "$.b.c", + "Type": "Pass", + }, + "b.c = "b"": { + "Next": "c = {c: ""}", + "Result": "b", + "ResultPath": "$.b.c", + "Type": "Pass", + }, + "c = {c: ""}": { + "Next": "if(input.x) 2", + "Result": { + "c": "", + }, + "ResultPath": "$.c", + "Type": "Pass", + }, + "c.c = "a"": { + "Next": "d = {c: {c: ""}}", + "Result": "a", + "ResultPath": "$.c.c", + "Type": "Pass", + }, + "c.c = "b"": { + "Next": "d = {c: {c: ""}}", + "Result": "b", + "ResultPath": "$.c.c", + "Type": "Pass", + }, + "d = {c: {c: ""}}": { + "Next": "xx = {c: "1"}", + "Result": { + "c": { + "c": "", + }, + }, + "ResultPath": "$.d", + "Type": "Pass", + }, + "d.c = xx": { + "Next": "e = {d: "d"}", + "Parameters": { + "c": "1", + }, + "ResultPath": "$.d.c", + "Type": "Pass", + }, + "d.c = yy": { + "Next": "e = {d: "d"}", + "Parameters": { + "c": "2", + }, + "ResultPath": "$.d.c", + "Type": "Pass", + }, + "e = {d: "d"}": { + "Next": "v = e.d", + "Result": { + "d": "d", + }, + "ResultPath": "$.e", + "Type": "Pass", + }, + "f = {e: {f: "e"}}": { + "Next": "u = f.e", + "Result": { + "e": { + "f": "e", + }, + }, + "ResultPath": "$.f", + "Type": "Pass", + }, + "g = {e: "f"}": { + "Next": "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Result": { + "e": "f", + }, + "ResultPath": "$.g", + "Type": "Pass", + }, + "if(input.x)": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "a = "a"", + }, + ], + "Default": "a = "b"", + "Type": "Choice", + }, + "if(input.x) 1": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "b.c = "a"", + }, + ], + "Default": "b.c = "b"", + "Type": "Choice", + }, + "if(input.x) 2": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "c.c = "a"", + }, + ], + "Default": "c.c = "b"", + "Type": "Choice", + }, + "if(input.x) 3": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "d.c = xx", + }, + ], + "Default": "d.c = yy", + "Type": "Choice", + }, + "obj = {1: "a"}": { + "Next": "arr = [1]", + "Result": { + "1": "a", + }, + "ResultPath": "$.obj", + "Type": "Pass", + }, + "this g.e 1": { + "Next": "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": { + "string.$": "States.Format('this {}','f')", + }, + "ResultPath": "$.heap11", + "Type": "Pass", + }, + "u = f.e": { + "Next": "g = {e: "f"}", + "Parameters": { + "f": "e", + }, + "ResultPath": "$.u", + "Type": "Pass", + }, + "v = e.d": { + "Next": "f = {e: {f: "e"}}", + "Parameters": "d", + "ResultPath": "$.v", + "Type": "Pass", + }, + "xx = {c: "1"}": { + "Next": "yy = {c: "2"}", + "Result": { + "c": "1", + }, + "ResultPath": "$.xx", + "Type": "Pass", + }, + "yy = {c: "2"}": { + "Next": "if(input.x) 3", + "Result": { + "c": "2", + }, + "ResultPath": "$.yy", + "Type": "Pass", + }, + }, +} +`; + +exports[`without optimizer 1`] = ` +{ + "StartAt": "Initialize Functionless Context", + "States": { + "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "End": true, + "Parameters": { + "a.$": "$.heap0", + "b.$": "$.heap1", + "c.$": "$.heap2", + "d.$": "$.heap3", + "t.$": "$.heap11.string", + "u.$": "$.heap9", + "v.$": "$.heap8", + "w.$": "$.heap7", + "x.$": "$.heap6", + "y.$": "$.heap5", + "z.$": "$.heap4", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x, 1": { + "InputPath": "$.arr2[0]", + "Next": "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap1", + "Type": "Pass", + }, + "2__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.obj['1']", + "Next": "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap2", + "Type": "Pass", + }, + "3__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.arr[0]", + "Next": "4__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap3", + "Type": "Pass", + }, + "4__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.z", + "Next": "5__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap4", + "Type": "Pass", + }, + "5__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.y", + "Next": "6__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap5", + "Type": "Pass", + }, + "6__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.x", + "Next": "7__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap6", + "Type": "Pass", + }, + "7__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.w", + "Next": "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap7", + "Type": "Pass", + }, + "8__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.v", + "Next": "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "ResultPath": "$.heap8", + "Type": "Pass", + }, + "9__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,": { + "InputPath": "$.u", + "Next": "this g.e", + "ResultPath": "$.heap9", + "Type": "Pass", + }, + "Initialize Functionless Context": { + "Next": "obj = {1: "a"}", + "Parameters": { + "fnl_context": { + "null": null, + }, + "input.$": "$$.Execution.Input", + }, + "ResultPath": "$", + "Type": "Pass", + }, + "a = "a"": { + "Next": "z = a", + "Result": "a", + "ResultPath": "$.a", + "Type": "Pass", + }, + "a = "b"": { + "Next": "z = a", + "Result": "b", + "ResultPath": "$.a", + "Type": "Pass", + }, + "arr = [1]": { + "Next": "obj2 = input.obj", + "Result": [ + 1, + ], + "ResultPath": "$.arr", + "Type": "Pass", + }, + "arr2 = input.arr": { + "InputPath": "$.input.arr", + "Next": "if(input.x)", + "ResultPath": "$.arr2", + "Type": "Pass", + }, + "b = {c: ""}": { + "Next": "if(input.x) 1", + "Result": { + "c": "", + }, + "ResultPath": "$.b", + "Type": "Pass", + }, + "b.c = "a"": { + "Next": "y = b", + "Result": "a", + "ResultPath": "$.b.c", + "Type": "Pass", + }, + "b.c = "b"": { + "Next": "y = b", + "Result": "b", + "ResultPath": "$.b.c", + "Type": "Pass", + }, + "c = {c: ""}": { + "Next": "if(input.x) 2", + "Result": { + "c": "", + }, + "ResultPath": "$.c", + "Type": "Pass", + }, + "c.c = "a"": { + "Next": "x = c.c", + "Result": "a", + "ResultPath": "$.c.c", + "Type": "Pass", + }, + "c.c = "b"": { + "Next": "x = c.c", + "Result": "b", + "ResultPath": "$.c.c", + "Type": "Pass", + }, + "d = {c: {c: ""}}": { + "Next": "xx = {c: "1"}", + "Result": { + "c": { + "c": "", + }, + }, + "ResultPath": "$.d", + "Type": "Pass", + }, + "d.c = xx": { + "InputPath": "$.xx", + "Next": "w = d.c", + "ResultPath": "$.d.c", + "Type": "Pass", + }, + "d.c = yy": { + "InputPath": "$.yy", + "Next": "w = d.c", + "ResultPath": "$.d.c", + "Type": "Pass", + }, + "e = {d: "d"}": { + "Next": "v = e.d", + "Result": { + "d": "d", + }, + "ResultPath": "$.e", + "Type": "Pass", + }, + "f = {e: {f: "e"}}": { + "Next": "u = f.e", + "Result": { + "e": { + "f": "e", + }, + }, + "ResultPath": "$.f", + "Type": "Pass", + }, + "g = {e: "f"}": { + "Next": "return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x, w:", + "Result": { + "e": "f", + }, + "ResultPath": "$.g", + "Type": "Pass", + }, + "if(input.x)": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "a = "a"", + }, + ], + "Default": "a = "b"", + "Type": "Choice", + }, + "if(input.x) 1": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "b.c = "a"", + }, + ], + "Default": "b.c = "b"", + "Type": "Choice", + }, + "if(input.x) 2": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "c.c = "a"", + }, + ], + "Default": "c.c = "b"", + "Type": "Choice", + }, + "if(input.x) 3": { + "Choices": [ + { + "And": [ + { + "And": [ + { + "IsPresent": true, + "Variable": "$.input.x", + }, + { + "IsNull": false, + "Variable": "$.input.x", + }, + ], + }, + { + "Or": [ + { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsString": true, + "Variable": "$.input.x", + }, + { + "StringEquals": "", + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "Not": { + "And": [ + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "NumericEquals": 0, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + { + "And": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "BooleanEquals": true, + "Variable": "$.input.x", + }, + ], + }, + { + "Not": { + "Or": [ + { + "IsBoolean": true, + "Variable": "$.input.x", + }, + { + "IsNumeric": true, + "Variable": "$.input.x", + }, + { + "IsString": true, + "Variable": "$.input.x", + }, + ], + }, + }, + ], + }, + ], + "Next": "d.c = xx", + }, + ], + "Default": "d.c = yy", + "Type": "Choice", + }, + "obj = {1: "a"}": { + "Next": "arr = [1]", + "Result": { + "1": "a", + }, + "ResultPath": "$.obj", + "Type": "Pass", + }, + "obj2 = input.obj": { + "InputPath": "$.input.obj", + "Next": "arr2 = input.arr", + "ResultPath": "$.obj2", + "Type": "Pass", + }, + "return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x, w:": { + "InputPath": "$.obj2.a", + "Next": "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x, 1", + "ResultPath": "$.heap0", + "Type": "Pass", + }, + "this g.e": { + "InputPath": "$.g.e", + "Next": "this g.e 1", + "ResultPath": "$.heap10", + "Type": "Pass", + }, + "this g.e 1": { + "Next": "1__return {a: obj2.a, b: arr2[0], c: obj["1"], d: arr[0], z: z, y: y, x: x,", + "Parameters": { + "string.$": "States.Format('this {}',$.heap10)", + }, + "ResultPath": "$.heap11", + "Type": "Pass", + }, + "u = f.e": { + "InputPath": "$.f.e", + "Next": "g = {e: "f"}", + "ResultPath": "$.u", + "Type": "Pass", + }, + "v = e.d": { + "InputPath": "$.e.d", + "Next": "f = {e: {f: "e"}}", + "ResultPath": "$.v", + "Type": "Pass", + }, + "w = d.c": { + "InputPath": "$.d.c", + "Next": "e = {d: "d"}", + "ResultPath": "$.w", + "Type": "Pass", + }, + "x = c.c": { + "InputPath": "$.c.c", + "Next": "d = {c: {c: ""}}", + "ResultPath": "$.x", + "Type": "Pass", + }, + "xx = {c: "1"}": { + "Next": "yy = {c: "2"}", + "Result": { + "c": "1", + }, + "ResultPath": "$.xx", + "Type": "Pass", + }, + "y = b": { + "InputPath": "$.b", + "Next": "c = {c: ""}", + "ResultPath": "$.y", + "Type": "Pass", + }, + "yy = {c: "2"}": { + "Next": "if(input.x) 3", + "Result": { + "c": "2", + }, + "ResultPath": "$.yy", + "Type": "Pass", + }, + "z = a": { + "InputPath": "$.a", + "Next": "b = {c: ""}", + "ResultPath": "$.z", + "Type": "Pass", + }, + }, +} +`; diff --git a/test/step-function.localstack.test.ts b/test/step-function.localstack.test.ts index dd56f07c..a8bfd839 100644 --- a/test/step-function.localstack.test.ts +++ b/test/step-function.localstack.test.ts @@ -72,6 +72,8 @@ runtimeTestSuite< funcRes.resource.grantStartExecution(role); funcRes.resource.grantRead(role); + console.log(JSON.stringify(funcRes.definition, null, 2)); + return { outputs: { function: funcRes.resource.stateMachineArn, @@ -1515,6 +1517,8 @@ runtimeTestSuite< a = null; const c = a; a = 1; + const j = a; + const jj = j; const d = a; a = [1, 2]; const e = a; @@ -1531,10 +1535,11 @@ runtimeTestSuite< o: { z }, }; let y = ""; - const h = [y, (y = "a"), ((y = "b"), y), y]; + z = "c"; + const h = [z, y, (y = "a"), ((y = "b"), y), y]; let x = "0"; const i = `hello ${x} ${(x = "1")} ${((x = "3"), "2")} ${x}`; - return { a, b, c, d, e, f, g, h, i }; + return { a, b, c, d, e, f, g, h, i, jj }; } ); }, @@ -1546,8 +1551,9 @@ runtimeTestSuite< e: [1, 2], f: { x: "val" }, g: { a: "", b: "a", c: "b", z: "b", t: true, o: { z: "b" } }, - h: ["", "a", "b", "b"], + h: ["c", "", "a", "b", "b"], i: "hello 0 1 2 3", + jj: 1, } ); @@ -1590,6 +1596,88 @@ runtimeTestSuite< } ); + /** + * Some test cases that exercise the optimization logic. + */ + test( + "optimize cases", + (parent) => { + return new StepFunction(parent, "sfn2", async (input) => { + const obj = { 1: "a" }; + const arr = [1]; + const obj2 = input.obj; + const arr2 = input.arr; + let a; + if (input.x) { + a = "a"; + } else { + a = "b"; + } + const z = a; + // does not optimize + let b = { c: "" }; + if (input.x) { + b.c = "a"; + } else { + b.c = "b"; + } + const y = b; + let c = { c: "" }; + if (input.x) { + c.c = "a"; + } else { + c.c = "b"; + } + const x = c.c; + let d = { c: { c: "" } }; + const xx = { c: "1" }; + const yy = { c: "2" }; + if (input.x) { + d.c = xx; + } else { + d.c = yy; + } + const w = d.c; + const e = { d: "d" }; + const v = e.d; + const f = { e: { f: "e" } }; + const u = f.e; + const g = { e: "f" }; + return { + a: obj2.a, + b: arr2[0], + c: obj["1"], + d: arr[0], + z, + y, + x, + w, + v, + u, + t: `this ${g.e}`, + }; + }); + }, + { + a: "1", + b: 0, + c: "a", + d: 1, + z: "a", + y: { c: "a" }, + x: "a", + w: { c: "1" }, + v: "d", + u: { f: "e" }, + t: "this f", + }, + { + obj: { a: "1" }, + arr: [0], + x: true, + } + ); + test( "templates", (parent) => { diff --git a/test/step-function.test.ts b/test/step-function.test.ts index 9294e58e..c30d13ab 100644 --- a/test/step-function.test.ts +++ b/test/step-function.test.ts @@ -19,6 +19,7 @@ import { SynthError, } from "../src"; import { StateMachine, States, Task } from "../src/asl"; +import { ASLOptions } from "../src/asl/synth"; import { Function } from "../src/function"; import { initStepFunctionApp, normalizeCDKJson, Person } from "./util"; /** @@ -295,13 +296,13 @@ test("let empty", () => { test("shadow", () => { const { stack } = initStepFunctionApp(); const definition = new ExpressStepFunction(stack, "fn", () => { - const a = ""; // a - const a__2 = ""; // take a future updated name, a__2 + const a = "1"; // a + const a__2 = "2"; // take a future updated name, a__2 for (const b in [1, 2, 3]) { - const a = ""; // take a future real name, a__1 - const a__1 = ""; // name already exists, will use a__1__1 - if (a === "") { - const a = ""; // a__3 + const a = "3"; // take a future real name, a__1 + const a__1 = "4"; // name already exists, will use a__1__1 + if (a === "3") { + const a = "6"; // a__3 return `${a}${b}${a__1}`; } } @@ -599,6 +600,88 @@ test("boolean logic", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); +test.each([ + ["with", undefined], + [ + "without", + { + optimization: { + joinConsecutiveChoices: false, + optimizeVariableAssignments: false, + removeNoOpStates: false, + removeUnreachableStates: false, + }, + } as ASLOptions, + ], +])("%s optimizer", (_, opt) => { + const { stack } = initStepFunctionApp(); + + const definition = new StepFunction< + { + obj: { a: string }; + arr: number[]; + x: boolean; + }, + any + >(stack, "sfn2", { asl: opt }, async (input) => { + const obj = { 1: "a" }; + const arr = [1]; + const obj2 = input.obj; + const arr2 = input.arr; + let a; + if (input.x) { + a = "a"; + } else { + a = "b"; + } + const z = a; + // does not optimize + let b = { c: "" }; + if (input.x) { + b.c = "a"; + } else { + b.c = "b"; + } + const y = b; + let c = { c: "" }; + if (input.x) { + c.c = "a"; + } else { + c.c = "b"; + } + const x = c.c; + let d = { c: { c: "" } }; + const xx = { c: "1" }; + const yy = { c: "2" }; + if (input.x) { + d.c = xx; + } else { + d.c = yy; + } + const w = d.c; + const e = { d: "d" }; + const v = e.d; + const f = { e: { f: "e" } }; + const u = f.e; + const g = { e: "f" }; + return { + a: obj2.a, + b: arr2[0], + c: obj["1"], + d: arr[0], + z, + y, + x, + w, + v, + u, + t: `this ${g.e}`, + }; + }).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); +}); + test("binary and unary unsupported", () => { const { stack } = initStepFunctionApp(); expect( @@ -845,6 +928,26 @@ test("if if", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); +test("if ifelse", () => { + const { stack } = initStepFunctionApp(); + const definition = new ExpressStepFunction( + stack, + "fn", + (input: { val: string }) => { + if (input.val !== "a") { + if (input.val === "b") { + return "hullo"; + } else { + return "wat"; + } + } + return "woop"; + } + ).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); +}); + test("if invoke", () => { const { stack, task } = initStepFunctionApp(); const definition = new ExpressStepFunction(stack, "fn", async () => { @@ -2351,6 +2454,27 @@ test("[1,2,3,4].filter(item => item > 2)", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); +test("[1,2,3,4].filter(item => item > 2) assign", () => { + const { stack } = initStepFunctionApp(); + const definition = new ExpressStepFunction(stack, "fn", async () => { + const a = [1, 2, 3, 4].filter((item) => item > 2); + return a; + }).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); +}); + +test("[1,2,3,4].filter(item => item > 2) assign obj", () => { + const { stack } = initStepFunctionApp(); + const definition = new ExpressStepFunction(stack, "fn", async () => { + return { + a: [1, 2, 3, 4].filter((item) => item > 2), + }; + }).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); +}); + test("[1,2,3,4].filter(item => item > 1 + 2)", () => { const { stack } = initStepFunctionApp(); const definition = new ExpressStepFunction(stack, "fn", async () => { @@ -2804,6 +2928,16 @@ test("$SFN.map([1, 2, 3], (item) => nitem)", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); +test("$SFN.map([1, 2, 3], (item) => naitem)", () => { + const { stack } = initStepFunctionApp(); + const definition = new ExpressStepFunction(stack, "fn", async () => { + const a = "a"; + return $SFN.map([1, 2, 3], (item) => `n${a}${item}`); + }).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); +}); + test("return $SFN.map(list, (item) => task(item))", () => { const { stack, task } = initStepFunctionApp(); const definition = new ExpressStepFunction< @@ -4227,6 +4361,37 @@ describe("binding", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); + // TODO: https://github.com/functionless/functionless/issues/420 + // https://mathiasbynens.be/notes/javascript-properties + test.skip("unicode variable names", () => { + const { stack } = initStepFunctionApp(); + const definition = new StepFunction(stack, "machine1", async () => { + var H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜ = 42; + const _ = "___"; + const $ = "$$"; + const ƒ = { + π: Math.PI, + ø: [], + Ø: NaN, + e: 2.7182818284590452353602874713527, + root2: 2.7182818284590452353602874713527, + α: 2.5029, + δ: 4.6692, + ζ: 1.2020569, + φ: 1.61803398874, + γ: 1.30357, + K: 2.685452001, + oo: 9999999999e999 * 9999999999e9999, + A: 1.2824271291, + C10: 0.12345678910111213141516171819202122232425252728293031323334353637, + c: 299792458, + }; + return { ƒ, out: `${H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜}${_}${$}` }; + }).definition; + + expect(normalizeDefinition(definition)).toMatchSnapshot(); + }); + test("for", () => { const { stack } = initStepFunctionApp(); const definition = new StepFunction(stack, "machine1", async () => {