diff --git a/src/api.ts b/src/api.ts index bfc9467c..aae67dec 100644 --- a/src/api.ts +++ b/src/api.ts @@ -12,6 +12,7 @@ import { Identifier, ReferenceExpr, ThisExpr, + UndefinedLiteralExpr, } from "./expression"; import { Function } from "./function"; import { @@ -649,7 +650,9 @@ export class APIGatewayVTL extends VTL { public eval(node: Stmt, returnVar?: string): void; public eval(node?: Expr | Stmt, returnVar?: string): string | void { if (isReturnStmt(node)) { - return this.add(this.exprToJson(node.expr)); + return this.add( + this.exprToJson(node.expr ?? node.fork(new UndefinedLiteralExpr())) + ); } else if ( isPropAccessExpr(node) && isIdentifier(node.name) && diff --git a/src/appsync.ts b/src/appsync.ts index 8e3eee6f..ac97933d 100644 --- a/src/appsync.ts +++ b/src/appsync.ts @@ -19,6 +19,7 @@ import { ReferenceExpr, StringLiteralExpr, ThisExpr, + UndefinedLiteralExpr, } from "./expression"; import { isVariableStmt, @@ -482,7 +483,10 @@ function synthesizeFunctions(api: appsync.GraphqlApi, decl: FunctionLike) { * Flatten variable declarations into multiple variable statements. */ return node.declList.decls.map( - (decl) => new VariableStmt(new VariableDeclList([decl])) + (decl) => + new VariableStmt( + new VariableDeclList([decl], node.declList.varKind) + ) ); } else if (isBinaryExpr(node)) { /** @@ -608,7 +612,9 @@ function synthesizeFunctions(api: appsync.GraphqlApi, decl: FunctionLike) { return createStage( service, `${pre ? `${pre}\n` : ""}#set( $context.stash.return__flag = true ) -#set( $context.stash.return__val = ${getResult(stmt.expr)} ) +#set( $context.stash.return__val = ${getResult( + stmt.expr ?? stmt.fork(new UndefinedLiteralExpr()) + )} ) {}` ); } else if ( @@ -683,7 +689,7 @@ function synthesizeFunctions(api: appsync.GraphqlApi, decl: FunctionLike) { } } else if (isLastExpr) { if (isReturnStmt(stmt)) { - template.return(stmt.expr); + template.return(stmt.expr ?? stmt.fork(new UndefinedLiteralExpr())); } else if (isIfStmt(stmt)) { template.eval(stmt); } else { diff --git a/src/asl.ts b/src/asl.ts index cecf17f0..e3eeb08c 100644 --- a/src/asl.ts +++ b/src/asl.ts @@ -19,15 +19,16 @@ import { Identifier, NullLiteralExpr, PropAccessExpr, - QuasiString, } from "./expression"; import { isArgument, isArrayBinding, isArrayLiteralExpr, isAwaitExpr, + isBigIntExpr, isBinaryExpr, isBindingElem, + isBindingPattern, isBlockStmt, isBooleanLiteralExpr, isBreakStmt, @@ -43,6 +44,7 @@ import { isContinueStmt, isDebuggerStmt, isDefaultClause, + isDeleteExpr, isDoStmt, isElementAccessExpr, isEmptyStmt, @@ -51,59 +53,60 @@ import { isExprStmt, isForInStmt, isForOfStmt, + isForStmt, isFunctionLike, + isGetAccessorDecl, isIdentifier, isIfStmt, + isImportKeyword, isLabelledStmt, isLiteralExpr, isMethodDecl, isNewExpr, isNode, + isNoSubstitutionTemplateLiteral, isNullLiteralExpr, isNumberLiteralExpr, isObjectBinding, isObjectLiteralExpr, + isOmittedExpr, isParameterDecl, + isParenthesizedExpr, isPostfixUnaryExpr, + isPrivateIdentifier, isPropAccessExpr, isPropAssignExpr, isPropDecl, isReferenceExpr, + isRegexExpr, isReturnStmt, + isSetAccessorDecl, isSpreadAssignExpr, isSpreadElementExpr, isStmt, isStringLiteralExpr, isSuperKeyword, isSwitchStmt, + isTaggedTemplateExpr, isTemplateExpr, + isTemplateHead, + isTemplateMiddle, + isTemplateSpan, + isTemplateTail, isThisExpr, isThrowStmt, isTryStmt, isTypeOfExpr, isUnaryExpr, isUndefinedLiteralExpr, + isVariableDecl, + isVariableDeclList, isVariableReference, isVariableStmt, + isVoidExpr, isWhileStmt, isWithStmt, - isForStmt, - isVariableDeclList, - isVariableDecl, - isPrivateIdentifier, isYieldExpr, - isBigIntExpr, - isRegexExpr, - isDeleteExpr, - isVoidExpr, - isParenthesizedExpr, - isImportKeyword, - isBindingPattern, - isSetAccessorDecl, - isGetAccessorDecl, - isTaggedTemplateExpr, - isOmittedExpr, - isQuasiString, } from "./guards"; import { IntegrationImpl, @@ -129,7 +132,7 @@ import { invertBinaryOperator, isPromiseAll, } from "./util"; -import { visitBlock, visitEachChild } from "./visit"; +import { visitEachChild } from "./visit"; export interface StateMachine { Version?: "1.0"; @@ -498,20 +501,21 @@ export class ASL { readonly role: aws_iam.IRole, decl: FunctionLike ) { - const self = this; this.decl = visitEachChild(decl, function normalizeAST(node): | FunctionlessNode | FunctionlessNode[] { if (isBlockStmt(node)) { return new BlockStmt([ // for each block statement - ...visitBlock( - node, - function normalizeBlock(stmt) { - return visitEachChild(stmt, normalizeAST); - }, - self.generatedNames - ).statements, + ...node.statements.flatMap((stmt) => { + const transformed = normalizeAST(stmt) as Stmt[]; + if (Array.isArray(transformed)) { + return transformed; + } else { + return [transformed]; + } + }), + // re-write the AST to include explicit `ReturnStmt(NullLiteral())` statements // this simplifies the interpreter code by always having a node to chain onto, even when // the AST has no final `ReturnStmt` (i.e. when the function is a void function) @@ -521,6 +525,16 @@ export class ASL { ? [new ReturnStmt(new NullLiteralExpr())] : []), ]); + } else if (isForOfStmt(node) && node.isAwait) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `Step Functions does not yet support for-await, see https://github.com/functionless/functionless/issues/390` + ); + } else if (isParameterDecl(node) && node.isRest) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `Step Functions does not yet support rest parameters, see https://github.com/functionless/functionless/issues/391` + ); } return visitEachChild(node, normalizeAST); }); @@ -968,14 +982,16 @@ export class ASL { }; }); } else if (isReturnStmt(stmt)) { - return this.evalExprToSubState(stmt.expr, (output) => - ASLGraph.passWithInput( - { - Type: "Pass", - ...returnPass, - }, - output - ) + return this.evalExprToSubState( + stmt.expr ?? stmt.fork(new NullLiteralExpr()), + (output) => + ASLGraph.passWithInput( + { + Type: "Pass", + ...returnPass, + }, + output + ) ); } else if (isVariableStmt(stmt)) { return ASLGraph.joinSubStates( @@ -1588,11 +1604,19 @@ export class ASL { if (isTemplateExpr(expr)) { return this.evalContext(expr, (evalExpr) => { - const elementOutputs = expr.spans.map((span) => - isQuasiString(span) - ? { value: span.value, containsJsonPath: false } - : evalExpr(span) - ); + const elementOutputs = [ + { + value: expr.head.text, + containsJsonPath: false, + }, + ...expr.spans.flatMap((span) => [ + evalExpr(span.expr), + { + value: span.literal.text, + containsJsonPath: false, + }, + ]), + ]; /** * Step Functions `States.Format` has a bug which fails when a jsonPath does not start with a @@ -1911,10 +1935,11 @@ export class ASL { expr.op === "-" || expr.op === "++" || expr.op === "--" || - expr.op === "~" + expr.op === "~" || + expr.op === "+" ) { throw new SynthError( - ErrorCodes.Cannot_perform_arithmetic_on_variables_in_Step_Function, + ErrorCodes.Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function, `Step Function does not support operator ${expr.op}` ); } @@ -1929,8 +1954,10 @@ export class ASL { } else if ( expr.op === "&&" || expr.op === "||" || + expr.op === "===" || expr.op === "==" || expr.op == "!=" || + expr.op == "!==" || expr.op == ">" || expr.op == "<" || expr.op == ">=" || @@ -2038,13 +2065,38 @@ export class ASL { expr.op === "-=" || expr.op === "*=" || expr.op === "/=" || - expr.op === "%=" + expr.op === "%=" || + expr.op === "&" || + expr.op === "&&=" || + expr.op === "&=" || + expr.op === "**" || + expr.op === "**=" || + expr.op === "<<" || + expr.op === "<<=" || + expr.op === ">>" || + expr.op === ">>=" || + expr.op === ">>>" || + expr.op === ">>>=" || + expr.op === "^" || + expr.op === "^=" || + expr.op === "|" || + expr.op === "|=" ) { // TODO: support string concat - https://github.com/functionless/functionless/issues/330 throw new SynthError( - ErrorCodes.Cannot_perform_arithmetic_on_variables_in_Step_Function, + ErrorCodes.Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function, `Step Function does not support operator ${expr.op}` ); + } else if ( + expr.op === "instanceof" || + // https://github.com/functionless/functionless/issues/393 + expr.op === "??=" || + expr.op === "||=" + ) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `Step Function does not support ${expr.op} operator` + ); } assertNever(expr.op); } else if (isAwaitExpr(expr)) { @@ -2731,7 +2783,11 @@ export class ASL { } else if (isBinaryExpr(expr)) { const left = toFilterCondition(expr.left); const right = toFilterCondition(expr.right); - return left && right ? `${left}${expr.op}${right}` : undefined; + return left && right + ? `${left}${ + expr.op === "===" ? "==" : expr.op === "!==" ? "!=" : expr.op + }${right}` + : undefined; } else if (isUnaryExpr(expr)) { const right = toFilterCondition(expr.expr); return right ? `${expr.op}${right}` : undefined; @@ -2812,7 +2868,9 @@ export class ASL { return undefined; }; - const expression = toFilterCondition(stmt.expr); + const expression = toFilterCondition( + stmt.expr ?? stmt.fork(new NullLiteralExpr()) + ); return expression ? { jsonPath: `${valueJsonPath.jsonPath}[?(${expression})]`, @@ -3667,10 +3725,12 @@ export class ASL { expr.op === "++" || expr.op === "--" || expr.op === "-" || - expr.op === "~" + expr.op === "~" || + // https://github.com/functionless/functionless/issues/395 + expr.op === "+" ) { throw new SynthError( - ErrorCodes.Cannot_perform_arithmetic_on_variables_in_Step_Function, + ErrorCodes.Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function, `Step Function does not support operator ${expr.op}` ); } @@ -3710,7 +3770,9 @@ export class ASL { if ( expr.op === "!=" || + expr.op === "!==" || expr.op === "==" || + expr.op === "===" || expr.op === ">" || expr.op === "<" || expr.op === ">=" || @@ -3720,9 +3782,10 @@ export class ASL { ASLGraph.isLiteralValue(leftOutput) && ASLGraph.isLiteralValue(rightOutput) ) { - return (expr.op === "==" && + return ((expr.op === "==" || expr.op === "===") && leftOutput.value === rightOutput.value) || - (expr.op === "!=" && leftOutput.value !== rightOutput.value) || + ((expr.op === "!=" || expr.op === "!==") && + leftOutput.value !== rightOutput.value) || (leftOutput.value !== null && rightOutput.value !== null && ((expr.op === ">" && leftOutput.value > rightOutput.value) || @@ -3773,12 +3836,37 @@ export class ASL { expr.op === "-=" || expr.op === "*=" || expr.op === "/=" || - expr.op === "%=" + expr.op === "%=" || + expr.op === "&" || + expr.op === "&&=" || + expr.op === "&=" || + expr.op === "**" || + expr.op === "**=" || + expr.op === "<<" || + expr.op === "<<=" || + expr.op === ">>" || + expr.op === ">>=" || + expr.op === ">>>" || + expr.op === ">>>=" || + expr.op === "^" || + expr.op === "^=" || + expr.op === "|" || + expr.op === "|=" ) { throw new SynthError( - ErrorCodes.Cannot_perform_arithmetic_on_variables_in_Step_Function, + ErrorCodes.Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function, `Step Function does not support operator ${expr.op}` ); + } else if ( + expr.op === "instanceof" || + // https://github.com/functionless/functionless/issues/393 + expr.op === "??=" || + expr.op === "||=" + ) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `Step Function does not support ${expr.op} operator` + ); } assertNever(expr.op); @@ -4788,7 +4876,7 @@ export namespace ASL { // for != use not(equals()) export const VALUE_COMPARISONS: Record< - "==" | ">" | ">=" | "<=" | "<", + "===" | "==" | ">" | ">=" | "<=" | "<", Record<"string" | "boolean" | "number", keyof Condition | undefined> > = { "==": { @@ -4796,6 +4884,11 @@ export namespace ASL { boolean: "BooleanEquals", number: "NumericEquals", }, + "===": { + string: "StringEquals", + boolean: "BooleanEquals", + number: "NumericEquals", + }, "<": { string: "StringLessThan", boolean: undefined, @@ -4859,10 +4952,11 @@ export namespace ASL { export const compare = ( left: ASLGraph.JsonPath, right: ASLGraph.Output, - operator: keyof typeof VALUE_COMPARISONS | "!=" + operator: keyof typeof VALUE_COMPARISONS | "!=" | "!==" ): Condition => { if ( operator === "==" || + operator === "===" || operator === ">" || operator === "<" || operator === ">=" || @@ -4891,7 +4985,7 @@ export namespace ASL { ); } return ASL.and(ASL.isPresent(left.jsonPath), condition); - } else if (operator === "!=") { + } else if (operator === "!=" || operator === "!==") { return ASL.not(ASL.compare(left, right, "==")); } @@ -4902,7 +4996,7 @@ export namespace ASL { export const stringCompare = ( left: ASLGraph.JsonPath, right: ASLGraph.Output, - operator: "==" | ">" | "<" | "<=" | ">=" + operator: "===" | "==" | ">" | "<" | "<=" | ">=" ) => { if (ASLGraph.isJsonPath(right) || typeof right.value === "string") { return ASL.and( @@ -4927,7 +5021,7 @@ export namespace ASL { export const numberCompare = ( left: ASLGraph.JsonPath, right: ASLGraph.Output, - operator: "==" | ">" | "<" | "<=" | ">=" + operator: "===" | "==" | ">" | "<" | "<=" | ">=" ) => { if (ASLGraph.isJsonPath(right) || typeof right.value === "number") { return ASL.and( @@ -4952,7 +5046,7 @@ export namespace ASL { export const booleanCompare = ( left: ASLGraph.JsonPath, right: ASLGraph.Output, - operator: "==" | ">" | "<" | "<=" | ">=" + operator: "===" | "==" | ">" | "<" | "<=" | ">=" ) => { if (ASLGraph.isJsonPath(right) || typeof right.value === "boolean") { return ASL.and( @@ -4977,9 +5071,9 @@ export namespace ASL { export const nullCompare = ( left: ASLGraph.JsonPath, right: ASLGraph.Output, - operator: "==" | ">" | "<" | "<=" | ">=" + operator: "===" | "==" | ">" | "<" | "<=" | ">=" ) => { - if (operator === "==") { + if (operator === "==" || operator === "===") { if (ASLGraph.isJsonPath(right)) { return ASL.and(ASL.isNull(left.jsonPath), ASL.isNull(right.jsonPath)); } else if (right.value === null) { @@ -5013,7 +5107,7 @@ function toStateName(node: FunctionlessNode): string { } } function inner(node: Exclude): string { - if (isExpr(node) || isQuasiString(node)) { + if (isExpr(node)) { return nodeToString(node); } else if (isIfStmt(node)) { return `if(${nodeToString(node.when)})`; @@ -5102,7 +5196,11 @@ function toStateName(node: FunctionlessNode): string { isSuperKeyword(node) || isSwitchStmt(node) || isWithStmt(node) || - isYieldExpr(node) + isYieldExpr(node) || + isTemplateHead(node) || + isTemplateMiddle(node) || + isTemplateTail(node) || + isTemplateSpan(node) ) { throw new SynthError( ErrorCodes.Unsupported_Feature, @@ -5117,13 +5215,7 @@ function toStateName(node: FunctionlessNode): string { } function nodeToString( - expr?: - | Expr - | ParameterDecl - | BindingName - | BindingElem - | VariableDecl - | QuasiString + expr?: Expr | ParameterDecl | BindingName | BindingElem | VariableDecl ): string { if (!expr) { return ""; @@ -5206,9 +5298,11 @@ function nodeToString( } else if (isStringLiteralExpr(expr)) { return `"${expr.value}"`; } else if (isTemplateExpr(expr)) { - return `\`${expr.spans - .map((e) => (isStringLiteralExpr(e) ? e.value : nodeToString(e))) - .join("")}\``; + return `${expr.head.text}${expr.spans + .map((span) => `\${${nodeToString(span.expr)}}${span.literal.text}`) + .join("")}`; + } else if (isNoSubstitutionTemplateLiteral(expr)) { + return `\`${expr.text}\``; } else if (isTypeOfExpr(expr)) { return `typeof ${nodeToString(expr.expr)}`; } else if (isUnaryExpr(expr)) { @@ -5261,8 +5355,6 @@ function nodeToString( ); } else if (isOmittedExpr(expr)) { return "undefined"; - } else if (isQuasiString(expr)) { - return expr.value; } else { return assertNever(expr); } diff --git a/src/compile.ts b/src/compile.ts index 2f07c6bd..9f629ccd 100644 --- a/src/compile.ts +++ b/src/compile.ts @@ -1,10 +1,16 @@ +/* eslint-disable no-bitwise */ import path from "path"; import minimatch from "minimatch"; import type { PluginConfig, TransformerExtras } from "ts-patch"; import ts from "typescript"; import { assertDefined } from "./assert"; import { makeFunctionlessChecker } from "./checker"; -import type { ConstructorDecl, FunctionDecl, MethodDecl } from "./declaration"; +import { + ConstructorDecl, + FunctionDecl, + MethodDecl, + VariableDeclKind, +} from "./declaration"; import { ErrorCodes, SynthError } from "./error-code"; import type { FunctionExpr, @@ -327,9 +333,12 @@ export function compile( impl.parameters.map((param) => newExpr(NodeKind.ParameterDecl, [ toExpr(param.name, scope ?? impl), - ...(param.initializer - ? [toExpr(param.initializer, scope ?? impl)] - : []), + param.initializer + ? toExpr(param.initializer, scope ?? impl) + : ts.factory.createIdentifier("undefined"), + param.dotDotDotToken + ? ts.factory.createTrue() + : ts.factory.createFalse(), ]) ) ), @@ -483,6 +492,13 @@ export function compile( ts.factory.createArrayLiteralExpression( node.declarations.map((decl) => toExpr(decl, scope)) ), + ts.factory.createNumericLiteral( + (node.flags & ts.NodeFlags.Const) !== 0 + ? VariableDeclKind.Const + : (node.flags & ts.NodeFlags.Let) !== 0 + ? VariableDeclKind.Let + : VariableDeclKind.Var + ), ]); } else if (ts.isVariableDeclaration(node)) { return newExpr(NodeKind.VariableDecl, [ @@ -491,7 +507,9 @@ export function compile( ts.factory.createStringLiteral(node.name.text), ]) : toExpr(node.name, scope), - ...(node.initializer ? [toExpr(node.initializer, scope)] : []), + node.initializer + ? toExpr(node.initializer, scope) + : ts.factory.createIdentifier("undefined"), ]); } else if (ts.isIfStatement(node)) { return newExpr(NodeKind.IfStmt, [ @@ -537,7 +555,7 @@ export function compile( toExpr(node.left, scope), ts.factory.createStringLiteral( assertDefined( - getBinaryOperator(node.operatorToken), + ts.tokenToString(node.operatorToken.kind) as BinaryOp, `Binary operator token cannot be stringified: ${node.operatorToken.kind}` ) ), @@ -547,7 +565,7 @@ export function compile( return newExpr(NodeKind.UnaryExpr, [ ts.factory.createStringLiteral( assertDefined( - getPrefixUnaryOperator(node.operator), + ts.tokenToString(node.operator) as UnaryOp, `Unary operator token cannot be stringified: ${node.operator}` ) ), @@ -557,7 +575,7 @@ export function compile( return newExpr(NodeKind.PostfixUnaryExpr, [ ts.factory.createStringLiteral( assertDefined( - getPostfixUnaryOperator(node.operator), + ts.tokenToString(node.operator) as PostfixUnaryOp, `Unary operator token cannot be stringified: ${node.operator}` ) ), @@ -566,9 +584,7 @@ export function compile( } else if (ts.isReturnStatement(node)) { return newExpr( NodeKind.ReturnStmt, - node.expression - ? [toExpr(node.expression, scope)] - : [newExpr(NodeKind.NullLiteralExpr, [])] + node.expression ? [toExpr(node.expression, scope)] : [] ); } else if (ts.isObjectLiteralExpression(node)) { return newExpr(NodeKind.ObjectLiteralExpr, [ @@ -648,12 +664,20 @@ export function compile( "For in/of loops initializers should be an identifier or variable declaration." ); } + return newExpr( ts.isForOfStatement(node) ? NodeKind.ForOfStmt : NodeKind.ForInStmt, [ toExpr(decl, scope), toExpr(node.expression, scope), toExpr(node.statement, scope), + ...(ts.isForOfStatement(node) + ? [ + node.awaitModifier + ? ts.factory.createTrue() + : ts.factory.createFalse(), + ] + : []), ] ); } else if (ts.isForStatement(node)) { @@ -663,34 +687,49 @@ export function compile( toExpr(node.condition, scope), toExpr(node.incrementor, scope), ]); - } else if ( - ts.isTemplateExpression(node) || - ts.isTaggedTemplateExpression(node) - ) { - const template = ts.isTemplateExpression(node) ? node : node.template; - const exprs = []; - if (ts.isNoSubstitutionTemplateLiteral(template)) { - return newExpr(NodeKind.TaggedTemplateExpr, [quasi(template.text)]); - } - if (template.head.text) { - exprs.push(quasi(template.head.text)); - } - for (const span of template.templateSpans) { - exprs.push(toExpr(span.expression, scope)); - if (span.literal.text) { - exprs.push(quasi(span.literal.text)); - } - } - return newExpr( - ts.isTemplateExpression(node) - ? NodeKind.TemplateExpr - : NodeKind.TaggedTemplateExpr, - [ts.factory.createArrayLiteralExpression(exprs)] - ); + } else if (ts.isTemplateExpression(node)) { + return newExpr(NodeKind.TemplateExpr, [ + // head + toExpr(node.head, scope), + // spans + ts.factory.createArrayLiteralExpression( + node.templateSpans.map((span) => toExpr(span, scope)) + ), + ]); + } else if (ts.isTaggedTemplateExpression(node)) { + return newExpr(NodeKind.TaggedTemplateExpr, [ + toExpr(node.tag, scope), + toExpr(node.template, scope), + ]); + } else if (ts.isNoSubstitutionTemplateLiteral(node)) { + return newExpr(NodeKind.NoSubstitutionTemplateLiteral, [ + ts.factory.createStringLiteral(node.text), + ]); + } else if (ts.isTemplateSpan(node)) { + return newExpr(NodeKind.TemplateSpan, [ + toExpr(node.expression, scope), + toExpr(node.literal, scope), + ]); + } else if (ts.isTemplateHead(node)) { + return newExpr(NodeKind.TemplateHead, [ + ts.factory.createStringLiteral(node.text), + ]); + } else if (ts.isTemplateMiddle(node)) { + return newExpr(NodeKind.TemplateMiddle, [ + ts.factory.createStringLiteral(node.text), + ]); + } else if (ts.isTemplateTail(node)) { + return newExpr(NodeKind.TemplateTail, [ + ts.factory.createStringLiteral(node.text), + ]); } else if (ts.isBreakStatement(node)) { - return newExpr(NodeKind.BreakStmt, []); + return newExpr(NodeKind.BreakStmt, [ + ...(node.label ? [toExpr(node.label, scope)] : []), + ]); } else if (ts.isContinueStatement(node)) { - return newExpr(NodeKind.ContinueStmt, []); + return newExpr(NodeKind.ContinueStmt, [ + ...(node.label ? [toExpr(node.label, scope)] : []), + ]); } else if (ts.isTryStatement(node)) { return newExpr(NodeKind.TryStmt, [ toExpr(node.tryBlock, scope), @@ -804,10 +843,12 @@ export function compile( return newExpr(NodeKind.DebuggerStmt, []); } else if (ts.isLabeledStatement(node)) { return newExpr(NodeKind.LabelledStmt, [ + toExpr(node.label, scope), toExpr(node.statement, scope), ]); } else if (ts.isSwitchStatement(node)) { return newExpr(NodeKind.SwitchStmt, [ + toExpr(node.expression, scope), ts.factory.createArrayLiteralExpression( node.caseBlock.clauses.map((clause) => toExpr(clause, scope)) ), @@ -879,12 +920,6 @@ export function compile( } } - function quasi(literal: string): ts.Expression { - return newExpr(NodeKind.QuasiString, [ - ts.factory.createStringLiteral(literal), - ]); - } - function string(literal: string): ts.Expression { return newExpr(NodeKind.StringLiteralExpr, [ ts.factory.createStringLiteral(literal), @@ -901,31 +936,6 @@ export function compile( }; } -function getBinaryOperator(op: ts.BinaryOperatorToken): BinaryOp | undefined { - return ( - BinaryOperatorRemappings[ - op.kind as keyof typeof BinaryOperatorRemappings - ] ?? (ts.tokenToString(op.kind) as BinaryOp) - ); -} - -function getPrefixUnaryOperator( - op: ts.PrefixUnaryOperator -): UnaryOp | undefined { - return ts.tokenToString(op) as UnaryOp | undefined; -} - -function getPostfixUnaryOperator( - op: ts.PostfixUnaryOperator -): PostfixUnaryOp | undefined { - return ts.tokenToString(op) as PostfixUnaryOp | undefined; -} - -const BinaryOperatorRemappings: Record = { - [ts.SyntaxKind.EqualsEqualsEqualsToken]: "==", - [ts.SyntaxKind.ExclamationEqualsEqualsToken]: "!=", -} as const; - function param(name: string, spread: boolean = false) { return ts.factory.createParameterDeclaration( undefined, diff --git a/src/declaration.ts b/src/declaration.ts index 55d7903d..d57021be 100644 --- a/src/declaration.ts +++ b/src/declaration.ts @@ -209,10 +209,20 @@ export class ParameterDecl extends BaseDecl< NodeKind.ParameterDecl, ArrowFunctionExpr | FunctionDecl | FunctionExpr | SetAccessorDecl > { - constructor(readonly name: BindingName, readonly initializer?: Expr) { + constructor( + readonly name: BindingName, + readonly initializer: Expr | undefined, + /** + * Whether this ParameterDecl is a rest parameter + * ```ts + * function foo(...rest) {} + * ``` + */ readonly isRest: boolean + ) { super(NodeKind.ParameterDecl, arguments); this.ensure(name, "name", NodeKind.BindingNames); this.ensure(initializer, "initializer", ["undefined", "Expr"]); + this.ensure(isRest, "isRest", ["boolean"]); } } @@ -347,6 +357,12 @@ export type VariableDeclParent = | ForOfStmt | VariableDeclList; +export enum VariableDeclKind { + Const = 0, + Let = 1, + Var = 2, +} + export class VariableDecl< E extends Expr | undefined = Expr | undefined > extends BaseDecl { @@ -365,7 +381,10 @@ export class VariableDeclList extends BaseNode< > { readonly nodeKind: "Node" = "Node"; - constructor(readonly decls: VariableDecl[]) { + constructor( + readonly decls: VariableDecl[], + readonly varKind: VariableDeclKind + ) { super(NodeKind.VariableDeclList, arguments); this.ensureArrayOf(decls, "decls", [NodeKind.VariableDecl]); } diff --git a/src/error-code.ts b/src/error-code.ts index 96c67415..e4ab420a 100644 --- a/src/error-code.ts +++ b/src/error-code.ts @@ -90,7 +90,7 @@ export namespace ErrorCodes { * }); * ``` */ - export const Cannot_perform_arithmetic_on_variables_in_Step_Function: ErrorCode = + export const Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function: ErrorCode = { code: 10000, type: ErrorType.ERROR, diff --git a/src/event-bridge/event-pattern/synth.ts b/src/event-bridge/event-pattern/synth.ts index 5b00282a..4d337bbe 100644 --- a/src/event-bridge/event-pattern/synth.ts +++ b/src/event-bridge/event-pattern/synth.ts @@ -129,6 +129,15 @@ export const synthesizePatternDocument = ( ): PatternDocument => { const func = validateFunctionLike(predicate, "synthesizeEventPattern"); + func.parameters.forEach(({ isRest }) => { + if (isRest) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `Event Bridge does not yet support rest parameters, see https://github.com/functionless/functionless/issues/391` + ); + } + }); + const [eventDecl = undefined] = func.parameters; const evalExpr = (expr: Expr): PatternDocument => { @@ -154,9 +163,9 @@ export const synthesizePatternDocument = ( }; const evalBinary = (expr: BinaryExpr): PatternDocument => { - if (expr.op === "==") { + if (expr.op === "==" || expr.op === "===") { return evalEquals(expr); - } else if (expr.op === "!=") { + } else if (expr.op === "!=" || expr.op === "!==") { return evalNotEquals(expr); } else if ([">", ">=", "<", "<="].includes(expr.op)) { return evalNumericRange(expr); diff --git a/src/event-bridge/target-input.ts b/src/event-bridge/target-input.ts index c9287830..d4615895 100644 --- a/src/event-bridge/target-input.ts +++ b/src/event-bridge/target-input.ts @@ -21,7 +21,6 @@ import { isParenthesizedExpr, isPropAccessExpr, isPropAssignExpr, - isQuasiString, isReferenceExpr, isStringLiteralExpr, isTemplateExpr, @@ -197,10 +196,14 @@ export const synthesizeEventBridgeTargets = ( } } else if (isTemplateExpr(expr)) { return { - value: expr.spans - .map((x) => (isQuasiString(x) ? x.value : exprToStringLiteral(x))) - .join(""), type: "string", + value: [ + expr.head.text, + ...expr.spans.flatMap((span) => [ + exprToStringLiteral(span.expr), + span.literal.text, + ]), + ].join(""), }; } else if (isObjectLiteralExpr(expr) || isArrayLiteralExpr(expr)) { return exprToObject(expr); diff --git a/src/event-bridge/utils.ts b/src/event-bridge/utils.ts index a69899fb..8f22d6f1 100644 --- a/src/event-bridge/utils.ts +++ b/src/event-bridge/utils.ts @@ -13,7 +13,11 @@ import { PropAssignExpr, StringLiteralExpr, TemplateExpr, + TemplateMiddle, + TemplateSpan, + TemplateTail, UnaryExpr, + UndefinedLiteralExpr, } from "../expression"; import { isArrayLiteralExpr, @@ -28,18 +32,18 @@ import { isParenthesizedExpr, isPropAccessExpr, isPropAssignExpr, - isQuasiString, isReturnStmt, isSetAccessorDecl, isSpreadElementExpr, isStringLiteralExpr, isTemplateExpr, + isTemplateMiddle, isUnaryExpr, isVariableStmt, } from "../guards"; import { NodeKind } from "../node-kind"; import { Stmt, VariableStmt } from "../statement"; -import { Constant, evalToConstant } from "../util"; +import { evalToConstant } from "../util"; /** * Returns a string array representing the property access starting from a named identity. @@ -249,24 +253,34 @@ export const flattenExpression = (expr: Expr, scope: EventScope): Expr => { }, [] as PropAssignExpr[]) ); } else if (isTemplateExpr(expr)) { - const flattenedExpressions = expr.spans.map((x) => - isQuasiString(x) ? x : flattenExpression(x, scope) + const flattenedExpressions = expr.spans.map( + (x) => [flattenExpression(x.expr, scope), x.literal.text] as const ); - const flattenedConstants = flattenedExpressions.map((e) => - evalToConstant(e) + const flattenedConstants = flattenedExpressions.map( + (e) => [evalToConstant(e[0]), e[1]] as const ); - const allConstants = flattenedConstants.every((c) => !!c); + const allConstants = flattenedConstants.every((c) => !!c[0]); // when all of values are constants, turn them into a string constant now. return allConstants ? new StringLiteralExpr( - (flattenedConstants).map((e) => e.constant).join("") + [ + expr.head.text, + ...flattenedConstants.flatMap((e) => [e[0]!.constant, e[1]]), + ].join("") ) : new TemplateExpr( - expr.spans.map((x) => - isQuasiString(x) ? x : flattenExpression(x, scope) - ) + expr.head.clone(), + expr.spans.map( + (span) => + new TemplateSpan( + flattenExpression(span.expr, scope), + isTemplateMiddle(span.literal) + ? new TemplateMiddle(span.literal.text) + : new TemplateTail(span.literal.text) + ) + ) as [...TemplateSpan[], TemplateSpan] ); } else { return expr; @@ -351,7 +365,10 @@ export const flattenReturnEvent = (stmts: Stmt[]) => { throw Error("No return statement found in event bridge target function."); } - return flattenExpression(ret.expr, scope); + return flattenExpression( + ret.expr ?? ret.fork(new UndefinedLiteralExpr()), + scope + ); }; // to prevent the closure serializer from trying to import all of functionless. diff --git a/src/expression.ts b/src/expression.ts index 06a4aafb..cc16f6d4 100644 --- a/src/expression.ts +++ b/src/expression.ts @@ -41,6 +41,7 @@ export type Expr = | FunctionExpr | Identifier | NewExpr + | NoSubstitutionTemplateLiteralExpr | NullLiteralExpr | NumberLiteralExpr | ObjectLiteralExpr @@ -220,17 +221,14 @@ export class ElementAccessExpr extends BaseExpr { super(NodeKind.ElementAccessExpr, arguments); this.ensure(expr, "expr", ["Expr"]); this.ensure(element, "element", ["Expr"]); + this.ensure(isOptional, "isOptional", ["undefined", "boolean"]); } } export class Argument extends BaseExpr { - constructor(readonly expr?: Expr) { + constructor(readonly expr: Expr) { super(NodeKind.Argument, arguments); - this.ensure(expr, "element", ["undefined", "Expr"]); - } - - public clone(): this { - return new Argument(this.expr?.clone()) as this; + this.ensure(expr, "element", ["Expr"]); } } @@ -262,19 +260,74 @@ export class ConditionExpr extends BaseExpr { } } -export type ValueComparisonBinaryOp = "==" | "!=" | "<" | "<=" | ">" | ">="; -export type MathBinaryOp = "/" | "*" | "+" | "-" | "%"; -export type MutationMathBinaryOp = "+=" | "*=" | "-=" | "/=" | "%="; -export type ComparatorOp = "&&" | "||" | "??"; +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#arithmetic_operators + */ +export type ArithmeticOp = "+" | "-" | "/" | "*" | "%" | "**"; -export type BinaryOp = - | MathBinaryOp - | MutationMathBinaryOp - | ValueComparisonBinaryOp - | ComparatorOp - | "," +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#assignment_operators + */ +export type AssignmentOp = | "=" - | "in"; + | "*=" + | "**=" + | "/=" + | "%=" + | "+=" + | "-=" + | "<<=" + | ">>=" + | ">>>=" + | "&=" + | "^=" + | "|=" + | "&&=" + | "||=" + | "??="; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#binary_logical_operators + */ +export type BinaryLogicalOp = "&&" | "||" | "??"; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators + */ +export type BitwiseShiftOp = "<<" | ">>" | ">>>"; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#binary_bitwise_operators + */ +export type BitwiseBinaryOp = "&" | "|" | "^"; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#comma_operator + */ +export type CommaOp = ","; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#equality_operators + */ +export type EqualityOp = "==" | "!=" | "===" | "!=="; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#relational_operators + */ +export type RelationalOp = "in" | "instanceof" | "<" | ">" | "<=" | ">="; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators + */ +export type BinaryOp = + | ArithmeticOp + | AssignmentOp + | BinaryLogicalOp + | BitwiseShiftOp + | BitwiseBinaryOp + | CommaOp + | EqualityOp + | RelationalOp; export class BinaryExpr extends BaseExpr { constructor( @@ -288,8 +341,15 @@ export class BinaryExpr extends BaseExpr { } } +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#increment_and_decrement + */ export type PostfixUnaryOp = "--" | "++"; -export type UnaryOp = "!" | "-" | "~" | PostfixUnaryOp; + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#unary_operators + */ +export type UnaryOp = "!" | "+" | "-" | "~" | PostfixUnaryOp; export class UnaryExpr extends BaseExpr { constructor(readonly op: UnaryOp, readonly expr: Expr) { @@ -436,47 +496,132 @@ export class SpreadElementExpr extends BaseExpr< } } +export type TemplateLiteral = TemplateExpr | NoSubstitutionTemplateLiteralExpr; + /** - * A quasi string in a {@link TemplateExpr} or {@link TaggedTemplateExpr}. + * A Template literal with no substitutions. * * ```ts - * const s = `abc${def}` - * // ^ quasi + * `has no substitutions` * ``` */ -export class QuasiString extends BaseNode { - readonly nodeKind = "Node"; - constructor(readonly value: string) { - super(NodeKind.QuasiString, arguments); +export class NoSubstitutionTemplateLiteralExpr extends BaseExpr { + constructor(readonly text: string) { + super(NodeKind.NoSubstitutionTemplateLiteral, arguments); + this.ensure(text, "text", ["string"]); } } /** - * A span of text within a {@link TemplateExpr} or {@link TaggedTemplateExpr}. + * A template expression. * * ```ts - * const s = `quasi ${expr}` - * // ^ Quasi string - * const s = `quasi ${expr}` - * // ^ expression to splice + * `(${expr})* * ``` */ -export type TemplateSpan = QuasiString | Expr; - -/** - * Interpolates a TemplateExpr to a string `this ${is} a template expression` - */ export class TemplateExpr extends BaseExpr { - constructor(readonly spans: TemplateSpan[]) { + constructor( + /** + * The literal text prefix of the template. + * ``` + * `head${expr}` // "head" + * `${expr}` // "" + * ``` + */ + readonly head: TemplateHead, + /** + * A chain of {@link TemplateSpan}s. The last {@link TemplateSpan}'s `literal` is always a + * {@link TemplateTail} and the former are always {@link TemplateMiddle}s. + */ + readonly spans: [ + ...TemplateSpan[], + TemplateSpan + ] + ) { super(NodeKind.TemplateExpr, arguments); - this.ensureArrayOf(spans, "span", [NodeKind.QuasiString, "Expr"]); + this.ensure(head, "head", [NodeKind.TemplateHead]); + this.ensureArrayOf(spans, "spans", [NodeKind.TemplateSpan]); } } +/** + * A tagged template expression. + * + * ```ts + * `(${expr})* + * ``` + */ export class TaggedTemplateExpr extends BaseExpr { - constructor(readonly tag: Expr, readonly spans: TemplateSpan[]) { + constructor(readonly tag: Expr, readonly template: TemplateLiteral) { super(NodeKind.TaggedTemplateExpr, arguments); - this.ensureArrayOf(spans, "span", [NodeKind.QuasiString, "Expr"]); + this.ensure(tag, "tag", ["Expr"]); + this.ensure(template, "template", [ + NodeKind.TemplateExpr, + NodeKind.NoSubstitutionTemplateLiteral, + ]); + } +} + +/** + * The first quasi string at the beginning of a {@link TemplateExpr}. + * + * ```ts + * const s = `abc${def}` + * // ^ TemplateHead + * ``` + * + * Is empty in the case when there is no head quasi: + * ```ts + * `${abc}` + * // TemplateHead is "". + * ``` + */ +export class TemplateHead extends BaseNode { + readonly nodeKind = "Node"; + + constructor(readonly text: string) { + super(NodeKind.TemplateHead, arguments); + this.ensure(text, "text", ["string"]); + } +} + +/** + * A span of text and expression within a {@link TemplateExpr} or {@link TaggedTemplateExpr}. + * + * ```ts + * `${expr}` + * ``` + */ +export class TemplateSpan< + Literal extends TemplateMiddle | TemplateTail = TemplateMiddle | TemplateTail +> extends BaseNode { + readonly nodeKind = "Node"; + + constructor(readonly expr: Expr, readonly literal: Literal) { + super(NodeKind.TemplateSpan, arguments); + this.ensure(expr, "expr", ["Expr"]); + this.ensure(literal, "literal", [ + NodeKind.TemplateMiddle, + NodeKind.TemplateTail, + ]); + } +} + +export class TemplateMiddle extends BaseNode { + readonly nodeKind = "Node"; + + constructor(readonly text: string) { + super(NodeKind.TemplateMiddle, arguments); + this.ensure(text, "text", ["string"]); + } +} + +export class TemplateTail extends BaseNode { + readonly nodeKind = "Node"; + + constructor(readonly text: string) { + super(NodeKind.TemplateTail, arguments); + this.ensure(text, "text", ["string"]); } } diff --git a/src/guards.ts b/src/guards.ts index 2773bc23..4e34477d 100644 --- a/src/guards.ts +++ b/src/guards.ts @@ -33,6 +33,9 @@ export const isFunctionExpr = typeGuard(NodeKind.FunctionExpr); export const isIdentifier = typeGuard(NodeKind.Identifier); export const isImportKeyword = typeGuard(NodeKind.ImportKeyword); export const isNewExpr = typeGuard(NodeKind.NewExpr); +export const isNoSubstitutionTemplateLiteral = typeGuard( + NodeKind.NoSubstitutionTemplateLiteral +); export const isNullLiteralExpr = typeGuard(NodeKind.NullLiteralExpr); export const isNumberLiteralExpr = typeGuard(NodeKind.NumberLiteralExpr); export const isObjectLiteralExpr = typeGuard(NodeKind.ObjectLiteralExpr); @@ -42,7 +45,6 @@ export const isPostfixUnaryExpr = typeGuard(NodeKind.PostfixUnaryExpr); export const isPrivateIdentifier = typeGuard(NodeKind.PrivateIdentifier); export const isPropAccessExpr = typeGuard(NodeKind.PropAccessExpr); export const isPropAssignExpr = typeGuard(NodeKind.PropAssignExpr); -export const isQuasiString = typeGuard(NodeKind.QuasiString); export const isReferenceExpr = typeGuard(NodeKind.ReferenceExpr); export const isRegexExpr = typeGuard(NodeKind.RegexExpr); export const isSpreadAssignExpr = typeGuard(NodeKind.SpreadAssignExpr); @@ -79,6 +81,11 @@ export const isLiteralPrimitiveExpr = typeGuard( NodeKind.StringLiteralExpr ); +export const isTemplateHead = typeGuard(NodeKind.TemplateHead); +export const isTemplateSpan = typeGuard(NodeKind.TemplateSpan); +export const isTemplateMiddle = typeGuard(NodeKind.TemplateMiddle); +export const isTemplateTail = typeGuard(NodeKind.TemplateTail); + export function isStmt(a: any): a is Stmt { return isNode(a) && a.nodeKind === "Stmt"; } diff --git a/src/node-ctor.ts b/src/node-ctor.ts index 3b00d7af..a6f1d2b4 100644 --- a/src/node-ctor.ts +++ b/src/node-ctor.ts @@ -33,6 +33,7 @@ import { Identifier, ImportKeyword, NewExpr, + NoSubstitutionTemplateLiteralExpr, NullLiteralExpr, NumberLiteralExpr, ObjectLiteralExpr, @@ -42,7 +43,6 @@ import { PrivateIdentifier, PropAccessExpr, PropAssignExpr, - QuasiString, ReferenceExpr, RegexExpr, SpreadAssignExpr, @@ -51,6 +51,10 @@ import { SuperKeyword, TaggedTemplateExpr, TemplateExpr, + TemplateHead, + TemplateMiddle, + TemplateSpan, + TemplateTail, ThisExpr, TypeOfExpr, UnaryExpr, @@ -110,7 +114,11 @@ export const declarations = { [NodeKind.SetAccessorDecl]: SetAccessorDecl, [NodeKind.VariableDecl]: VariableDecl, [NodeKind.VariableDeclList]: VariableDeclList, - [NodeKind.QuasiString]: QuasiString, + [NodeKind.TemplateHead]: TemplateHead, + [NodeKind.TemplateSpan]: TemplateSpan, + [NodeKind.TemplateMiddle]: TemplateMiddle, + [NodeKind.TemplateTail]: TemplateTail, + [NodeKind.NoSubstitutionTemplateLiteral]: NoSubstitutionTemplateLiteralExpr, } as const; export const error = { diff --git a/src/node-kind.ts b/src/node-kind.ts index 7099c732..caa57a88 100644 --- a/src/node-kind.ts +++ b/src/node-kind.ts @@ -76,7 +76,11 @@ export enum NodeKind { WhileStmt = 76, WithStmt = 77, YieldExpr = 78, - QuasiString = 79, + TemplateHead = 79, + TemplateSpan = 80, + TemplateMiddle = 81, + TemplateTail = 82, + NoSubstitutionTemplateLiteral = 83, } export namespace NodeKind { diff --git a/src/node.ts b/src/node.ts index 095976a5..89271d37 100644 --- a/src/node.ts +++ b/src/node.ts @@ -16,8 +16,12 @@ import type { Err } from "./error"; import type { Expr, ImportKeyword, - QuasiString, + NoSubstitutionTemplateLiteralExpr, SuperKeyword, + TemplateHead, + TemplateMiddle, + TemplateSpan, + TemplateTail, } from "./expression"; import { isBindingElem, @@ -48,11 +52,15 @@ export type FunctionlessNode = | Expr | Stmt | Err - | SuperKeyword - | ImportKeyword | BindingPattern - | VariableDeclList - | QuasiString; + | ImportKeyword + | NoSubstitutionTemplateLiteralExpr + | SuperKeyword + | TemplateHead + | TemplateMiddle + | TemplateSpan + | TemplateTail + | VariableDeclList; export interface HasParent { get parent(): Parent; @@ -118,7 +126,7 @@ export abstract class BaseNode< * * This function simply sets the {@link node}'s parent and returns it. */ - public fork(node: N): N { + public fork(node: N): N { // @ts-ignore node.parent = this; return node; diff --git a/src/statement.ts b/src/statement.ts index 80a79b2d..fa7e1f88 100644 --- a/src/statement.ts +++ b/src/statement.ts @@ -54,20 +54,14 @@ export abstract class BaseStmt< export class ExprStmt extends BaseStmt { constructor(readonly expr: Expr) { super(NodeKind.ExprStmt, arguments); - } - - public clone(): this { - return new ExprStmt(this.expr.clone()) as this; + this.ensure(expr, "expr", ["Expr"]); } } export class VariableStmt extends BaseStmt { constructor(readonly declList: VariableDeclList) { super(NodeKind.VariableStmt, arguments); - } - - public clone(): this { - return new VariableStmt(this.declList.clone()) as this; + this.ensure(declList, "declList", [NodeKind.VariableDeclList]); } } @@ -86,16 +80,13 @@ export type BlockStmtParent = export class BlockStmt extends BaseStmt { constructor(readonly statements: Stmt[]) { super(NodeKind.BlockStmt, arguments); + this.ensureArrayOf(statements, "statements", ["Stmt"]); statements.forEach((stmt, i) => { stmt.prev = i > 0 ? statements[i - 1] : undefined; stmt.next = i + 1 < statements.length ? statements[i + 1] : undefined; }); } - public clone(): this { - return new BlockStmt(this.statements.map((stmt) => stmt.clone())) as this; - } - public isFinallyBlock(): this is FinallyBlock { return isTryStmt(this.parent) && this.parent.finallyBlock === this; } @@ -126,28 +117,18 @@ export class BlockStmt extends BaseStmt { } export class ReturnStmt extends BaseStmt { - constructor(readonly expr: Expr) { + constructor(readonly expr: Expr | undefined) { super(NodeKind.ReturnStmt, arguments); - } - - public clone(): this { - return new ReturnStmt(this.expr.clone()) as this; + this.ensure(expr, "expr", ["undefined", "Expr"]); } } export class IfStmt extends BaseStmt { constructor(readonly when: Expr, readonly then: Stmt, readonly _else?: Stmt) { super(NodeKind.IfStmt, arguments); - if (_else) { - } - } - - public clone(): this { - return new IfStmt( - this.when.clone(), - this.then.clone(), - this._else?.clone() - ) as this; + this.ensure(when, "when", ["Expr"]); + this.ensure(then, "then", ["Stmt"]); + this.ensure(_else, "else", ["undefined", "Stmt"]); } } @@ -155,17 +136,22 @@ export class ForOfStmt extends BaseStmt { constructor( readonly initializer: VariableDecl | Identifier, readonly expr: Expr, - readonly body: BlockStmt + readonly body: BlockStmt, + /** + * Whether this is a for-await-of statement + * ```ts + * for await (const a of b) { .. } + * ``` + */ + readonly isAwait: boolean ) { super(NodeKind.ForOfStmt, arguments); - } - - public clone(): this { - return new ForOfStmt( - this.initializer.clone(), - this.expr.clone(), - this.body.clone() - ) as this; + this.ensure(initializer, "initializer", [ + NodeKind.VariableDecl, + NodeKind.Identifier, + ]); + this.ensure(expr, "expr", ["Expr"]); + this.ensure(isAwait, "isAwait", ["boolean"]); } } @@ -177,14 +163,6 @@ export class ForInStmt extends BaseStmt { ) { super(NodeKind.ForInStmt, arguments); } - - public clone(): this { - return new ForInStmt( - this.initializer.clone(), - this.expr.clone(), - this.body.clone() - ) as this; - } } export class ForStmt extends BaseStmt { @@ -195,36 +173,28 @@ export class ForStmt extends BaseStmt { readonly incrementor?: Expr ) { super(NodeKind.ForStmt, arguments); - // validate - } - - public clone(): this { - return new ForStmt( - this.body.clone(), - this.initializer?.clone(), - this.condition?.clone(), - this.incrementor?.clone() - ) as this; + this.ensure(body, "body", [NodeKind.BlockStmt]); + this.ensure(initializer, "initializer", [ + "undefined", + "Expr", + NodeKind.VariableDeclList, + ]); + this.ensure(condition, "condition", ["undefined", "Expr"]); + this.ensure(incrementor, "incrementor", ["undefined", "Expr"]); } } export class BreakStmt extends BaseStmt { - constructor() { + constructor(readonly label?: Identifier) { super(NodeKind.BreakStmt, arguments); - } - - public clone(): this { - return new BreakStmt() as this; + this.ensure(label, "label", ["undefined", NodeKind.Identifier]); } } export class ContinueStmt extends BaseStmt { - constructor() { + constructor(readonly label?: Identifier) { super(NodeKind.ContinueStmt, arguments); - } - - public clone(): this { - return new ContinueStmt() as this; + this.ensure(label, "label", ["undefined", NodeKind.Identifier]); } } @@ -291,9 +261,9 @@ export class DoStmt extends BaseStmt { } export class LabelledStmt extends BaseStmt { - constructor(readonly label: string, readonly stmt: Stmt) { + constructor(readonly label: Identifier, readonly stmt: Stmt) { super(NodeKind.LabelledStmt, arguments); - this.ensure(label, "label", ["string"]); + this.ensure(label, "label", [NodeKind.Identifier]); this.ensure(stmt, "stmt", ["Stmt"]); } } @@ -305,8 +275,9 @@ export class DebuggerStmt extends BaseStmt { } export class SwitchStmt extends BaseStmt { - constructor(readonly clauses: SwitchClause[]) { + constructor(readonly expr: Expr, readonly clauses: SwitchClause[]) { super(NodeKind.SwitchStmt, arguments); + this.ensure(expr, "expr", ["Expr"]); this.ensureArrayOf(clauses, "clauses", NodeKind.SwitchClause); } } diff --git a/src/step-function.ts b/src/step-function.ts index d46753ea..fff94166 100644 --- a/src/step-function.ts +++ b/src/step-function.ts @@ -325,6 +325,7 @@ export namespace $SFN { if (callbackfn === undefined || !isFunctionLike(callbackfn)) { throw new Error("missing callbackfn in $SFN.map"); } + const callbackStates = context.evalStmt( callbackfn.body, // when a return statement is hit, end the sub-machine in the map and return the given value. diff --git a/src/util.ts b/src/util.ts index 4dbf2b4b..64845172 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,12 +1,6 @@ import { Construct } from "constructs"; import ts from "typescript"; -import { - BinaryOp, - CallExpr, - Expr, - PropAccessExpr, - QuasiString, -} from "./expression"; +import { BinaryOp, CallExpr, Expr, PropAccessExpr } from "./expression"; import { isArrayLiteralExpr, isBinaryExpr, @@ -16,13 +10,13 @@ import { isForOfStmt, isFunctionLike, isIdentifier, + isNoSubstitutionTemplateLiteral, isNullLiteralExpr, isNumberLiteralExpr, isObjectLiteralExpr, isPrivateIdentifier, isPropAccessExpr, isPropAssignExpr, - isQuasiString, isReferenceExpr, isSpreadAssignExpr, isSpreadElementExpr, @@ -206,18 +200,17 @@ export function isConstant(x: any): x is Constant { * const obj = { val: "hello" }; * obj.val -> { constant: "hello" } */ -export const evalToConstant = ( - expr: Expr | QuasiString -): Constant | undefined => { +export const evalToConstant = (expr: Expr): Constant | undefined => { if ( isStringLiteralExpr(expr) || isNumberLiteralExpr(expr) || isBooleanLiteralExpr(expr) || isNullLiteralExpr(expr) || - isUndefinedLiteralExpr(expr) || - isQuasiString(expr) + isUndefinedLiteralExpr(expr) ) { return { constant: expr.value }; + } else if (isNoSubstitutionTemplateLiteral(expr)) { + return { constant: expr.text }; } else if (isArrayLiteralExpr(expr)) { const array = []; for (const item of expr.items) { @@ -321,11 +314,16 @@ export const evalToConstant = ( } } } else if (isTemplateExpr(expr)) { - const values = expr.spans.map(evalToConstant); - if (values.every((v): v is Constant => !!v)) { - return { constant: values.map((v) => v.constant).join("") }; + const components: any[] = [expr.head.text]; + for (const span of expr.spans) { + const exprVal = evalToConstant(span.expr); + if (exprVal === undefined) { + // can only evaluate templates if all expressions are constants + return undefined; + } + components.push(exprVal.constant, span.literal.text); } - return undefined; + return { constant: components.map((v) => v).join("") }; } return undefined; }; diff --git a/src/validate.ts b/src/validate.ts index 6e3e4bf7..e79654ab 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -154,7 +154,7 @@ export function validate( return [ newError( node, - ErrorCodes.Cannot_perform_arithmetic_on_variables_in_Step_Function + ErrorCodes.Cannot_perform_arithmetic_or_bitwise_computations_on_variables_in_Step_Function ), ]; } else if (ts.isCallExpression(node)) { diff --git a/src/visit.ts b/src/visit.ts index 9dc6c118..f181079b 100644 --- a/src/visit.ts +++ b/src/visit.ts @@ -1,4 +1,8 @@ -import { VariableDecl, VariableDeclList } from "./declaration"; +import { + VariableDecl, + VariableDeclKind, + VariableDeclList, +} from "./declaration"; import { Expr, Identifier } from "./expression"; import { isNode } from "./guards"; import { FunctionlessNode } from "./node"; @@ -73,7 +77,10 @@ export function visitBlock( function hoist(expr: Expr): Identifier { const id = new Identifier(nameGenerator.generateOrGet(expr)); const stmt = new VariableStmt( - new VariableDeclList([new VariableDecl(id.clone(), expr.clone())]) + new VariableDeclList( + [new VariableDecl(id.clone(), expr.clone())], + VariableDeclKind.Const + ) ); nestedTasks.push(stmt); return id; diff --git a/src/vtl.ts b/src/vtl.ts index c163d965..75f955c6 100644 --- a/src/vtl.ts +++ b/src/vtl.ts @@ -56,6 +56,7 @@ import { isLabelledStmt, isMethodDecl, isNewExpr, + isNoSubstitutionTemplateLiteral, isNullLiteralExpr, isNumberLiteralExpr, isObjectLiteralExpr, @@ -67,7 +68,6 @@ import { isPropAccessExpr, isPropAssignExpr, isPropDecl, - isQuasiString, isReferenceExpr, isRegexExpr, isReturnStmt, @@ -364,7 +364,9 @@ export abstract class VTL { // VTL fails to evaluate binary expressions inside an object put e.g. $obj.put('x', 1 + 1) // a workaround is to use a temp variable. return this.var( - `${this.eval(node.left)} ${node.op} ${this.eval(node.right)}` + `${this.eval(node.left)} ${ + node.op === "===" ? "==" : node.op === "!==" ? "!=" : node.op + } ${this.eval(node.right)}` ); } else if (isBlockStmt(node)) { for (const stmt of node.statements) { @@ -461,6 +463,9 @@ export abstract class VTL { node.args[0]?.expr, ...NodeKind.FunctionLike ); + + fn.parameters.forEach(validateParameterDecl); + const initialValue = node.args[1]; // (previousValue: string[], currentValue: string, currentIndex: number, array: string[]) @@ -578,6 +583,12 @@ export abstract class VTL { } else if (isExprStmt(node)) { return this.qr(this.eval(node.expr)); } else if (isForInStmt(node) || isForOfStmt(node)) { + if (isForOfStmt(node) && node.isAwait) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `VTL does not support for-await, see https://github.com/functionless/functionless/issues/390` + ); + } this.foreach( node.initializer, `${this.eval(node.expr)}${isForInStmt(node) ? ".keySet()" : ""}`, @@ -645,18 +656,17 @@ export abstract class VTL { // handled inside ObjectLiteralExpr } else if (isStringLiteralExpr(node)) { return this.str(node.value); + } else if (isNoSubstitutionTemplateLiteral(node)) { + return this.str(node.text); } else if (isTemplateExpr(node)) { - return `"${node.spans + return `"${node.head.text}${node.spans .map((expr) => { - if (isQuasiString(expr) || isStringLiteralExpr(expr)) { - return expr.value; - } - const text = this.eval(expr, returnVar); + const text = this.eval(expr.expr, returnVar); if (text.startsWith("$")) { - return `\${${text.slice(1)}}`; + return `\${${text.slice(1)}}${expr.literal.text}`; } else { const varName = this.var(text); - return `\${${varName.slice(1)}}`; + return `\${${varName.slice(1)}}${expr.literal.text}`; } }) .join("")}"`; @@ -748,6 +758,9 @@ export abstract class VTL { */ public evalDecl(decl: Decl, initialValueVar?: string) { if (isVariableDecl(decl) || isParameterDecl(decl) || isBindingElem(decl)) { + if (isParameterDecl(decl)) { + validateParameterDecl(decl); + } const variablePrefix = isInTopLevelScope(decl) ? `$context.stash.` : `$`; if (isBindingPattern(decl.name)) { if (!(decl.initializer || initialValueVar)) { @@ -1087,8 +1100,26 @@ export abstract class VTL { * Returns the [value, index, array] arguments if this CallExpr is a `forEach` or `map` call. */ const getMapForEachArgs = (call: CallExpr) => { - return assertNodeKind(call.args[0].expr, ...NodeKind.FunctionLike).parameters; + const parameters = assertNodeKind( + call.args[0].expr, + ...NodeKind.FunctionLike + ).parameters; + for (const param of parameters) { + validateParameterDecl(param); + } + return parameters; }; +function validateParameterDecl( + decl: ParameterDecl | undefined +): asserts decl is ParameterDecl & { isRest: false } { + if (decl?.isRest) { + throw new SynthError( + ErrorCodes.Unsupported_Feature, + `VTL does not support rest parameters, see https://github.com/functionless/functionless/issues/391` + ); + } +} + // to prevent the closure serializer from trying to import all of functionless. export const deploymentOnlyModule = true; diff --git a/test-app/src/message-board.ts b/test-app/src/message-board.ts index 4cacfe9c..8cd04186 100644 --- a/test-app/src/message-board.ts +++ b/test-app/src/message-board.ts @@ -301,10 +301,10 @@ const deleteWorkflow = new StepFunction<{ postId: string }, void>( } ); -export const deletePost = new AppsyncResolver< +export const deletePost: AppsyncResolver< { postId: string }, AWS.StepFunctions.StartExecutionOutput | undefined ->( +> = new AppsyncResolver( stack, "deletePost", { diff --git a/test/__snapshots__/step-function.localstack.test.ts.snap b/test/__snapshots__/step-function.localstack.test.ts.snap index c89b83c0..98ac8ca6 100644 --- a/test/__snapshots__/step-function.localstack.test.ts.snap +++ b/test/__snapshots__/step-function.localstack.test.ts.snap @@ -491,15 +491,15 @@ Object { "Default": "assignFalse__!input.x", "Type": "Choice", }, - "\\"a\\" != \\"a\\"": Object { + "\\"a\\" !== \\"a\\"": Object { "Choices": Array [ Object { "IsNull": true, - "Next": "assignTrue__\\"a\\" != \\"a\\"", + "Next": "assignTrue__\\"a\\" !== \\"a\\"", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__\\"a\\" != \\"a\\"", + "Default": "assignFalse__\\"a\\" !== \\"a\\"", "Type": "Choice", }, "\\"a\\" < \\"a\\"": Object { @@ -579,10 +579,10 @@ Object { "Default": "assignFalse__\\"b\\" in input.obj", "Type": "Choice", }, - "\\"val2\\" != input.v": Object { + "\\"val2\\" !== input.v": Object { "Choices": Array [ Object { - "Next": "assignTrue__\\"val2\\" != input.v", + "Next": "assignTrue__\\"val2\\" !== input.v", "Not": Object { "And": Array [ Object { @@ -605,7 +605,7 @@ Object { }, }, ], - "Default": "assignFalse__\\"val2\\" != input.v", + "Default": "assignFalse__\\"val2\\" !== input.v", "Type": "Choice", }, "\\"val2\\" < input.v": Object { @@ -662,7 +662,7 @@ Object { "Default": "assignFalse__\\"val2\\" <= input.v", "Type": "Choice", }, - "\\"val2\\" == input.v": Object { + "\\"val2\\" === input.v": Object { "Choices": Array [ Object { "And": Array [ @@ -683,10 +683,10 @@ Object { ], }, ], - "Next": "assignTrue__\\"val2\\" == input.v", + "Next": "assignTrue__\\"val2\\" === input.v", }, ], - "Default": "assignFalse__\\"val2\\" == input.v", + "Default": "assignFalse__\\"val2\\" === input.v", "Type": "Choice", }, "\\"val2\\" > input.v": Object { @@ -743,15 +743,15 @@ Object { "Default": "assignFalse__\\"val2\\" >= input.v", "Type": "Choice", }, - "1 != 1": Object { + "1 !== 1": Object { "Choices": Array [ Object { "IsNull": true, - "Next": "assignTrue__1 != 1", + "Next": "assignTrue__1 !== 1", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__1 != 1", + "Default": "assignFalse__1 !== 1", "Type": "Choice", }, "1 < 1": Object { @@ -776,15 +776,15 @@ Object { "Default": "assignFalse__1 <= 1", "Type": "Choice", }, - "1 == 1": Object { + "1 === 1": Object { "Choices": Array [ Object { "IsNull": false, - "Next": "assignTrue__1 == 1", + "Next": "assignTrue__1 === 1", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__1 == 1", + "Default": "assignFalse__1 === 1", "Type": "Choice", }, "1 > 1": Object { @@ -809,7 +809,7 @@ Object { "Default": "assignFalse__1 >= 1", "Type": "Choice", }, - "1__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEquals: inp": Object { + "1__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringEquals: in": Object { "End": true, "Parameters": Object { "constantBooleanEquals.$": "$.heap48", @@ -888,10 +888,10 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "3 != input.n": Object { + "3 !== input.n": Object { "Choices": Array [ Object { - "Next": "assignTrue__3 != input.n", + "Next": "assignTrue__3 !== input.n", "Not": Object { "And": Array [ Object { @@ -914,7 +914,7 @@ Object { }, }, ], - "Default": "assignFalse__3 != input.n", + "Default": "assignFalse__3 !== input.n", "Type": "Choice", }, "3 < input.n": Object { @@ -971,7 +971,7 @@ Object { "Default": "assignFalse__3 <= input.n", "Type": "Choice", }, - "3 == input.n": Object { + "3 === input.n": Object { "Choices": Array [ Object { "And": Array [ @@ -992,10 +992,10 @@ Object { ], }, ], - "Next": "assignTrue__3 == input.n", + "Next": "assignTrue__3 === input.n", }, ], - "Default": "assignFalse__3 == input.n", + "Default": "assignFalse__3 === input.n", "Type": "Choice", }, "3 > input.n": Object { @@ -1053,7 +1053,7 @@ Object { "Type": "Choice", }, "Initialize Functionless Context": Object { - "Next": "return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEquals: input.", + "Next": "return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringEquals: input", "Parameters": Object { "fnl_context": Object { "null": null, @@ -1088,13 +1088,13 @@ Object { "Type": "Pass", }, "assignFalse__!input.x": Object { - "Next": "1__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEquals: inp", + "Next": "1__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringEquals: in", "Result": false, "ResultPath": "$.heap71", "Type": "Pass", }, - "assignFalse__\\"a\\" != \\"a\\"": Object { - "Next": "input.v != \\"val\\"", + "assignFalse__\\"a\\" !== \\"a\\"": Object { + "Next": "input.v !== \\"val\\"", "Result": false, "ResultPath": "$.heap4", "Type": "Pass", @@ -1141,8 +1141,8 @@ Object { "ResultPath": "$.heap66", "Type": "Pass", }, - "assignFalse__\\"val2\\" != input.v": Object { - "Next": "input.v != input.v", + "assignFalse__\\"val2\\" !== input.v": Object { + "Next": "input.v !== input.v", "Result": false, "ResultPath": "$.heap6", "Type": "Pass", @@ -1159,8 +1159,8 @@ Object { "ResultPath": "$.heap14", "Type": "Pass", }, - "assignFalse__\\"val2\\" == input.v": Object { - "Next": "input.v == input.v", + "assignFalse__\\"val2\\" === input.v": Object { + "Next": "input.v === input.v", "Result": false, "ResultPath": "$.heap2", "Type": "Pass", @@ -1177,8 +1177,8 @@ Object { "ResultPath": "$.heap22", "Type": "Pass", }, - "assignFalse__1 != 1": Object { - "Next": "input.n != 2", + "assignFalse__1 !== 1": Object { + "Next": "input.n !== 2", "Result": false, "ResultPath": "$.heap28", "Type": "Pass", @@ -1195,8 +1195,8 @@ Object { "ResultPath": "$.heap36", "Type": "Pass", }, - "assignFalse__1 == 1": Object { - "Next": "input.n == 2", + "assignFalse__1 === 1": Object { + "Next": "input.n === 2", "Result": false, "ResultPath": "$.heap24", "Type": "Pass", @@ -1213,8 +1213,8 @@ Object { "ResultPath": "$.heap44", "Type": "Pass", }, - "assignFalse__3 != input.n": Object { - "Next": "input.n != input.n", + "assignFalse__3 !== input.n": Object { + "Next": "input.n !== input.n", "Result": false, "ResultPath": "$.heap30", "Type": "Pass", @@ -1231,8 +1231,8 @@ Object { "ResultPath": "$.heap38", "Type": "Pass", }, - "assignFalse__3 == input.n": Object { - "Next": "input.n == input.n", + "assignFalse__3 === input.n": Object { + "Next": "input.n === input.n", "Result": false, "ResultPath": "$.heap26", "Type": "Pass", @@ -1249,49 +1249,49 @@ Object { "ResultPath": "$.heap46", "Type": "Pass", }, - "assignFalse__false != input.a": Object { - "Next": "input.a != input.a", + "assignFalse__false !== input.a": Object { + "Next": "input.a !== input.a", "Result": false, "ResultPath": "$.heap54", "Type": "Pass", }, - "assignFalse__false == input.a": Object { - "Next": "input.a == input.a", + "assignFalse__false === input.a": Object { + "Next": "input.a === input.a", "Result": false, "ResultPath": "$.heap50", "Type": "Pass", }, - "assignFalse__input.a != input.a": Object { - "Next": "null == null", + "assignFalse__input.a !== input.a": Object { + "Next": "null === null", "Result": false, "ResultPath": "$.heap55", "Type": "Pass", }, - "assignFalse__input.a != true": Object { - "Next": "false != input.a", + "assignFalse__input.a !== true": Object { + "Next": "false !== input.a", "Result": false, "ResultPath": "$.heap53", "Type": "Pass", }, - "assignFalse__input.a == input.a": Object { - "Next": "true != true", + "assignFalse__input.a === input.a": Object { + "Next": "true !== true", "Result": false, "ResultPath": "$.heap51", "Type": "Pass", }, - "assignFalse__input.a == true": Object { - "Next": "false == input.a", + "assignFalse__input.a === true": Object { + "Next": "false === input.a", "Result": false, "ResultPath": "$.heap49", "Type": "Pass", }, - "assignFalse__input.n != 2": Object { - "Next": "3 != input.n", + "assignFalse__input.n !== 2": Object { + "Next": "3 !== input.n", "Result": false, "ResultPath": "$.heap29", "Type": "Pass", }, - "assignFalse__input.n != input.n": Object { + "assignFalse__input.n !== input.n": Object { "Next": "1 < 1", "Result": false, "ResultPath": "$.heap31", @@ -1321,14 +1321,14 @@ Object { "ResultPath": "$.heap39", "Type": "Pass", }, - "assignFalse__input.n == 2": Object { - "Next": "3 == input.n", + "assignFalse__input.n === 2": Object { + "Next": "3 === input.n", "Result": false, "ResultPath": "$.heap25", "Type": "Pass", }, - "assignFalse__input.n == input.n": Object { - "Next": "1 != 1", + "assignFalse__input.n === input.n": Object { + "Next": "1 !== 1", "Result": false, "ResultPath": "$.heap27", "Type": "Pass", @@ -1352,48 +1352,48 @@ Object { "Type": "Pass", }, "assignFalse__input.n >= input.n": Object { - "Next": "true == true", + "Next": "true === true", "Result": false, "ResultPath": "$.heap47", "Type": "Pass", }, - "assignFalse__input.nv != input.nv": Object { + "assignFalse__input.nv !== input.nv": Object { "Next": "\\"a\\" in {a: \\"val\\"}", "Result": false, "ResultPath": "$.heap63", "Type": "Pass", }, - "assignFalse__input.nv != null": Object { - "Next": "input.v != input.nv", + "assignFalse__input.nv !== null": Object { + "Next": "input.v !== input.nv", "Result": false, "ResultPath": "$.heap61", "Type": "Pass", }, - "assignFalse__input.nv == input.nv": Object { - "Next": "null != null", + "assignFalse__input.nv === input.nv": Object { + "Next": "null !== null", "Result": false, "ResultPath": "$.heap59", "Type": "Pass", }, - "assignFalse__input.nv == null": Object { - "Next": "input.v == input.nv", + "assignFalse__input.nv === null": Object { + "Next": "input.v === input.nv", "Result": false, "ResultPath": "$.heap57", "Type": "Pass", }, - "assignFalse__input.v != \\"val\\"": Object { - "Next": "\\"val2\\" != input.v", + "assignFalse__input.v !== \\"val\\"": Object { + "Next": "\\"val2\\" !== input.v", "Result": false, "ResultPath": "$.heap5", "Type": "Pass", }, - "assignFalse__input.v != input.nv": Object { - "Next": "input.nv != input.nv", + "assignFalse__input.v !== input.nv": Object { + "Next": "input.nv !== input.nv", "Result": false, "ResultPath": "$.heap62", "Type": "Pass", }, - "assignFalse__input.v != input.v": Object { + "assignFalse__input.v !== input.v": Object { "Next": "\\"a\\" < \\"a\\"", "Result": false, "ResultPath": "$.heap7", @@ -1423,20 +1423,20 @@ Object { "ResultPath": "$.heap15", "Type": "Pass", }, - "assignFalse__input.v == \\"val\\"": Object { - "Next": "\\"val2\\" == input.v", + "assignFalse__input.v === \\"val\\"": Object { + "Next": "\\"val2\\" === input.v", "Result": false, "ResultPath": "$.heap1", "Type": "Pass", }, - "assignFalse__input.v == input.nv": Object { - "Next": "input.nv == input.nv", + "assignFalse__input.v === input.nv": Object { + "Next": "input.nv === input.nv", "Result": false, "ResultPath": "$.heap58", "Type": "Pass", }, - "assignFalse__input.v == input.v": Object { - "Next": "\\"a\\" != \\"a\\"", + "assignFalse__input.v === input.v": Object { + "Next": "\\"a\\" !== \\"a\\"", "Result": false, "ResultPath": "$.heap3", "Type": "Pass", @@ -1460,37 +1460,37 @@ Object { "Type": "Pass", }, "assignFalse__input.v >= input.v": Object { - "Next": "1 == 1", + "Next": "1 === 1", "Result": false, "ResultPath": "$.heap23", "Type": "Pass", }, - "assignFalse__null != null": Object { - "Next": "input.nv != null", + "assignFalse__null !== null": Object { + "Next": "input.nv !== null", "Result": false, "ResultPath": "$.heap60", "Type": "Pass", }, - "assignFalse__null == null": Object { - "Next": "input.nv == null", + "assignFalse__null === null": Object { + "Next": "input.nv === null", "Result": false, "ResultPath": "$.heap56", "Type": "Pass", }, - "assignFalse__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringE": Object { - "Next": "input.v == \\"val\\"", + "assignFalse__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarString": Object { + "Next": "input.v === \\"val\\"", "Result": false, "ResultPath": "$.heap0", "Type": "Pass", }, - "assignFalse__true != true": Object { - "Next": "input.a != true", + "assignFalse__true !== true": Object { + "Next": "input.a !== true", "Result": false, "ResultPath": "$.heap52", "Type": "Pass", }, - "assignFalse__true == true": Object { - "Next": "input.a == true", + "assignFalse__true === true": Object { + "Next": "input.a === true", "Result": false, "ResultPath": "$.heap48", "Type": "Pass", @@ -1520,13 +1520,13 @@ Object { "Type": "Pass", }, "assignTrue__!input.x": Object { - "Next": "1__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEquals: inp", + "Next": "1__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringEquals: in", "Result": true, "ResultPath": "$.heap71", "Type": "Pass", }, - "assignTrue__\\"a\\" != \\"a\\"": Object { - "Next": "input.v != \\"val\\"", + "assignTrue__\\"a\\" !== \\"a\\"": Object { + "Next": "input.v !== \\"val\\"", "Result": true, "ResultPath": "$.heap4", "Type": "Pass", @@ -1573,8 +1573,8 @@ Object { "ResultPath": "$.heap66", "Type": "Pass", }, - "assignTrue__\\"val2\\" != input.v": Object { - "Next": "input.v != input.v", + "assignTrue__\\"val2\\" !== input.v": Object { + "Next": "input.v !== input.v", "Result": true, "ResultPath": "$.heap6", "Type": "Pass", @@ -1591,8 +1591,8 @@ Object { "ResultPath": "$.heap14", "Type": "Pass", }, - "assignTrue__\\"val2\\" == input.v": Object { - "Next": "input.v == input.v", + "assignTrue__\\"val2\\" === input.v": Object { + "Next": "input.v === input.v", "Result": true, "ResultPath": "$.heap2", "Type": "Pass", @@ -1609,8 +1609,8 @@ Object { "ResultPath": "$.heap22", "Type": "Pass", }, - "assignTrue__1 != 1": Object { - "Next": "input.n != 2", + "assignTrue__1 !== 1": Object { + "Next": "input.n !== 2", "Result": true, "ResultPath": "$.heap28", "Type": "Pass", @@ -1627,8 +1627,8 @@ Object { "ResultPath": "$.heap36", "Type": "Pass", }, - "assignTrue__1 == 1": Object { - "Next": "input.n == 2", + "assignTrue__1 === 1": Object { + "Next": "input.n === 2", "Result": true, "ResultPath": "$.heap24", "Type": "Pass", @@ -1645,8 +1645,8 @@ Object { "ResultPath": "$.heap44", "Type": "Pass", }, - "assignTrue__3 != input.n": Object { - "Next": "input.n != input.n", + "assignTrue__3 !== input.n": Object { + "Next": "input.n !== input.n", "Result": true, "ResultPath": "$.heap30", "Type": "Pass", @@ -1663,8 +1663,8 @@ Object { "ResultPath": "$.heap38", "Type": "Pass", }, - "assignTrue__3 == input.n": Object { - "Next": "input.n == input.n", + "assignTrue__3 === input.n": Object { + "Next": "input.n === input.n", "Result": true, "ResultPath": "$.heap26", "Type": "Pass", @@ -1681,49 +1681,49 @@ Object { "ResultPath": "$.heap46", "Type": "Pass", }, - "assignTrue__false != input.a": Object { - "Next": "input.a != input.a", + "assignTrue__false !== input.a": Object { + "Next": "input.a !== input.a", "Result": true, "ResultPath": "$.heap54", "Type": "Pass", }, - "assignTrue__false == input.a": Object { - "Next": "input.a == input.a", + "assignTrue__false === input.a": Object { + "Next": "input.a === input.a", "Result": true, "ResultPath": "$.heap50", "Type": "Pass", }, - "assignTrue__input.a != input.a": Object { - "Next": "null == null", + "assignTrue__input.a !== input.a": Object { + "Next": "null === null", "Result": true, "ResultPath": "$.heap55", "Type": "Pass", }, - "assignTrue__input.a != true": Object { - "Next": "false != input.a", + "assignTrue__input.a !== true": Object { + "Next": "false !== input.a", "Result": true, "ResultPath": "$.heap53", "Type": "Pass", }, - "assignTrue__input.a == input.a": Object { - "Next": "true != true", + "assignTrue__input.a === input.a": Object { + "Next": "true !== true", "Result": true, "ResultPath": "$.heap51", "Type": "Pass", }, - "assignTrue__input.a == true": Object { - "Next": "false == input.a", + "assignTrue__input.a === true": Object { + "Next": "false === input.a", "Result": true, "ResultPath": "$.heap49", "Type": "Pass", }, - "assignTrue__input.n != 2": Object { - "Next": "3 != input.n", + "assignTrue__input.n !== 2": Object { + "Next": "3 !== input.n", "Result": true, "ResultPath": "$.heap29", "Type": "Pass", }, - "assignTrue__input.n != input.n": Object { + "assignTrue__input.n !== input.n": Object { "Next": "1 < 1", "Result": true, "ResultPath": "$.heap31", @@ -1753,14 +1753,14 @@ Object { "ResultPath": "$.heap39", "Type": "Pass", }, - "assignTrue__input.n == 2": Object { - "Next": "3 == input.n", + "assignTrue__input.n === 2": Object { + "Next": "3 === input.n", "Result": true, "ResultPath": "$.heap25", "Type": "Pass", }, - "assignTrue__input.n == input.n": Object { - "Next": "1 != 1", + "assignTrue__input.n === input.n": Object { + "Next": "1 !== 1", "Result": true, "ResultPath": "$.heap27", "Type": "Pass", @@ -1784,48 +1784,48 @@ Object { "Type": "Pass", }, "assignTrue__input.n >= input.n": Object { - "Next": "true == true", + "Next": "true === true", "Result": true, "ResultPath": "$.heap47", "Type": "Pass", }, - "assignTrue__input.nv != input.nv": Object { + "assignTrue__input.nv !== input.nv": Object { "Next": "\\"a\\" in {a: \\"val\\"}", "Result": true, "ResultPath": "$.heap63", "Type": "Pass", }, - "assignTrue__input.nv != null": Object { - "Next": "input.v != input.nv", + "assignTrue__input.nv !== null": Object { + "Next": "input.v !== input.nv", "Result": true, "ResultPath": "$.heap61", "Type": "Pass", }, - "assignTrue__input.nv == input.nv": Object { - "Next": "null != null", + "assignTrue__input.nv === input.nv": Object { + "Next": "null !== null", "Result": true, "ResultPath": "$.heap59", "Type": "Pass", }, - "assignTrue__input.nv == null": Object { - "Next": "input.v == input.nv", + "assignTrue__input.nv === null": Object { + "Next": "input.v === input.nv", "Result": true, "ResultPath": "$.heap57", "Type": "Pass", }, - "assignTrue__input.v != \\"val\\"": Object { - "Next": "\\"val2\\" != input.v", + "assignTrue__input.v !== \\"val\\"": Object { + "Next": "\\"val2\\" !== input.v", "Result": true, "ResultPath": "$.heap5", "Type": "Pass", }, - "assignTrue__input.v != input.nv": Object { - "Next": "input.nv != input.nv", + "assignTrue__input.v !== input.nv": Object { + "Next": "input.nv !== input.nv", "Result": true, "ResultPath": "$.heap62", "Type": "Pass", }, - "assignTrue__input.v != input.v": Object { + "assignTrue__input.v !== input.v": Object { "Next": "\\"a\\" < \\"a\\"", "Result": true, "ResultPath": "$.heap7", @@ -1855,20 +1855,20 @@ Object { "ResultPath": "$.heap15", "Type": "Pass", }, - "assignTrue__input.v == \\"val\\"": Object { - "Next": "\\"val2\\" == input.v", + "assignTrue__input.v === \\"val\\"": Object { + "Next": "\\"val2\\" === input.v", "Result": true, "ResultPath": "$.heap1", "Type": "Pass", }, - "assignTrue__input.v == input.nv": Object { - "Next": "input.nv == input.nv", + "assignTrue__input.v === input.nv": Object { + "Next": "input.nv === input.nv", "Result": true, "ResultPath": "$.heap58", "Type": "Pass", }, - "assignTrue__input.v == input.v": Object { - "Next": "\\"a\\" != \\"a\\"", + "assignTrue__input.v === input.v": Object { + "Next": "\\"a\\" !== \\"a\\"", "Result": true, "ResultPath": "$.heap3", "Type": "Pass", @@ -1892,45 +1892,45 @@ Object { "Type": "Pass", }, "assignTrue__input.v >= input.v": Object { - "Next": "1 == 1", + "Next": "1 === 1", "Result": true, "ResultPath": "$.heap23", "Type": "Pass", }, - "assignTrue__null != null": Object { - "Next": "input.nv != null", + "assignTrue__null !== null": Object { + "Next": "input.nv !== null", "Result": true, "ResultPath": "$.heap60", "Type": "Pass", }, - "assignTrue__null == null": Object { - "Next": "input.nv == null", + "assignTrue__null === null": Object { + "Next": "input.nv === null", "Result": true, "ResultPath": "$.heap56", "Type": "Pass", }, - "assignTrue__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEq": Object { - "Next": "input.v == \\"val\\"", + "assignTrue__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringE": Object { + "Next": "input.v === \\"val\\"", "Result": true, "ResultPath": "$.heap0", "Type": "Pass", }, - "assignTrue__true != true": Object { - "Next": "input.a != true", + "assignTrue__true !== true": Object { + "Next": "input.a !== true", "Result": true, "ResultPath": "$.heap52", "Type": "Pass", }, - "assignTrue__true == true": Object { - "Next": "input.a == true", + "assignTrue__true === true": Object { + "Next": "input.a === true", "Result": true, "ResultPath": "$.heap48", "Type": "Pass", }, - "false != input.a": Object { + "false !== input.a": Object { "Choices": Array [ Object { - "Next": "assignTrue__false != input.a", + "Next": "assignTrue__false !== input.a", "Not": Object { "And": Array [ Object { @@ -1953,10 +1953,10 @@ Object { }, }, ], - "Default": "assignFalse__false != input.a", + "Default": "assignFalse__false !== input.a", "Type": "Choice", }, - "false == input.a": Object { + "false === input.a": Object { "Choices": Array [ Object { "And": Array [ @@ -1977,16 +1977,16 @@ Object { ], }, ], - "Next": "assignTrue__false == input.a", + "Next": "assignTrue__false === input.a", }, ], - "Default": "assignFalse__false == input.a", + "Default": "assignFalse__false === input.a", "Type": "Choice", }, - "input.a != input.a": Object { + "input.a !== input.a": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.a != input.a", + "Next": "assignTrue__input.a !== input.a", "Not": Object { "And": Array [ Object { @@ -2049,13 +2049,13 @@ Object { }, }, ], - "Default": "assignFalse__input.a != input.a", + "Default": "assignFalse__input.a !== input.a", "Type": "Choice", }, - "input.a != true": Object { + "input.a !== true": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.a != true", + "Next": "assignTrue__input.a !== true", "Not": Object { "And": Array [ Object { @@ -2078,10 +2078,10 @@ Object { }, }, ], - "Default": "assignFalse__input.a != true", + "Default": "assignFalse__input.a !== true", "Type": "Choice", }, - "input.a == input.a": Object { + "input.a === input.a": Object { "Choices": Array [ Object { "And": Array [ @@ -2142,13 +2142,13 @@ Object { ], }, ], - "Next": "assignTrue__input.a == input.a", + "Next": "assignTrue__input.a === input.a", }, ], - "Default": "assignFalse__input.a == input.a", + "Default": "assignFalse__input.a === input.a", "Type": "Choice", }, - "input.a == true": Object { + "input.a === true": Object { "Choices": Array [ Object { "And": Array [ @@ -2169,16 +2169,16 @@ Object { ], }, ], - "Next": "assignTrue__input.a == true", + "Next": "assignTrue__input.a === true", }, ], - "Default": "assignFalse__input.a == true", + "Default": "assignFalse__input.a === true", "Type": "Choice", }, - "input.n != 2": Object { + "input.n !== 2": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.n != 2", + "Next": "assignTrue__input.n !== 2", "Not": Object { "And": Array [ Object { @@ -2201,13 +2201,13 @@ Object { }, }, ], - "Default": "assignFalse__input.n != 2", + "Default": "assignFalse__input.n !== 2", "Type": "Choice", }, - "input.n != input.n": Object { + "input.n !== input.n": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.n != input.n", + "Next": "assignTrue__input.n !== input.n", "Not": Object { "And": Array [ Object { @@ -2270,7 +2270,7 @@ Object { }, }, ], - "Default": "assignFalse__input.n != input.n", + "Default": "assignFalse__input.n !== input.n", "Type": "Choice", }, "input.n < 3": Object { @@ -2437,7 +2437,7 @@ Object { "Default": "assignFalse__input.n <= input.n", "Type": "Choice", }, - "input.n == 2": Object { + "input.n === 2": Object { "Choices": Array [ Object { "And": Array [ @@ -2458,13 +2458,13 @@ Object { ], }, ], - "Next": "assignTrue__input.n == 2", + "Next": "assignTrue__input.n === 2", }, ], - "Default": "assignFalse__input.n == 2", + "Default": "assignFalse__input.n === 2", "Type": "Choice", }, - "input.n == input.n": Object { + "input.n === input.n": Object { "Choices": Array [ Object { "And": Array [ @@ -2525,10 +2525,10 @@ Object { ], }, ], - "Next": "assignTrue__input.n == input.n", + "Next": "assignTrue__input.n === input.n", }, ], - "Default": "assignFalse__input.n == input.n", + "Default": "assignFalse__input.n === input.n", "Type": "Choice", }, "input.n > 3": Object { @@ -2695,10 +2695,10 @@ Object { "Default": "assignFalse__input.n >= input.n", "Type": "Choice", }, - "input.nv != input.nv": Object { + "input.nv !== input.nv": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.nv != input.nv", + "Next": "assignTrue__input.nv !== input.nv", "Not": Object { "And": Array [ Object { @@ -2761,13 +2761,13 @@ Object { }, }, ], - "Default": "assignFalse__input.nv != input.nv", + "Default": "assignFalse__input.nv !== input.nv", "Type": "Choice", }, - "input.nv != null": Object { + "input.nv !== null": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.nv != null", + "Next": "assignTrue__input.nv !== null", "Not": Object { "And": Array [ Object { @@ -2830,10 +2830,10 @@ Object { }, }, ], - "Default": "assignFalse__input.nv != null", + "Default": "assignFalse__input.nv !== null", "Type": "Choice", }, - "input.nv == input.nv": Object { + "input.nv === input.nv": Object { "Choices": Array [ Object { "And": Array [ @@ -2894,13 +2894,13 @@ Object { ], }, ], - "Next": "assignTrue__input.nv == input.nv", + "Next": "assignTrue__input.nv === input.nv", }, ], - "Default": "assignFalse__input.nv == input.nv", + "Default": "assignFalse__input.nv === input.nv", "Type": "Choice", }, - "input.nv == null": Object { + "input.nv === null": Object { "Choices": Array [ Object { "And": Array [ @@ -2961,16 +2961,16 @@ Object { ], }, ], - "Next": "assignTrue__input.nv == null", + "Next": "assignTrue__input.nv === null", }, ], - "Default": "assignFalse__input.nv == null", + "Default": "assignFalse__input.nv === null", "Type": "Choice", }, - "input.v != \\"val\\"": Object { + "input.v !== \\"val\\"": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.v != \\"val\\"", + "Next": "assignTrue__input.v !== \\"val\\"", "Not": Object { "And": Array [ Object { @@ -2993,13 +2993,13 @@ Object { }, }, ], - "Default": "assignFalse__input.v != \\"val\\"", + "Default": "assignFalse__input.v !== \\"val\\"", "Type": "Choice", }, - "input.v != input.nv": Object { + "input.v !== input.nv": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.v != input.nv", + "Next": "assignTrue__input.v !== input.nv", "Not": Object { "And": Array [ Object { @@ -3062,13 +3062,13 @@ Object { }, }, ], - "Default": "assignFalse__input.v != input.nv", + "Default": "assignFalse__input.v !== input.nv", "Type": "Choice", }, - "input.v != input.v": Object { + "input.v !== input.v": Object { "Choices": Array [ Object { - "Next": "assignTrue__input.v != input.v", + "Next": "assignTrue__input.v !== input.v", "Not": Object { "And": Array [ Object { @@ -3131,7 +3131,7 @@ Object { }, }, ], - "Default": "assignFalse__input.v != input.v", + "Default": "assignFalse__input.v !== input.v", "Type": "Choice", }, "input.v < \\"val2\\"": Object { @@ -3298,7 +3298,7 @@ Object { "Default": "assignFalse__input.v <= input.v", "Type": "Choice", }, - "input.v == \\"val\\"": Object { + "input.v === \\"val\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -3319,13 +3319,13 @@ Object { ], }, ], - "Next": "assignTrue__input.v == \\"val\\"", + "Next": "assignTrue__input.v === \\"val\\"", }, ], - "Default": "assignFalse__input.v == \\"val\\"", + "Default": "assignFalse__input.v === \\"val\\"", "Type": "Choice", }, - "input.v == input.nv": Object { + "input.v === input.nv": Object { "Choices": Array [ Object { "And": Array [ @@ -3386,13 +3386,13 @@ Object { ], }, ], - "Next": "assignTrue__input.v == input.nv", + "Next": "assignTrue__input.v === input.nv", }, ], - "Default": "assignFalse__input.v == input.nv", + "Default": "assignFalse__input.v === input.nv", "Type": "Choice", }, - "input.v == input.v": Object { + "input.v === input.v": Object { "Choices": Array [ Object { "And": Array [ @@ -3453,10 +3453,10 @@ Object { ], }, ], - "Next": "assignTrue__input.v == input.v", + "Next": "assignTrue__input.v === input.v", }, ], - "Default": "assignFalse__input.v == input.v", + "Default": "assignFalse__input.v === input.v", "Type": "Choice", }, "input.v > \\"val2\\"": Object { @@ -3623,10 +3623,10 @@ Object { "Default": "assignFalse__input.v >= input.v", "Type": "Choice", }, - "null != null": Object { + "null !== null": Object { "Choices": Array [ Object { - "Next": "assignTrue__null != null", + "Next": "assignTrue__null !== null", "Not": Object { "And": Array [ Object { @@ -3689,10 +3689,10 @@ Object { }, }, ], - "Default": "assignFalse__null != null", + "Default": "assignFalse__null !== null", "Type": "Choice", }, - "null == null": Object { + "null === null": Object { "Choices": Array [ Object { "And": Array [ @@ -3753,43 +3753,43 @@ Object { ], }, ], - "Next": "assignTrue__null == null", + "Next": "assignTrue__null === null", }, ], - "Default": "assignFalse__null == null", + "Default": "assignFalse__null === null", "Type": "Choice", }, - "return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEquals: input.": Object { + "return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringEquals: input": Object { "Choices": Array [ Object { "IsNull": false, - "Next": "assignTrue__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringEq", + "Next": "assignTrue__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarStringE", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__return {constantStringEquals: \\"a\\" == \\"a\\", constantToVarStringE", + "Default": "assignFalse__return {constantStringEquals: \\"a\\" === \\"a\\", constantToVarString", "Type": "Choice", }, - "true != true": Object { + "true !== true": Object { "Choices": Array [ Object { "IsNull": true, - "Next": "assignTrue__true != true", + "Next": "assignTrue__true !== true", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__true != true", + "Default": "assignFalse__true !== true", "Type": "Choice", }, - "true == true": Object { + "true === true": Object { "Choices": Array [ Object { "IsNull": false, - "Next": "assignTrue__true == true", + "Next": "assignTrue__true === true", "Variable": "$$.Execution.Id", }, ], - "Default": "assignFalse__true == true", + "Default": "assignFalse__true === true", "Type": "Choice", }, }, @@ -4807,16 +4807,16 @@ Object { "$SFN.map([1, 2, 3], function(n))": Object { "ItemsPath": "$.heap1", "Iterator": Object { - "StartAt": "return \`nn\`", + "StartAt": "return n\${n}", "States": Object { - "1__return \`nn\`": Object { + "1__return n\${n}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", "Type": "Pass", }, - "return \`nn\`": Object { - "Next": "1__return \`nn\`", + "return n\${n}": Object { + "Next": "1__return n\${n}", "Parameters": Object { "string.$": "States.Format('n{}',$.n)", }, @@ -5557,14 +5557,14 @@ exports[`context 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`name: context.Execution.Name\`": Object { + "1__return name: \${context.Execution.Name}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "return \`name: context.Execution.Name\`", + "Next": "return name: \${context.Execution.Name}", "Parameters": Object { "_.$": "$", "fnl_context": Object { @@ -5574,8 +5574,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return \`name: context.Execution.Name\`": Object { - "Next": "1__return \`name: context.Execution.Name\`", + "return name: \${context.Execution.Name}": Object { + "Next": "1__return name: \${context.Execution.Name}", "Parameters": Object { "string.$": "States.Format('name: {}',$$.Execution.Name)", }, @@ -5590,20 +5590,20 @@ exports[`continue break 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`a1\`": Object { + "1__a = \${a}1": Object { "InputPath": "$.heap0.string", - "Next": "if(a != \\"111\\")", + "Next": "if(a !== \\"111\\")", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`a2\`": Object { + "1__a = \${a}2": Object { "InputPath": "$.heap1.string", "Next": "while (true)", "ResultPath": "$.a", "Type": "Pass", }, "1__await $AWS.DynamoDB.UpdateItem({Table: table, Key: {id: {S: input.id}}, ": Object { - "Next": "if(i == 3)", + "Next": "if(i === 3)", "Parameters": Object { "ExpressionAttributeValues": Object { ":inc": Object { @@ -5627,11 +5627,11 @@ Object { }, "1__item = await $AWS.DynamoDB.GetItem({Table: table, Key: {id: {S: input.id": Object { "InputPath": "$.heap5", - "Next": "return \`aitem.Item.val.N\`", + "Next": "return \${a}\${item.Item.val.N}", "ResultPath": "$.item", "Type": "Pass", }, - "1__return \`aitem.Item.val.N\`": Object { + "1__return \${a}\${item.Item.val.N}": Object { "End": true, "InputPath": "$.heap6.string", "ResultPath": "$", @@ -5654,16 +5654,16 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`a1\`": Object { - "Next": "1__a = \`a1\`", + "a = \${a}1": Object { + "Next": "1__a = \${a}1", "Parameters": Object { "string.$": "States.Format('{}1',$.a)", }, "ResultPath": "$.heap0", "Type": "Pass", }, - "a = \`a2\`": Object { - "Next": "1__a = \`a2\`", + "a = \${a}2": Object { + "Next": "1__a = \${a}2", "Parameters": Object { "string.$": "States.Format('{}2',$.a)", }, @@ -5702,14 +5702,14 @@ Object { }, "i": Object { "InputPath": "$.heap4[0]", - "Next": "if(i == 1)", + "Next": "if(i === 1)", "ResultPath": "$.i", "Type": "Pass", }, - "if(a != \\"111\\")": Object { + "if(a !== \\"111\\")": Object { "Choices": Array [ Object { - "Next": "if(a == \\"11121\\")", + "Next": "if(a === \\"11121\\")", "Not": Object { "And": Array [ Object { @@ -5732,10 +5732,10 @@ Object { }, }, ], - "Default": "a = \`a2\`", + "Default": "a = \${a}2", "Type": "Choice", }, - "if(a == \\"11121\\")": Object { + "if(a === \\"11121\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5762,7 +5762,7 @@ Object { "Default": "while (true)", "Type": "Choice", }, - "if(i == 1)": Object { + "if(i === 1)": Object { "Choices": Array [ Object { "And": Array [ @@ -5789,7 +5789,7 @@ Object { "Default": "await $AWS.DynamoDB.UpdateItem({Table: table, Key: {id: {S: input.id}}, Upd", "Type": "Choice", }, - "if(i == 3)": Object { + "if(i === 3)": Object { "Choices": Array [ Object { "And": Array [ @@ -5831,8 +5831,8 @@ Object { "ResultPath": "$.heap5", "Type": "Task", }, - "return \`aitem.Item.val.N\`": Object { - "Next": "1__return \`aitem.Item.val.N\`", + "return \${a}\${item.Item.val.N}": Object { + "Next": "1__return \${a}\${item.Item.val.N}", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.item.Item.val.N)", }, @@ -5849,7 +5849,7 @@ Object { "Choices": Array [ Object { "IsNull": false, - "Next": "a = \`a1\`", + "Next": "a = \${a}1", "Variable": "$$.Execution.Id", }, ], @@ -5888,6 +5888,14 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, + "\${z}\${w}\${v}\${x}\${s}\${u}\${t}\${tserRra[0]}": Object { + "Next": "1__return {prop: \${a}\${b}\${c}\${d}\${e}\${f}\${arrRest[0]}\${r}\${m}, var: \${z}\${", + "Parameters": Object { + "string.$": "States.Format('{}{}{}{}{}{}{}{}',$.z,$.w,$.v,$.x,$.s,$.u,$.t,$.tserRra[0])", + }, + "ResultPath": "$.heap10", + "Type": "Pass", + }, "1__[ d, undefined, e, arrRest ]": Object { "InputPath": "$$.Execution.Input['arr'][2]", "Next": "2__[ d, undefined, e, arrRest ]", @@ -5908,11 +5916,11 @@ Object { }, "1__f = \\"sir\\"": Object { "InputPath": "$.heap13", - "Next": "6__{ a, bb: { value: b, [\`ab\`]: r }, c = \\"what\\", m = c, arr: [ d, undefined", + "Next": "6__{ a, bb: { value: b, [\${\\"a\\"}\${\\"b\\"}]: r }, c = \\"what\\", m = c, arr: [ d, u", "ResultPath": "$.f", "Type": "Pass", }, - "1__forV = \`forVhl\`": Object { + "1__forV = \${forV}\${h}\${l}": Object { "InputPath": "$.heap7.string", "Next": "tail__for({h,j:[l]} of [{h: \\"a\\", j: [\\"b\\"]}])", "ResultPath": "$.forV", @@ -5945,13 +5953,13 @@ Object { "ResultPath": "$.heap3", "Type": "Pass", }, - "1__return \`aacc\`": Object { + "1__return \${aa}\${cc}": Object { "InputPath": "$.heap4.string", "Next": "handleResult__1__map = [{aa: \\"a\\", bb: [\\"b\\"]}].map(function({aa,bb:[cc]})).j", "ResultPath": "$.heap3.arr[0]", "Type": "Pass", }, - "1__return {prop: \`abcdefarrRest[0]rm\`, var: \`zwvxsuttserRra[0]\`, map: map, ": Object { + "1__return {prop: \${a}\${b}\${c}\${d}\${e}\${f}\${arrRest[0]}\${r}\${m}, var: \${z}\${": Object { "End": true, "Parameters": Object { "forV.$": "$.forV", @@ -5975,13 +5983,13 @@ Object { "ResultPath": "$.x", "Type": "Pass", }, - "1__{ [\\"value\\"]: w, [\`ab\`]: v }": Object { + "1__{ [\\"value\\"]: w, [\${\\"a\\"}\${\\"b\\"}]: v }": Object { "InputPath": "$.value['yy']['ab']", "Next": "x = \\"what\\"", "ResultPath": "$.v", "Type": "Pass", }, - "1__{ value: b, [\`ab\`]: r }": Object { + "1__{ value: b, [\${\\"a\\"}\${\\"b\\"}]: r }": Object { "InputPath": "$$.Execution.Input['bb']['ab']", "Next": "c = \\"what\\"", "ResultPath": "$.r", @@ -5999,14 +6007,14 @@ Object { "ResultPath": "$.tserRra", "Type": "Pass", }, - "6__{ a, bb: { value: b, [\`ab\`]: r }, c = \\"what\\", m = c, arr: [ d, undefined": Object { + "6__{ a, bb: { value: b, [\${\\"a\\"}\${\\"b\\"}]: r }, c = \\"what\\", m = c, arr: [ d, u": Object { "InputPath": "$$.Execution.Input['value']", - "Next": "{z,yy:{[\\"value\\"]:w,[\`ab\`]:v},x,rra:[s,undefined,u,...tserRra],rra2:[t]} = v", + "Next": "{z,yy:{[\\"value\\"]:w,[\${\\"a\\"}\${\\"b\\"}]:v},x,rra:[s,undefined,u,...tserRra],rra2:", "ResultPath": "$.value", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "{ a, bb: { value: b, [\`ab\`]: r }, c = \\"what\\", m = c, arr: [ d, undefined, e", + "Next": "{ a, bb: { value: b, [\${\\"a\\"}\${\\"b\\"}]: r }, c = \\"what\\", m = c, arr: [ d, unde", "Parameters": Object { "fnl_context": Object { "null": null, @@ -6017,7 +6025,7 @@ Object { }, "[ cc ]": Object { "InputPath": "$.heap3.arr[0]['bb'][0]", - "Next": "return \`aacc\`", + "Next": "return \${aa}\${cc}", "ResultPath": "$.cc", "Type": "Pass", }, @@ -6029,7 +6037,7 @@ Object { }, "[ l ]": Object { "InputPath": "$.heap8[0]['j'][0]", - "Next": "forV = \`forVhl\`", + "Next": "forV = \${forV}\${h}\${l}", "ResultPath": "$.l", "Type": "Pass", }, @@ -6039,14 +6047,6 @@ Object { "ResultPath": "$.s", "Type": "Pass", }, - "\`zwvxsuttserRra[0]\`": Object { - "Next": "1__return {prop: \`abcdefarrRest[0]rm\`, var: \`zwvxsuttserRra[0]\`, map: map, ", - "Parameters": Object { - "string.$": "States.Format('{}{}{}{}{}{}{}{}',$.z,$.w,$.v,$.x,$.s,$.u,$.t,$.tserRra[0])", - }, - "ResultPath": "$.heap10", - "Type": "Pass", - }, "append__1__map = [{aa: \\"a\\", bb: [\\"b\\"]}].map(function({aa,bb:[cc]})).join() ": Object { "Next": "tail__1__map = [{aa: \\"a\\", bb: [\\"b\\"]}].map(function({aa,bb:[cc]})).join() 1", "Parameters": Object { @@ -6127,8 +6127,8 @@ Object { "ResultPath": "$.forV", "Type": "Pass", }, - "forV = \`forVhl\`": Object { - "Next": "1__forV = \`forVhl\`", + "forV = \${forV}\${h}\${l}": Object { + "Next": "1__forV = \${forV}\${h}\${l}", "Parameters": Object { "string.$": "States.Format('{}{}{}',$.forV,$.h,$.l)", }, @@ -6228,16 +6228,16 @@ Object { "ResultPath": "$.heap2", "Type": "Pass", }, - "return \`aacc\`": Object { - "Next": "1__return \`aacc\`", + "return \${aa}\${cc}": Object { + "Next": "1__return \${aa}\${cc}", "Parameters": Object { "string.$": "States.Format('{}{}',$.aa,$.cc)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "return {prop: \`abcdefarrRest[0]rm\`, var: \`zwvxsuttserRra[0]\`, map: map, for": Object { - "Next": "\`zwvxsuttserRra[0]\`", + "return {prop: \${a}\${b}\${c}\${d}\${e}\${f}\${arrRest[0]}\${r}\${m}, var: \${z}\${w}$": Object { + "Next": "\${z}\${w}\${v}\${x}\${s}\${u}\${t}\${tserRra[0]}", "Parameters": Object { "string.$": "States.Format('{}{}{}{}{}{}{}{}{}',$.a,$.b,$.c,$.d,$.e,$.f,$.arrRest[0],$.r,$.m)", }, @@ -6281,7 +6281,7 @@ Object { }, "tr = message": Object { "InputPath": "$.message", - "Next": "return {prop: \`abcdefarrRest[0]rm\`, var: \`zwvxsuttserRra[0]\`, map: map, for", + "Next": "return {prop: \${a}\${b}\${c}\${d}\${e}\${f}\${arrRest[0]}\${r}\${m}, var: \${z}\${w}$", "ResultPath": "$.tr", "Type": "Pass", }, @@ -6334,15 +6334,15 @@ Object { "Default": "\\"what\\" 1", "Type": "Choice", }, - "{ [\\"value\\"]: w, [\`ab\`]: v }": Object { + "{ [\\"value\\"]: w, [\${\\"a\\"}\${\\"b\\"}]: v }": Object { "InputPath": "$.value['yy']['value']", - "Next": "1__{ [\\"value\\"]: w, [\`ab\`]: v }", + "Next": "1__{ [\\"value\\"]: w, [\${\\"a\\"}\${\\"b\\"}]: v }", "ResultPath": "$.w", "Type": "Pass", }, - "{ a, bb: { value: b, [\`ab\`]: r }, c = \\"what\\", m = c, arr: [ d, undefined, e": Object { + "{ a, bb: { value: b, [\${\\"a\\"}\${\\"b\\"}]: r }, c = \\"what\\", m = c, arr: [ d, unde": Object { "InputPath": "$$.Execution.Input['a']", - "Next": "{ value: b, [\`ab\`]: r }", + "Next": "{ value: b, [\${\\"a\\"}\${\\"b\\"}]: r }", "ResultPath": "$.a", "Type": "Pass", }, @@ -6358,15 +6358,15 @@ Object { "ResultPath": "$.h", "Type": "Pass", }, - "{ value: b, [\`ab\`]: r }": Object { + "{ value: b, [\${\\"a\\"}\${\\"b\\"}]: r }": Object { "InputPath": "$$.Execution.Input['bb']['value']", - "Next": "1__{ value: b, [\`ab\`]: r }", + "Next": "1__{ value: b, [\${\\"a\\"}\${\\"b\\"}]: r }", "ResultPath": "$.b", "Type": "Pass", }, - "{z,yy:{[\\"value\\"]:w,[\`ab\`]:v},x,rra:[s,undefined,u,...tserRra],rra2:[t]} = v": Object { + "{z,yy:{[\\"value\\"]:w,[\${\\"a\\"}\${\\"b\\"}]:v},x,rra:[s,undefined,u,...tserRra],rra2:": Object { "InputPath": "$.value['z']", - "Next": "{ [\\"value\\"]: w, [\`ab\`]: v }", + "Next": "{ [\\"value\\"]: w, [\${\\"a\\"}\${\\"b\\"}]: v }", "ResultPath": "$.z", "Type": "Pass", }, @@ -6403,7 +6403,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "$SFN.waitFor(1)": Object { - "Next": "return itemKey == \`hikey\`", + "Next": "return itemKey === hi\${key}", "Seconds": 1, "Type": "Wait", }, @@ -6419,13 +6419,13 @@ Object { "ResultPath": "$.arr2", "Type": "Pass", }, - "1__return itemKey == \`hikey\`": Object { + "1__return itemKey === hi\${key}": Object { "InputPath": "$.heap3", "Next": "handleResult__arr1 = arr.filter(function({value})).filter(function({value})", "ResultPath": "$.heap1", "Type": "Pass", }, - "1__return itemKey == \`hikey\` 1": Object { + "1__return itemKey === hi\${key} 1": Object { "Choices": Array [ Object { "And": Array [ @@ -6486,13 +6486,13 @@ Object { ], }, ], - "Next": "assignTrue__1__return itemKey == \`hikey\` 1", + "Next": "assignTrue__1__return itemKey === hi\${key} 1", }, ], - "Default": "assignFalse__1__return itemKey == \`hikey\` 1", + "Default": "assignFalse__1__return itemKey === hi\${key} 1", "Type": "Choice", }, - "1__return x <= index || first == x": Object { + "1__return x <= index || first === x": Object { "InputPath": "$.heap7", "Next": "handleResult__[4, 3, 2, 1].filter(function(x, index, [first]))", "ResultPath": "$.heap6", @@ -6516,7 +6516,7 @@ Object { }, "[ first ]": Object { "InputPath": "$.heap4[0]", - "Next": "return x <= index || first == x", + "Next": "return x <= index || first === x", "ResultPath": "$.first", "Type": "Pass", }, @@ -6564,26 +6564,26 @@ Object { "ResultPath": "$.heap4", "Type": "Pass", }, - "assignFalse__1__return itemKey == \`hikey\` 1": Object { - "Next": "1__return itemKey == \`hikey\`", + "assignFalse__1__return itemKey === hi\${key} 1": Object { + "Next": "1__return itemKey === hi\${key}", "Result": false, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignFalse__return x <= index || first == x": Object { - "Next": "1__return x <= index || first == x", + "assignFalse__return x <= index || first === x": Object { + "Next": "1__return x <= index || first === x", "Result": false, "ResultPath": "$.heap7", "Type": "Pass", }, - "assignTrue__1__return itemKey == \`hikey\` 1": Object { - "Next": "1__return itemKey == \`hikey\`", + "assignTrue__1__return itemKey === hi\${key} 1": Object { + "Next": "1__return itemKey === hi\${key}", "Result": true, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignTrue__return x <= index || first == x": Object { - "Next": "1__return x <= index || first == x", + "assignTrue__return x <= index || first === x": Object { + "Next": "1__return x <= index || first === x", "Result": true, "ResultPath": "$.heap7", "Type": "Pass", @@ -6820,18 +6820,18 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "return itemKey == \`hikey\`": Object { - "Next": "1__return itemKey == \`hikey\` 1", + "return itemKey === hi\${key}": Object { + "Next": "1__return itemKey === hi\${key} 1", "Parameters": Object { "string.$": "States.Format('hi{}',$.key)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return x <= index || first == x": Object { + "return x <= index || first === x": Object { "Choices": Array [ Object { - "Next": "assignTrue__return x <= index || first == x", + "Next": "assignTrue__return x <= index || first === x", "Or": Array [ Object { "And": Array [ @@ -6944,7 +6944,7 @@ Object { ], }, ], - "Default": "assignFalse__return x <= index || first == x", + "Default": "assignFalse__return x <= index || first === x", "Type": "Choice", }, "return {arr1: arr1, arr2: arr2}": Object { @@ -7000,27 +7000,27 @@ exports[`for 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`acc\`": Object { + "1__a = \${a}c\${c}": Object { "InputPath": "$.heap2.string", - "Next": "c = \`c1\`", + "Next": "c = \${c}1", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`anarr[0]\`": Object { + "1__a = \${a}n\${arr[0]}": Object { "InputPath": "$.heap0.string", "Next": "arr = arr.slice(1)", "ResultPath": "$.a", "Type": "Pass", }, - "1__c = \`c1\`": Object { + "1__c = \${c}1": Object { "InputPath": "$.heap3.string", - "Next": "if(c == \\"1\\")", + "Next": "if(c === \\"1\\")", "ResultPath": "$.c", "Type": "Pass", }, - "1__c = \`c1\` 1": Object { + "1__c = \${c}1 1": Object { "InputPath": "$.heap1.string", - "Next": "if(c == \\"1\\")", + "Next": "if(c === \\"1\\")", "ResultPath": "$.c", "Type": "Pass", }, @@ -7097,7 +7097,7 @@ Object { ], }, ], - "Next": "a = \`anarr[0]\`", + "Next": "a = \${a}n\${arr[0]}", }, ], "Default": "c = \\"\\"", @@ -7120,16 +7120,16 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`acc\`": Object { - "Next": "1__a = \`acc\`", + "a = \${a}c\${c}": Object { + "Next": "1__a = \${a}c\${c}", "Parameters": Object { "string.$": "States.Format('{}c{}',$.a,$.c)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "a = \`anarr[0]\`": Object { - "Next": "1__a = \`anarr[0]\`", + "a = \${a}n\${arr[0]}": Object { + "Next": "1__a = \${a}n\${arr[0]}", "Parameters": Object { "string.$": "States.Format('{}n{}',$.a,$.arr[0])", }, @@ -7143,21 +7143,21 @@ Object { "Type": "Pass", }, "c = \\"\\"": Object { - "Next": "if(c == \\"1\\")", + "Next": "if(c === \\"1\\")", "Result": "", "ResultPath": "$.c", "Type": "Pass", }, - "c = \`c1\`": Object { - "Next": "1__c = \`c1\`", + "c = \${c}1": Object { + "Next": "1__c = \${c}1", "Parameters": Object { "string.$": "States.Format('{}1',$.c)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "c = \`c1\` 1": Object { - "Next": "1__c = \`c1\` 1", + "c = \${c}1 1": Object { + "Next": "1__c = \${c}1 1", "Parameters": Object { "string.$": "States.Format('{}1',$.c)", }, @@ -7170,7 +7170,7 @@ Object { "ResultPath": "$.arr", "Type": "Pass", }, - "if(c == \\"1\\")": Object { + "if(c === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -7191,13 +7191,13 @@ Object { ], }, ], - "Next": "c = \`c1\` 1", + "Next": "c = \${c}1 1", }, ], - "Default": "if(c == \\"111\\")", + "Default": "if(c === \\"111\\")", "Type": "Choice", }, - "if(c == \\"111\\")": Object { + "if(c === \\"111\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -7221,7 +7221,7 @@ Object { "Next": "return a", }, ], - "Default": "a = \`acc\`", + "Default": "a = \${a}c\${c}", "Type": "Choice", }, "return a": Object { @@ -7238,13 +7238,13 @@ exports[`for control and assignment 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`ani\`": Object { + "1__a = \${a}n\${i}": Object { "InputPath": "$.heap0.string", "Next": "tail__for(i in input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`ani\` 1": Object { + "1__a = \${a}n\${i} 1": Object { "InputPath": "$.heap2.string", "Next": "tail__for(i in input.arr) 1", "ResultPath": "$.a", @@ -7307,16 +7307,16 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`ani\`": Object { - "Next": "1__a = \`ani\`", + "a = \${a}n\${i}": Object { + "Next": "1__a = \${a}n\${i}", "Parameters": Object { "string.$": "States.Format('{}n{}',$.a,$.i)", }, "ResultPath": "$.heap0", "Type": "Pass", }, - "a = \`ani\` 1": Object { - "Next": "1__a = \`ani\` 1", + "a = \${a}n\${i} 1": Object { + "Next": "1__a = \${a}n\${i} 1", "Parameters": Object { "string.$": "States.Format('{}n{}',$.a,$.i)", }, @@ -7325,13 +7325,13 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap1[0].item", - "Next": "if(i == \\"2\\")", + "Next": "if(i === \\"2\\")", "ResultPath": "$.0__i", "Type": "Pass", }, "assignValue__i 1": Object { "InputPath": "$.heap3[0].item", - "Next": "if(i != \\"2\\")", + "Next": "if(i !== \\"2\\")", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -7400,11 +7400,11 @@ Object { }, "i 2": Object { "InputPath": "$.heap4[0]", - "Next": "if(i == 2)", + "Next": "if(i === 2)", "ResultPath": "$.i", "Type": "Pass", }, - "if(i != \\"2\\")": Object { + "if(i !== \\"2\\")": Object { "Choices": Array [ Object { "Next": "tail__for(i in input.arr) 1", @@ -7430,10 +7430,10 @@ Object { }, }, ], - "Default": "a = \`ani\` 1", + "Default": "a = \${a}n\${i} 1", "Type": "Choice", }, - "if(i == \\"2\\")": Object { + "if(i === \\"2\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -7457,10 +7457,10 @@ Object { "Next": "for(i in input.arr) 1", }, ], - "Default": "a = \`ani\`", + "Default": "a = \${a}n\${i}", "Type": "Choice", }, - "if(i == 2)": Object { + "if(i === 2)": Object { "Choices": Array [ Object { "And": Array [ @@ -7525,7 +7525,7 @@ exports[`for in 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__await func({n: \`input.arr[i]\`, id: input.id})": Object { + "1__await func({n: \${input.arr[i]}, id: input.id})": Object { "Next": "tail__for(i in input.arr)", "Parameters": Object { "id.$": "$.input.id", @@ -7535,15 +7535,15 @@ Object { "ResultPath": "$.heap2", "Type": "Task", }, - "1__await func({n: \`input.arr[i]\`, id: input.id}) 1": Object { - "Next": "1__await func({n: \`input.arr[i]\`, id: input.id})", + "1__await func({n: \${input.arr[i]}, id: input.id}) 1": Object { + "Next": "1__await func({n: \${input.arr[i]}, id: input.id})", "Parameters": Object { "string.$": "States.Format('{}',$.heap0)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "1__await func({n: \`input.arr[i]\`, id: input.id}) 1 1": Object { + "1__await func({n: \${input.arr[i]}, id: input.id}) 1 1": Object { "Next": "await func({n: i, id: input.id})", "Parameters": Object { "id.$": "$.input.id", @@ -7553,15 +7553,15 @@ Object { "ResultPath": "$.heap6", "Type": "Task", }, - "1__await func({n: \`input.arr[i]\`, id: input.id}) 1 2": Object { - "Next": "1__await func({n: \`input.arr[i]\`, id: input.id}) 1 1", + "1__await func({n: \${input.arr[i]}, id: input.id}) 1 2": Object { + "Next": "1__await func({n: \${input.arr[i]}, id: input.id}) 1 1", "Parameters": Object { "string.$": "States.Format('{}',$.heap4)", }, "ResultPath": "$.heap5", "Type": "Pass", }, - "1__await func({n: \`input.arr[j]\`, id: input.id})": Object { + "1__await func({n: \${input.arr[j]}, id: input.id})": Object { "Next": "await func({n: j, id: input.id}) 1", "Parameters": Object { "id.$": "$.input.id", @@ -7571,8 +7571,8 @@ Object { "ResultPath": "$.heap10", "Type": "Task", }, - "1__await func({n: \`input.arr[j]\`, id: input.id}) 1": Object { - "Next": "1__await func({n: \`input.arr[j]\`, id: input.id})", + "1__await func({n: \${input.arr[j]}, id: input.id}) 1": Object { + "Next": "1__await func({n: \${input.arr[j]}, id: input.id})", "Parameters": Object { "string.$": "States.Format('{}',$.heap8)", }, @@ -7658,7 +7658,7 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap3[0].item", - "Next": "await func({n: \`input.arr[i]\`, id: input.id})", + "Next": "await func({n: \${input.arr[i]}, id: input.id})", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -7670,30 +7670,30 @@ Object { }, "assignValue__j": Object { "InputPath": "$.heap12[0].item", - "Next": "await func({n: \`input.arr[i]\`, id: input.id}) 1", + "Next": "await func({n: \${input.arr[i]}, id: input.id}) 1", "ResultPath": "$.0__j", "Type": "Pass", }, - "await func({n: \`input.arr[i]\`, id: input.id})": Object { + "await func({n: \${input.arr[i]}, id: input.id})": Object { "InputPath": "$.0__i", - "Next": "1__await func({n: \`input.arr[i]\`, id: input.id}) 1", + "Next": "1__await func({n: \${input.arr[i]}, id: input.id}) 1", "ResultPath": "$.heap0", "Type": "Pass", }, - "await func({n: \`input.arr[i]\`, id: input.id}) 1": Object { + "await func({n: \${input.arr[i]}, id: input.id}) 1": Object { "InputPath": "$.0__i", - "Next": "1__await func({n: \`input.arr[i]\`, id: input.id}) 1 2", + "Next": "1__await func({n: \${input.arr[i]}, id: input.id}) 1 2", "ResultPath": "$.heap4", "Type": "Pass", }, - "await func({n: \`input.arr[j]\`, id: input.id})": Object { + "await func({n: \${input.arr[j]}, id: input.id})": Object { "InputPath": "$.0__j", - "Next": "1__await func({n: \`input.arr[j]\`, id: input.id}) 1", + "Next": "1__await func({n: \${input.arr[j]}, id: input.id}) 1", "ResultPath": "$.heap8", "Type": "Pass", }, "await func({n: i, id: input.id})": Object { - "Next": "await func({n: \`input.arr[j]\`, id: input.id})", + "Next": "await func({n: \${input.arr[j]}, id: input.id})", "Parameters": Object { "id.$": "$.input.id", "n.$": "$.i", @@ -7844,19 +7844,19 @@ exports[`for loops 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`ai\`": Object { + "1__a = \${a}\${i}": Object { "InputPath": "$.heap0.string", "Next": "tail__for(i of [1, 2, 3])", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`ai\` 1": Object { + "1__a = \${a}\${i} 1": Object { "InputPath": "$.heap2.string", "Next": "tail__for(i of input.arr)", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`ai\` 2": Object { + "1__a = \${a}\${i} 2": Object { "InputPath": "$.heap5.string", "Next": "tail__for(i of await func()) 1", "ResultPath": "$.a", @@ -7879,24 +7879,24 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`ai\`": Object { - "Next": "1__a = \`ai\`", + "a = \${a}\${i}": Object { + "Next": "1__a = \${a}\${i}", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.i)", }, "ResultPath": "$.heap0", "Type": "Pass", }, - "a = \`ai\` 1": Object { - "Next": "1__a = \`ai\` 1", + "a = \${a}\${i} 1": Object { + "Next": "1__a = \${a}\${i} 1", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.i)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "a = \`ai\` 2": Object { - "Next": "1__a = \`ai\` 2", + "a = \${a}\${i} 2": Object { + "Next": "1__a = \${a}\${i} 2", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.i)", }, @@ -7967,19 +7967,19 @@ Object { }, "i": Object { "InputPath": "$.heap1[0]", - "Next": "a = \`ai\`", + "Next": "a = \${a}\${i}", "ResultPath": "$.i", "Type": "Pass", }, "i 1": Object { "InputPath": "$.heap3[0]", - "Next": "a = \`ai\` 1", + "Next": "a = \${a}\${i} 1", "ResultPath": "$.i", "Type": "Pass", }, "i 2": Object { "InputPath": "$.heap6[0]", - "Next": "a = \`ai\` 2", + "Next": "a = \${a}\${i} 2", "ResultPath": "$.i", "Type": "Pass", }, @@ -8015,6 +8015,14 @@ exports[`for map conditional 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { + "\${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { + "Next": "1__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", + "Parameters": Object { + "string.$": "States.Format('{}{}{}',$.heap14.string,$.heap16.string,$.heap18.string)", + }, + "ResultPath": "$.heap19", + "Type": "Pass", + }, "1__b = [\\"b\\"].map(function(v))": Object { "InputPath": "$.heap1", "Next": "c = [\\"c\\"].map(function(v))", @@ -8047,7 +8055,7 @@ Object { }, "1__d = await Promise.all([\\"d\\"].map(function(v)))": Object { "InputPath": "$.heap9", - "Next": "return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "ResultPath": "$.d", "Type": "Pass", }, @@ -8060,25 +8068,25 @@ Object { "ResultPath": "$.heap9", "Type": "Pass", }, - "1__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "1__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "End": true, "InputPath": "$.heap19.string", "ResultPath": "$", "Type": "Pass", }, - "1__return \`vai\`": Object { + "1__return \${v}\${a}\${i}": Object { "InputPath": "$.heap2.string", "Next": "handleResult__1__b = [\\"b\\"].map(function(v)) 1", "ResultPath": "$.heap1.arr[0]", "Type": "Pass", }, - "1__return \`vai\` 1": Object { + "1__return \${v}\${a}\${i} 1": Object { "InputPath": "$.heap6.string", "Next": "handleResult__1__c = [\\"c\\"].map(function(v)) 1", "ResultPath": "$.heap5.arr[0]", "Type": "Pass", }, - "1__return \`vai\` 2": Object { + "1__return \${v}\${a}\${i} 2": Object { "InputPath": "$.heap11.string", "Next": "handleResult__1__d = await Promise.all([\\"d\\"].map(function(v))) 1", "ResultPath": "$.heap9.arr[0]", @@ -8095,14 +8103,6 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "\`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { - "Next": "1__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", - "Parameters": Object { - "string.$": "States.Format('{}{}{}',$.heap14.string,$.heap16.string,$.heap18.string)", - }, - "ResultPath": "$.heap19", - "Type": "Pass", - }, "a = \\"x\\"": Object { "Next": "b = [\\"b\\"].map(function(v))", "Result": "x", @@ -8125,8 +8125,8 @@ Object { "ResultPath": "$.heap18", "Type": "Pass", }, - "append__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { - "Next": "tail__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "append__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { + "Next": "tail__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "Parameters": Object { "string.$": "States.Format('{}{}', $.heap14.string, $.heap13[0])", }, @@ -8365,7 +8365,7 @@ Object { "Variable": "$.heap17[0]", }, ], - "Default": "\`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Default": "\${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "Type": "Choice", }, "hasNext__for(i of [1, 2, 3])": Object { @@ -8401,7 +8401,7 @@ Object { "Default": "return \\"boo\\" 1", "Type": "Choice", }, - "hasNext__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "hasNext__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "Choices": Array [ Object { "And": Array [ @@ -8416,7 +8416,7 @@ Object { }, }, ], - "Next": "initValue__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "initValue__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", }, Object { "And": Array [ @@ -8433,11 +8433,11 @@ Object { }, }, ], - "Next": "returnEmpty__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "returnEmpty__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", }, Object { "IsPresent": true, - "Next": "append__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "append__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "Variable": "$.heap13[0]", }, ], @@ -8446,23 +8446,23 @@ Object { }, "i": Object { "InputPath": "$.heap3[0]", - "Next": "if(i == 3)", + "Next": "if(i === 3)", "ResultPath": "$.i", "Type": "Pass", }, "i 1": Object { "InputPath": "$.heap7[0]", - "Next": "if(i == 3) 1", + "Next": "if(i === 3) 1", "ResultPath": "$.i", "Type": "Pass", }, "i 2": Object { "InputPath": "$.heap12[0]", - "Next": "if(i == 3) 2", + "Next": "if(i === 3) 2", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == 3)": Object { + "if(i === 3)": Object { "Choices": Array [ Object { "And": Array [ @@ -8483,13 +8483,13 @@ Object { ], }, ], - "Next": "return \`vai\`", + "Next": "return \${v}\${a}\${i}", }, ], "Default": "tail__for(i of [1, 2, 3])", "Type": "Choice", }, - "if(i == 3) 1": Object { + "if(i === 3) 1": Object { "Choices": Array [ Object { "And": Array [ @@ -8510,13 +8510,13 @@ Object { ], }, ], - "Next": "return \`vai\` 1", + "Next": "return \${v}\${a}\${i} 1", }, ], "Default": "tail__for(i of input.arr)", "Type": "Choice", }, - "if(i == 3) 2": Object { + "if(i === 3) 2": Object { "Choices": Array [ Object { "And": Array [ @@ -8537,7 +8537,7 @@ Object { ], }, ], - "Next": "return \`vai\` 2", + "Next": "return \${v}\${a}\${i} 2", }, ], "Default": "tail__for(i of await func()) 1", @@ -8555,9 +8555,9 @@ Object { "ResultPath": "$.heap18.string", "Type": "Pass", }, - "initValue__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "initValue__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "InputPath": "$.heap13[0]", - "Next": "tail__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "tail__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "ResultPath": "$.heap14.string", "Type": "Pass", }, @@ -8579,30 +8579,30 @@ Object { "ResultPath": "$.heap9.arr[0]", "Type": "Pass", }, - "return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "InputPath": "$.b", - "Next": "hasNext__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "hasNext__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "ResultPath": "$.heap13", "Type": "Pass", }, - "return \`vai\`": Object { - "Next": "1__return \`vai\`", + "return \${v}\${a}\${i}": Object { + "Next": "1__return \${v}\${a}\${i}", "Parameters": Object { "string.$": "States.Format('{}{}{}',$.v,$.a,$.i)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return \`vai\` 1": Object { - "Next": "1__return \`vai\` 1", + "return \${v}\${a}\${i} 1": Object { + "Next": "1__return \${v}\${a}\${i} 1", "Parameters": Object { "string.$": "States.Format('{}{}{}',$.v,$.a,$.i)", }, "ResultPath": "$.heap6", "Type": "Pass", }, - "return \`vai\` 2": Object { - "Next": "1__return \`vai\` 2", + "return \${v}\${a}\${i} 2": Object { + "Next": "1__return \${v}\${a}\${i} 2", "Parameters": Object { "string.$": "States.Format('{}{}{}',$.v,$.a,$.i)", }, @@ -8616,12 +8616,12 @@ Object { "Type": "Pass", }, "returnEmpty__d.join(\\"\\")": Object { - "Next": "\`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "\${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "Result": "", "ResultPath": "$.heap18.string", "Type": "Pass", }, - "returnEmpty__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "returnEmpty__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "Next": "c.join(\\"\\")", "Result": "", "ResultPath": "$.heap14.string", @@ -8675,9 +8675,9 @@ Object { "ResultPath": "$.heap7", "Type": "Pass", }, - "tail__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`": Object { + "tail__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}": Object { "InputPath": "$.heap13[1:]", - "Next": "hasNext__return \`b.join(\\"\\")c.join(\\"\\")d.join(\\"\\")\`", + "Next": "hasNext__return \${b.join(\\"\\")}\${c.join(\\"\\")}\${d.join(\\"\\")}", "ResultPath": "$.heap13", "Type": "Pass", }, @@ -8707,7 +8707,7 @@ exports[`for of 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__await func({n: \`i\`, id: input.id})": Object { + "1__await func({n: \${i}, id: input.id})": Object { "Next": "tail__for(i of input.arr)", "Parameters": Object { "id.$": "$.input.id", @@ -8717,8 +8717,8 @@ Object { "ResultPath": "$.heap1", "Type": "Task", }, - "1__await func({n: \`i\`, id: input.id}) 1": Object { - "Next": "await func({n: \`j\`, id: input.id}) 1", + "1__await func({n: \${i}, id: input.id}) 1": Object { + "Next": "await func({n: \${j}, id: input.id}) 1", "Parameters": Object { "id.$": "$.input.id", "n.$": "$.heap3.string", @@ -8727,7 +8727,7 @@ Object { "ResultPath": "$.heap4", "Type": "Task", }, - "1__await func({n: \`j\`, id: input.id})": Object { + "1__await func({n: \${j}, id: input.id})": Object { "Next": "tail__for(i of input.arr) 1", "Parameters": Object { "id.$": "$.input.id", @@ -8737,7 +8737,7 @@ Object { "ResultPath": "$.heap9", "Type": "Task", }, - "1__await func({n: \`j\`, id: input.id}) 1": Object { + "1__await func({n: \${j}, id: input.id}) 1": Object { "Next": "tail__for(j of input.arr)", "Parameters": Object { "id.$": "$.input.id", @@ -8764,32 +8764,32 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "await func({n: \`i\`, id: input.id})": Object { - "Next": "1__await func({n: \`i\`, id: input.id})", + "await func({n: \${i}, id: input.id})": Object { + "Next": "1__await func({n: \${i}, id: input.id})", "Parameters": Object { "string.$": "States.Format('{}',$.i)", }, "ResultPath": "$.heap0", "Type": "Pass", }, - "await func({n: \`i\`, id: input.id}) 1": Object { - "Next": "1__await func({n: \`i\`, id: input.id}) 1", + "await func({n: \${i}, id: input.id}) 1": Object { + "Next": "1__await func({n: \${i}, id: input.id}) 1", "Parameters": Object { "string.$": "States.Format('{}',$.i)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "await func({n: \`j\`, id: input.id})": Object { - "Next": "1__await func({n: \`j\`, id: input.id})", + "await func({n: \${j}, id: input.id})": Object { + "Next": "1__await func({n: \${j}, id: input.id})", "Parameters": Object { "string.$": "States.Format('{}',$.j)", }, "ResultPath": "$.heap8", "Type": "Pass", }, - "await func({n: \`j\`, id: input.id}) 1": Object { - "Next": "1__await func({n: \`j\`, id: input.id}) 1", + "await func({n: \${j}, id: input.id}) 1": Object { + "Next": "1__await func({n: \${j}, id: input.id}) 1", "Parameters": Object { "string.$": "States.Format('{}',$.j)", }, @@ -8844,12 +8844,12 @@ Object { "Variable": "$.heap7[0]", }, ], - "Default": "await func({n: \`j\`, id: input.id})", + "Default": "await func({n: \${j}, id: input.id})", "Type": "Choice", }, "i": Object { "InputPath": "$.heap2[0]", - "Next": "await func({n: \`i\`, id: input.id})", + "Next": "await func({n: \${i}, id: input.id})", "ResultPath": "$.i", "Type": "Pass", }, @@ -8876,7 +8876,7 @@ Object { }, "j": Object { "InputPath": "$.heap7[0]", - "Next": "await func({n: \`i\`, id: input.id}) 1", + "Next": "await func({n: \${i}, id: input.id}) 1", "ResultPath": "$.j", "Type": "Pass", }, @@ -8918,7 +8918,7 @@ exports[`foreach 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`aax\`": Object { + "1__a = \${a}a\${x}": Object { "InputPath": "$.heap1.string", "Next": "return a 1", "ResultPath": "$.a", @@ -8941,8 +8941,8 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`aax\`": Object { - "Next": "1__a = \`aax\`", + "a = \${a}a\${x}": Object { + "Next": "1__a = \${a}a\${x}", "Parameters": Object { "string.$": "States.Format('{}a{}',$.a,$.x)", }, @@ -8994,7 +8994,7 @@ Object { }, "x": Object { "InputPath": "$.heap0.arr[0]", - "Next": "a = \`aax\`", + "Next": "a = \${a}a\${x}", "ResultPath": "$.x", "Type": "Pass", }, @@ -9481,7 +9481,7 @@ exports[`map 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`aax\`": Object { + "1__a = \${a}a\${x}": Object { "InputPath": "$.heap6.string", "Next": "return a", "ResultPath": "$.a", @@ -9508,19 +9508,19 @@ Object { "ResultPath": "$.l2", "Type": "Pass", }, - "1__return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]a\`": Object { + "1__return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}\${a}": Object { "End": true, "InputPath": "$.heap7.string", "ResultPath": "$", "Type": "Pass", }, - "1__return \`nixhead\`": Object { + "1__return n\${i}\${x}\${head}": Object { "InputPath": "$.heap4.string", "Next": "handleResult__l2 = input.arr.map(function(x, i, [head]))", "ResultPath": "$.heap3.arr[0]", "Type": "Pass", }, - "1__return \`nx\`": Object { + "1__return n\${x}": Object { "InputPath": "$.heap2.string", "Next": "handleResult__1__l = await func().map(function(x)) 1", "ResultPath": "$.heap1.arr[0]", @@ -9539,7 +9539,7 @@ Object { }, "[ head ]": Object { "InputPath": "$.input.arr[0]", - "Next": "return \`nixhead\`", + "Next": "return n\${i}\${x}\${head}", "ResultPath": "$.head", "Type": "Pass", }, @@ -9549,8 +9549,8 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`aax\`": Object { - "Next": "1__a = \`aax\`", + "a = \${a}a\${x}": Object { + "Next": "1__a = \${a}a\${x}", "Parameters": Object { "string.$": "States.Format('{}a{}',$.a,$.x)", }, @@ -9693,36 +9693,36 @@ Object { }, "Type": "Map", }, - "return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]a\`": Object { - "Next": "1__return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]a\`", + "return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}\${a}": Object { + "Next": "1__return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}\${a}", "Parameters": Object { "string.$": "States.Format('{}{}{}{}{}{}{}',$.l[0],$.l[1],$.l[2],$.l2[0],$.l2[1],$.l2[2],$.a)", }, "ResultPath": "$.heap7", "Type": "Pass", }, - "return \`nixhead\`": Object { - "Next": "1__return \`nixhead\`", + "return a": Object { + "InputPath": "$.a", + "Next": "handleResult__input.arr.map(function(x))", + "ResultPath": "$.heap5.arr[0]", + "Type": "Pass", + }, + "return n\${i}\${x}\${head}": Object { + "Next": "1__return n\${i}\${x}\${head}", "Parameters": Object { "string.$": "States.Format('n{}{}{}',$.i,$.x,$.head)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "return \`nx\`": Object { - "Next": "1__return \`nx\`", + "return n\${x}": Object { + "Next": "1__return n\${x}", "Parameters": Object { "string.$": "States.Format('n{}',$.x)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return a": Object { - "InputPath": "$.a", - "Next": "handleResult__input.arr.map(function(x))", - "ResultPath": "$.heap5.arr[0]", - "Type": "Pass", - }, "set__end__1__l = await func().map(function(x)) 1": Object { "InputPath": "$.heap1.result[1:]", "Next": "1__l = await func().map(function(x))", @@ -9731,7 +9731,7 @@ Object { }, "set__end__input.arr.map(function(x))": Object { "InputPath": "$.heap5.result[1:]", - "Next": "return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]a\`", + "Next": "return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}\${a}", "ResultPath": "$.heap5", "Type": "Pass", }, @@ -9743,13 +9743,13 @@ Object { }, "x": Object { "InputPath": "$.heap1.arr[0]", - "Next": "return \`nx\`", + "Next": "return n\${x}", "ResultPath": "$.x", "Type": "Pass", }, "x 1": Object { "InputPath": "$.heap5.arr[0]", - "Next": "a = \`aax\`", + "Next": "a = \${a}a\${x}", "ResultPath": "$.x", "Type": "Pass", }, @@ -9778,23 +9778,23 @@ Object { }, "1__l2 = input.arr.map(function(x))": Object { "InputPath": "$.heap3", - "Next": "return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]\`", + "Next": "return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}", "ResultPath": "$.l2", "Type": "Pass", }, - "1__return \`input.prefixx\`": Object { + "1__return \${input.prefix}\${x}": Object { "InputPath": "$.heap2.string", "Next": "handleResult__1__l = await func().map(function(x)) 1", "ResultPath": "$.heap1.arr[0]", "Type": "Pass", }, - "1__return \`input.prefixx\` 1": Object { + "1__return \${input.prefix}\${x} 1": Object { "InputPath": "$.heap4.string", "Next": "handleResult__l2 = input.arr.map(function(x))", "ResultPath": "$.heap3.arr[0]", "Type": "Pass", }, - "1__return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]\`": Object { + "1__return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}": Object { "End": true, "InputPath": "$.heap5.string", "ResultPath": "$", @@ -9883,24 +9883,24 @@ Object { "ResultPath": "$.heap3", "Type": "Pass", }, - "return \`input.prefixx\`": Object { - "Next": "1__return \`input.prefixx\`", + "return \${input.prefix}\${x}": Object { + "Next": "1__return \${input.prefix}\${x}", "Parameters": Object { "string.$": "States.Format('{}{}',$.input.prefix,$.x)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return \`input.prefixx\` 1": Object { - "Next": "1__return \`input.prefixx\` 1", + "return \${input.prefix}\${x} 1": Object { + "Next": "1__return \${input.prefix}\${x} 1", "Parameters": Object { "string.$": "States.Format('{}{}',$.input.prefix,$.x)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]\`": Object { - "Next": "1__return \`l[0]l[1]l[2]l2[0]l2[1]l2[2]\`", + "return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}": Object { + "Next": "1__return \${l[0]}\${l[1]}\${l[2]}\${l2[0]}\${l2[1]}\${l2[2]}", "Parameters": Object { "string.$": "States.Format('{}{}{}{}{}{}',$.l[0],$.l[1],$.l[2],$.l2[0],$.l2[1],$.l2[2])", }, @@ -9921,13 +9921,13 @@ Object { }, "x": Object { "InputPath": "$.heap1.arr[0]", - "Next": "return \`input.prefixx\`", + "Next": "return \${input.prefix}\${x}", "ResultPath": "$.x", "Type": "Pass", }, "x 1": Object { "InputPath": "$.heap3.arr[0]", - "Next": "return \`input.prefixx\` 1", + "Next": "return \${input.prefix}\${x} 1", "ResultPath": "$.x", "Type": "Pass", }, @@ -9939,13 +9939,13 @@ exports[`map with dynamic for loops 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`ax\`": Object { + "1__a = \${a}\${x}": Object { "InputPath": "$.heap5.string", "Next": "tail__for(x of l)", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`ax\` 1": Object { + "1__a = \${a}\${x} 1": Object { "InputPath": "$.heap7.string", "Next": "tail__for(x of l2)", "ResultPath": "$.a", @@ -9972,13 +9972,13 @@ Object { "ResultPath": "$.l2", "Type": "Pass", }, - "1__return \`nx\`": Object { + "1__return n\${x}": Object { "InputPath": "$.heap2.string", "Next": "handleResult__1__l = await func().map(function(x)) 1", "ResultPath": "$.heap1.arr[0]", "Type": "Pass", }, - "1__return \`nx\` 1": Object { + "1__return n\${x} 1": Object { "InputPath": "$.heap4.string", "Next": "handleResult__l2 = input.arr.map(function(x))", "ResultPath": "$.heap3.arr[0]", @@ -10001,16 +10001,16 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`ax\`": Object { - "Next": "1__a = \`ax\`", + "a = \${a}\${x}": Object { + "Next": "1__a = \${a}\${x}", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.x)", }, "ResultPath": "$.heap5", "Type": "Pass", }, - "a = \`ax\` 1": Object { - "Next": "1__a = \`ax\` 1", + "a = \${a}\${x} 1": Object { + "Next": "1__a = \${a}\${x} 1", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.x)", }, @@ -10123,28 +10123,28 @@ Object { "ResultPath": "$.heap3", "Type": "Pass", }, - "return \`nx\`": Object { - "Next": "1__return \`nx\`", + "return a": Object { + "End": true, + "InputPath": "$.a", + "ResultPath": "$", + "Type": "Pass", + }, + "return n\${x}": Object { + "Next": "1__return n\${x}", "Parameters": Object { "string.$": "States.Format('n{}',$.x)", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return \`nx\` 1": Object { - "Next": "1__return \`nx\` 1", + "return n\${x} 1": Object { + "Next": "1__return n\${x} 1", "Parameters": Object { "string.$": "States.Format('n{}',$.x)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "return a": Object { - "End": true, - "InputPath": "$.a", - "ResultPath": "$", - "Type": "Pass", - }, "set__end__1__l = await func().map(function(x)) 1": Object { "InputPath": "$.heap1.result[1:]", "Next": "1__l = await func().map(function(x))", @@ -10171,25 +10171,25 @@ Object { }, "x": Object { "InputPath": "$.heap1.arr[0]", - "Next": "return \`nx\`", + "Next": "return n\${x}", "ResultPath": "$.x", "Type": "Pass", }, "x 1": Object { "InputPath": "$.heap3.arr[0]", - "Next": "return \`nx\` 1", + "Next": "return n\${x} 1", "ResultPath": "$.x", "Type": "Pass", }, "x 2": Object { "InputPath": "$.heap6[0]", - "Next": "a = \`ax\`", + "Next": "a = \${a}\${x}", "ResultPath": "$.x", "Type": "Pass", }, "x 3": Object { "InputPath": "$.heap8[0]", - "Next": "a = \`ax\` 1", + "Next": "a = \${a}\${x} 1", "ResultPath": "$.x", "Type": "Pass", }, @@ -10389,33 +10389,33 @@ exports[`templates 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`": Object { + "1__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}": Object { "InputPath": "$.heap1.string", - "Next": "result = await func(\`input.obj.str hello partOfTheTemplateString input.obj.", + "Next": "result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateString} ", "ResultPath": "$.partOfTheTemplateString", "Type": "Pass", }, - "1__result = await func(\`input.obj.str hello partOfTheTemplateString input.o": Object { + "1__result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateStrin": Object { "InputPath": "$.heap3", - "Next": "return \`the result: result.str\`", + "Next": "return the result: \${result.str}", "ResultPath": "$.result", "Type": "Pass", }, - "1__result = await func(\`input.obj.str hello partOfTheTemplateString input.o 1": Object { + "1__result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateStrin 1": Object { "InputPath": "$.heap2.string", - "Next": "1__result = await func(\`input.obj.str hello partOfTheTemplateString input.o", + "Next": "1__result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateStrin", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap3", "Type": "Task", }, - "1__return \`the result: result.str\`": Object { + "1__return the result: \${result.str}": Object { "End": true, "InputPath": "$.heap4.string", "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`", + "Next": "partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}", "Parameters": Object { "fnl_context": Object { "null": null, @@ -10425,15 +10425,15 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "\`hello input.obj.str2 ?? \\"default\\"\`": Object { - "Next": "1__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`", + "hello \${input.obj.str2 ?? \\"default\\"}": Object { + "Next": "1__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}", "Parameters": Object { "string.$": "States.Format('hello {}',$.heap0)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`": Object { + "partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}": Object { "Choices": Array [ Object { "And": Array [ @@ -10446,36 +10446,36 @@ Object { "Variable": "$.input.obj.str2", }, ], - "Next": "takeLeft__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`", + "Next": "takeLeft__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}", }, ], - "Default": "takeRight__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`", + "Default": "takeRight__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}", "Type": "Choice", }, - "result = await func(\`input.obj.str hello partOfTheTemplateString input.obj.": Object { - "Next": "1__result = await func(\`input.obj.str hello partOfTheTemplateString input.o 1", + "result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateString} ": Object { + "Next": "1__result = await func(\${input.obj.str} \${\\"hello\\"} \${partOfTheTemplateStrin 1", "Parameters": Object { "string.$": "States.Format('{} hello {} {}',$.input.obj.str,$.partOfTheTemplateString,$.input.obj.items[0])", }, "ResultPath": "$.heap2", "Type": "Pass", }, - "return \`the result: result.str\`": Object { - "Next": "1__return \`the result: result.str\`", + "return the result: \${result.str}": Object { + "Next": "1__return the result: \${result.str}", "Parameters": Object { "string.$": "States.Format('the result: {}',$.result.str)", }, "ResultPath": "$.heap4", "Type": "Pass", }, - "takeLeft__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`": Object { + "takeLeft__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}": Object { "InputPath": "$.input.obj.str2", - "Next": "\`hello input.obj.str2 ?? \\"default\\"\`", + "Next": "hello \${input.obj.str2 ?? \\"default\\"}", "ResultPath": "$.heap0", "Type": "Pass", }, - "takeRight__partOfTheTemplateString = \`hello input.obj.str2 ?? \\"default\\"\`": Object { - "Next": "\`hello input.obj.str2 ?? \\"default\\"\`", + "takeRight__partOfTheTemplateString = hello \${input.obj.str2 ?? \\"default\\"}": Object { + "Next": "hello \${input.obj.str2 ?? \\"default\\"}", "Result": "default", "ResultPath": "$.heap0", "Type": "Pass", @@ -10488,7 +10488,7 @@ exports[`templates simple 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`x\`": Object { + "1__return \${x}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", @@ -10505,8 +10505,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return \`x\`": Object { - "Next": "1__return \`x\`", + "return \${x}": Object { + "Next": "1__return \${x}", "Parameters": Object { "string.$": "States.Format('{}',$.x)", }, @@ -10515,7 +10515,7 @@ Object { }, "x = input.str": Object { "InputPath": "$.input.str", - "Next": "return \`x\`", + "Next": "return \${x}", "ResultPath": "$.x", "Type": "Pass", }, @@ -11233,61 +11233,61 @@ Object { "ResultPath": "$.heap21", "Type": "Map", }, - "1__a = \`aarrmaperr.errorMessage\`": Object { - "InputPath": "$.heap26.string", - "Next": "return a", + "1__a = \${a}\${err.errorMessage}": Object { + "InputPath": "$.heap9.string", + "Next": "try 6", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`adoerr.errorMessage\`": Object { - "InputPath": "$.heap18.string", - "Next": "try 10", + "1__a = \${a}\${err.message}": Object { + "InputPath": "$.heap1.string", + "Next": "try 2", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`aerr.errorMessage\`": Object { - "InputPath": "$.heap9.string", - "Next": "try 6", + "1__a = \${a}arrmap\${err.errorMessage}": Object { + "InputPath": "$.heap26.string", + "Next": "return a", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`aerr.message\`": Object { - "InputPath": "$.heap1.string", - "Next": "try 2", + "1__a = \${a}do\${err.errorMessage}": Object { + "InputPath": "$.heap18.string", + "Next": "try 10", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`afinally1\`": Object { + "1__a = \${a}finally1": Object { "InputPath": "$.heap3.string", "Next": "try 3", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`afinally2\`": Object { + "1__a = \${a}finally2": Object { "InputPath": "$.heap5.string", "Next": "try 4", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`aforerr.errorMessage\`": Object { + "1__a = \${a}for\${err.errorMessage}": Object { "InputPath": "$.heap12.string", "Next": "try 7", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`arecatcherr.message\`": Object { + "1__a = \${a}recatch\${err.message}": Object { "InputPath": "$.heap14.string", "Next": "try 8", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`asfnmaperr.errorMessage\`": Object { + "1__a = \${a}sfnmap\${err.errorMessage}": Object { "InputPath": "$.heap22.string", "Next": "try 11", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`awhileerr.errorMessage\`": Object { + "1__a = \${a}while\${err.errorMessage}": Object { "InputPath": "$.heap16.string", "Next": "try 9", "ResultPath": "$.a", @@ -11313,7 +11313,7 @@ Object { }, "1__catch__try 2": Object { "InputPath": "$.heap2.string", - "Next": "a = \`afinally1\`", + "Next": "a = \${a}finally1", "ResultPath": "$.a", "Type": "Pass", }, @@ -11381,7 +11381,7 @@ Object { }, "1__try 3": Object { "InputPath": "$.heap4.string", - "Next": "a = \`afinally2\`", + "Next": "a = \${a}finally2", "ResultPath": "$.a", "Type": "Pass", }, @@ -11427,80 +11427,80 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`aarrmaperr.errorMessage\`": Object { - "Next": "1__a = \`aarrmaperr.errorMessage\`", + "a = \${a}\${err.errorMessage}": Object { + "Next": "1__a = \${a}\${err.errorMessage}", "Parameters": Object { - "string.$": "States.Format('{}arrmap{}',$.a,$.err.errorMessage)", + "string.$": "States.Format('{}{}',$.a,$.err.errorMessage)", }, - "ResultPath": "$.heap26", + "ResultPath": "$.heap9", "Type": "Pass", }, - "a = \`adoerr.errorMessage\`": Object { - "Next": "1__a = \`adoerr.errorMessage\`", + "a = \${a}\${err.message}": Object { + "Next": "1__a = \${a}\${err.message}", "Parameters": Object { - "string.$": "States.Format('{}do{}',$.a,$.err.errorMessage)", + "string.$": "States.Format('{}{}',$.a,$.err.message)", }, - "ResultPath": "$.heap18", + "ResultPath": "$.heap1", "Type": "Pass", }, - "a = \`aerr.errorMessage\`": Object { - "Next": "1__a = \`aerr.errorMessage\`", + "a = \${a}arrmap\${err.errorMessage}": Object { + "Next": "1__a = \${a}arrmap\${err.errorMessage}", "Parameters": Object { - "string.$": "States.Format('{}{}',$.a,$.err.errorMessage)", + "string.$": "States.Format('{}arrmap{}',$.a,$.err.errorMessage)", }, - "ResultPath": "$.heap9", + "ResultPath": "$.heap26", "Type": "Pass", }, - "a = \`aerr.message\`": Object { - "Next": "1__a = \`aerr.message\`", + "a = \${a}do\${err.errorMessage}": Object { + "Next": "1__a = \${a}do\${err.errorMessage}", "Parameters": Object { - "string.$": "States.Format('{}{}',$.a,$.err.message)", + "string.$": "States.Format('{}do{}',$.a,$.err.errorMessage)", }, - "ResultPath": "$.heap1", + "ResultPath": "$.heap18", "Type": "Pass", }, - "a = \`afinally1\`": Object { - "Next": "1__a = \`afinally1\`", + "a = \${a}finally1": Object { + "Next": "1__a = \${a}finally1", "Parameters": Object { "string.$": "States.Format('{}finally1',$.a)", }, "ResultPath": "$.heap3", "Type": "Pass", }, - "a = \`afinally2\`": Object { - "Next": "1__a = \`afinally2\`", + "a = \${a}finally2": Object { + "Next": "1__a = \${a}finally2", "Parameters": Object { "string.$": "States.Format('{}finally2',$.a)", }, "ResultPath": "$.heap5", "Type": "Pass", }, - "a = \`aforerr.errorMessage\`": Object { - "Next": "1__a = \`aforerr.errorMessage\`", + "a = \${a}for\${err.errorMessage}": Object { + "Next": "1__a = \${a}for\${err.errorMessage}", "Parameters": Object { "string.$": "States.Format('{}for{}',$.a,$.err.errorMessage)", }, "ResultPath": "$.heap12", "Type": "Pass", }, - "a = \`arecatcherr.message\`": Object { - "Next": "1__a = \`arecatcherr.message\`", + "a = \${a}recatch\${err.message}": Object { + "Next": "1__a = \${a}recatch\${err.message}", "Parameters": Object { "string.$": "States.Format('{}recatch{}',$.a,$.err.message)", }, "ResultPath": "$.heap14", "Type": "Pass", }, - "a = \`asfnmaperr.errorMessage\`": Object { - "Next": "1__a = \`asfnmaperr.errorMessage\`", + "a = \${a}sfnmap\${err.errorMessage}": Object { + "Next": "1__a = \${a}sfnmap\${err.errorMessage}", "Parameters": Object { "string.$": "States.Format('{}sfnmap{}',$.a,$.err.errorMessage)", }, "ResultPath": "$.heap22", "Type": "Pass", }, - "a = \`awhileerr.errorMessage\`": Object { - "Next": "1__a = \`awhileerr.errorMessage\`", + "a = \${a}while\${err.errorMessage}": Object { + "Next": "1__a = \${a}while\${err.errorMessage}", "Parameters": Object { "string.$": "States.Format('{}while{}',$.a,$.err.errorMessage)", }, @@ -11563,37 +11563,37 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_4", - "Next": "a = \`aerr.errorMessage\`", + "Next": "a = \${a}\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, "catch(err) 1": Object { "InputPath": "$.fnl_tmp_5", - "Next": "a = \`aforerr.errorMessage\`", + "Next": "a = \${a}for\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, "catch(err) 2": Object { "InputPath": "$.fnl_tmp_9", - "Next": "a = \`awhileerr.errorMessage\`", + "Next": "a = \${a}while\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, "catch(err) 3": Object { "InputPath": "$.fnl_tmp_10", - "Next": "a = \`adoerr.errorMessage\`", + "Next": "a = \${a}do\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, "catch(err) 4": Object { "InputPath": "$.fnl_tmp_11", - "Next": "a = \`asfnmaperr.errorMessage\`", + "Next": "a = \${a}sfnmap\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, "catch(err) 5": Object { "InputPath": "$.fnl_tmp_12", - "Next": "a = \`aarrmaperr.errorMessage\`", + "Next": "a = \${a}arrmap\${err.errorMessage}", "ResultPath": "$.err", "Type": "Pass", }, @@ -11607,7 +11607,7 @@ Object { }, "catch__try 1": Object { "InputPath": "$.fnl_tmp_1", - "Next": "a = \`aerr.message\`", + "Next": "a = \${a}\${err.message}", "ResultPath": "$.err", "Type": "Pass", }, @@ -11661,7 +11661,7 @@ Object { }, "catch__try 7": Object { "InputPath": "$.fnl_tmp_6", - "Next": "a = \`arecatcherr.message\`", + "Next": "a = \${a}recatch\${err.message}", "ResultPath": "$.err", "Type": "Pass", }, @@ -11902,7 +11902,7 @@ exports[`typeof 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input": Object { + "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu": Object { "End": true, "Parameters": Object { "arrType.$": "$.heap12", @@ -11918,7 +11918,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1": Object { + "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1": Object { "Choices": Array [ Object { "And": Array [ @@ -11939,13 +11939,13 @@ Object { ], }, ], - "Next": "assignTrue__1__return {isString: typeof input.str == \\"string\\", stringType: ", + "Next": "assignTrue__1__return {isString: typeof input.str === \\"string\\", stringType:", }, ], - "Default": "assignFalse__1__return {isString: typeof input.str == \\"string\\", stringType:", + "Default": "assignFalse__1__return {isString: typeof input.str === \\"string\\", stringType", "Type": "Choice", }, - "1__typeof input.bool == \\"boolean\\"": Object { + "1__typeof input.bool === \\"boolean\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -11966,13 +11966,13 @@ Object { ], }, ], - "Next": "assignTrue__1__typeof input.bool == \\"boolean\\"", + "Next": "assignTrue__1__typeof input.bool === \\"boolean\\"", }, ], - "Default": "assignFalse__1__typeof input.bool == \\"boolean\\"", + "Default": "assignFalse__1__typeof input.bool === \\"boolean\\"", "Type": "Choice", }, - "1__typeof input.num == \\"number\\"": Object { + "1__typeof input.num === \\"number\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -11993,13 +11993,13 @@ Object { ], }, ], - "Next": "assignTrue__1__typeof input.num == \\"number\\"", + "Next": "assignTrue__1__typeof input.num === \\"number\\"", }, ], - "Default": "assignFalse__1__typeof input.num == \\"number\\"", + "Default": "assignFalse__1__typeof input.num === \\"number\\"", "Type": "Choice", }, - "1__typeof input.obj == \\"object\\"": Object { + "1__typeof input.obj === \\"object\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -12020,14 +12020,14 @@ Object { ], }, ], - "Next": "assignTrue__1__typeof input.obj == \\"object\\"", + "Next": "assignTrue__1__typeof input.obj === \\"object\\"", }, ], - "Default": "assignFalse__1__typeof input.obj == \\"object\\"", + "Default": "assignFalse__1__typeof input.obj === \\"object\\"", "Type": "Choice", }, "Initialize Functionless Context": Object { - "Next": "return {isString: typeof input.str == \\"string\\", stringType: typeof input.st", + "Next": "return {isString: typeof input.str === \\"string\\", stringType: typeof input.s", "Parameters": Object { "fnl_context": Object { "null": null, @@ -12037,68 +12037,68 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "assignFalse__1__return {isString: typeof input.str == \\"string\\", stringType:": Object { + "assignFalse__1__return {isString: typeof input.str === \\"string\\", stringType": Object { "Next": "input.str", "Result": false, "ResultPath": "$.heap1", "Type": "Pass", }, - "assignFalse__1__typeof input.bool == \\"boolean\\"": Object { + "assignFalse__1__typeof input.bool === \\"boolean\\"": Object { "Next": "input.bool", "Result": false, "ResultPath": "$.heap4", "Type": "Pass", }, - "assignFalse__1__typeof input.num == \\"number\\"": Object { + "assignFalse__1__typeof input.num === \\"number\\"": Object { "Next": "input.num", "Result": false, "ResultPath": "$.heap7", "Type": "Pass", }, - "assignFalse__1__typeof input.obj == \\"object\\"": Object { + "assignFalse__1__typeof input.obj === \\"object\\"": Object { "Next": "input.obj", "Result": false, "ResultPath": "$.heap10", "Type": "Pass", }, - "assignTrue__1__return {isString: typeof input.str == \\"string\\", stringType: ": Object { + "assignTrue__1__return {isString: typeof input.str === \\"string\\", stringType:": Object { "Next": "input.str", "Result": true, "ResultPath": "$.heap1", "Type": "Pass", }, - "assignTrue__1__typeof input.bool == \\"boolean\\"": Object { + "assignTrue__1__typeof input.bool === \\"boolean\\"": Object { "Next": "input.bool", "Result": true, "ResultPath": "$.heap4", "Type": "Pass", }, - "assignTrue__1__typeof input.num == \\"number\\"": Object { + "assignTrue__1__typeof input.num === \\"number\\"": Object { "Next": "input.num", "Result": true, "ResultPath": "$.heap7", "Type": "Pass", }, - "assignTrue__1__typeof input.obj == \\"object\\"": Object { + "assignTrue__1__typeof input.obj === \\"object\\"": Object { "Next": "input.obj", "Result": true, "ResultPath": "$.heap10", "Type": "Pass", }, "boolean__input.arr": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input", + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu", "Result": "boolean", "ResultPath": "$.heap12", "Type": "Pass", }, "boolean__input.bool": Object { - "Next": "typeof input.num == \\"number\\"", + "Next": "typeof input.num === \\"number\\"", "Result": "boolean", "ResultPath": "$.heap5", "Type": "Pass", }, "boolean__input.num": Object { - "Next": "typeof input.obj == \\"object\\"", + "Next": "typeof input.obj === \\"object\\"", "Result": "boolean", "ResultPath": "$.heap8", "Type": "Pass", @@ -12110,31 +12110,31 @@ Object { "Type": "Pass", }, "boolean__input.str": Object { - "Next": "typeof input.bool == \\"boolean\\"", + "Next": "typeof input.bool === \\"boolean\\"", "Result": "boolean", "ResultPath": "$.heap2", "Type": "Pass", }, - "boolean__return {isString: typeof input.str == \\"string\\", stringType: typeof": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1", + "boolean__return {isString: typeof input.str === \\"string\\", stringType: typeo": Object { + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1", "Result": "boolean", "ResultPath": "$.heap0", "Type": "Pass", }, - "boolean__typeof input.bool == \\"boolean\\"": Object { - "Next": "1__typeof input.bool == \\"boolean\\"", + "boolean__typeof input.bool === \\"boolean\\"": Object { + "Next": "1__typeof input.bool === \\"boolean\\"", "Result": "boolean", "ResultPath": "$.heap3", "Type": "Pass", }, - "boolean__typeof input.num == \\"number\\"": Object { - "Next": "1__typeof input.num == \\"number\\"", + "boolean__typeof input.num === \\"number\\"": Object { + "Next": "1__typeof input.num === \\"number\\"", "Result": "boolean", "ResultPath": "$.heap6", "Type": "Pass", }, - "boolean__typeof input.obj == \\"object\\"": Object { - "Next": "1__typeof input.obj == \\"object\\"", + "boolean__typeof input.obj === \\"object\\"": Object { + "Next": "1__typeof input.obj === \\"object\\"", "Result": "boolean", "ResultPath": "$.heap9", "Type": "Pass", @@ -12390,19 +12390,19 @@ Object { "Type": "Choice", }, "number__input.arr": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input", + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu", "Result": "number", "ResultPath": "$.heap12", "Type": "Pass", }, "number__input.bool": Object { - "Next": "typeof input.num == \\"number\\"", + "Next": "typeof input.num === \\"number\\"", "Result": "number", "ResultPath": "$.heap5", "Type": "Pass", }, "number__input.num": Object { - "Next": "typeof input.obj == \\"object\\"", + "Next": "typeof input.obj === \\"object\\"", "Result": "number", "ResultPath": "$.heap8", "Type": "Pass", @@ -12414,49 +12414,49 @@ Object { "Type": "Pass", }, "number__input.str": Object { - "Next": "typeof input.bool == \\"boolean\\"", + "Next": "typeof input.bool === \\"boolean\\"", "Result": "number", "ResultPath": "$.heap2", "Type": "Pass", }, - "number__return {isString: typeof input.str == \\"string\\", stringType: typeof ": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1", + "number__return {isString: typeof input.str === \\"string\\", stringType: typeof": Object { + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1", "Result": "number", "ResultPath": "$.heap0", "Type": "Pass", }, - "number__typeof input.bool == \\"boolean\\"": Object { - "Next": "1__typeof input.bool == \\"boolean\\"", + "number__typeof input.bool === \\"boolean\\"": Object { + "Next": "1__typeof input.bool === \\"boolean\\"", "Result": "number", "ResultPath": "$.heap3", "Type": "Pass", }, - "number__typeof input.num == \\"number\\"": Object { - "Next": "1__typeof input.num == \\"number\\"", + "number__typeof input.num === \\"number\\"": Object { + "Next": "1__typeof input.num === \\"number\\"", "Result": "number", "ResultPath": "$.heap6", "Type": "Pass", }, - "number__typeof input.obj == \\"object\\"": Object { - "Next": "1__typeof input.obj == \\"object\\"", + "number__typeof input.obj === \\"object\\"": Object { + "Next": "1__typeof input.obj === \\"object\\"", "Result": "number", "ResultPath": "$.heap9", "Type": "Pass", }, "object__input.arr": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input", + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu", "Result": "object", "ResultPath": "$.heap12", "Type": "Pass", }, "object__input.bool": Object { - "Next": "typeof input.num == \\"number\\"", + "Next": "typeof input.num === \\"number\\"", "Result": "object", "ResultPath": "$.heap5", "Type": "Pass", }, "object__input.num": Object { - "Next": "typeof input.obj == \\"object\\"", + "Next": "typeof input.obj === \\"object\\"", "Result": "object", "ResultPath": "$.heap8", "Type": "Pass", @@ -12468,36 +12468,36 @@ Object { "Type": "Pass", }, "object__input.str": Object { - "Next": "typeof input.bool == \\"boolean\\"", + "Next": "typeof input.bool === \\"boolean\\"", "Result": "object", "ResultPath": "$.heap2", "Type": "Pass", }, - "object__return {isString: typeof input.str == \\"string\\", stringType: typeof ": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1", + "object__return {isString: typeof input.str === \\"string\\", stringType: typeof": Object { + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1", "Result": "object", "ResultPath": "$.heap0", "Type": "Pass", }, - "object__typeof input.bool == \\"boolean\\"": Object { - "Next": "1__typeof input.bool == \\"boolean\\"", + "object__typeof input.bool === \\"boolean\\"": Object { + "Next": "1__typeof input.bool === \\"boolean\\"", "Result": "object", "ResultPath": "$.heap3", "Type": "Pass", }, - "object__typeof input.num == \\"number\\"": Object { - "Next": "1__typeof input.num == \\"number\\"", + "object__typeof input.num === \\"number\\"": Object { + "Next": "1__typeof input.num === \\"number\\"", "Result": "object", "ResultPath": "$.heap6", "Type": "Pass", }, - "object__typeof input.obj == \\"object\\"": Object { - "Next": "1__typeof input.obj == \\"object\\"", + "object__typeof input.obj === \\"object\\"": Object { + "Next": "1__typeof input.obj === \\"object\\"", "Result": "object", "ResultPath": "$.heap9", "Type": "Pass", }, - "return {isString: typeof input.str == \\"string\\", stringType: typeof input.st": Object { + "return {isString: typeof input.str === \\"string\\", stringType: typeof input.s": Object { "Choices": Array [ Object { "And": Array [ @@ -12510,7 +12510,7 @@ Object { "Variable": "$.input.str", }, ], - "Next": "string__return {isString: typeof input.str == \\"string\\", stringType: typeof ", + "Next": "string__return {isString: typeof input.str === \\"string\\", stringType: typeof", }, Object { "And": Array [ @@ -12523,7 +12523,7 @@ Object { "Variable": "$.input.str", }, ], - "Next": "boolean__return {isString: typeof input.str == \\"string\\", stringType: typeof", + "Next": "boolean__return {isString: typeof input.str === \\"string\\", stringType: typeo", }, Object { "And": Array [ @@ -12536,31 +12536,31 @@ Object { "Variable": "$.input.str", }, ], - "Next": "number__return {isString: typeof input.str == \\"string\\", stringType: typeof ", + "Next": "number__return {isString: typeof input.str === \\"string\\", stringType: typeof", }, Object { "IsPresent": true, - "Next": "object__return {isString: typeof input.str == \\"string\\", stringType: typeof ", + "Next": "object__return {isString: typeof input.str === \\"string\\", stringType: typeof", "Variable": "$.input.str", }, ], - "Default": "undefined__return {isString: typeof input.str == \\"string\\", stringType: type", + "Default": "undefined__return {isString: typeof input.str === \\"string\\", stringType: typ", "Type": "Choice", }, "string__input.arr": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input", + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu", "Result": "string", "ResultPath": "$.heap12", "Type": "Pass", }, "string__input.bool": Object { - "Next": "typeof input.num == \\"number\\"", + "Next": "typeof input.num === \\"number\\"", "Result": "string", "ResultPath": "$.heap5", "Type": "Pass", }, "string__input.num": Object { - "Next": "typeof input.obj == \\"object\\"", + "Next": "typeof input.obj === \\"object\\"", "Result": "string", "ResultPath": "$.heap8", "Type": "Pass", @@ -12572,36 +12572,36 @@ Object { "Type": "Pass", }, "string__input.str": Object { - "Next": "typeof input.bool == \\"boolean\\"", + "Next": "typeof input.bool === \\"boolean\\"", "Result": "string", "ResultPath": "$.heap2", "Type": "Pass", }, - "string__return {isString: typeof input.str == \\"string\\", stringType: typeof ": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1", + "string__return {isString: typeof input.str === \\"string\\", stringType: typeof": Object { + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1", "Result": "string", "ResultPath": "$.heap0", "Type": "Pass", }, - "string__typeof input.bool == \\"boolean\\"": Object { - "Next": "1__typeof input.bool == \\"boolean\\"", + "string__typeof input.bool === \\"boolean\\"": Object { + "Next": "1__typeof input.bool === \\"boolean\\"", "Result": "string", "ResultPath": "$.heap3", "Type": "Pass", }, - "string__typeof input.num == \\"number\\"": Object { - "Next": "1__typeof input.num == \\"number\\"", + "string__typeof input.num === \\"number\\"": Object { + "Next": "1__typeof input.num === \\"number\\"", "Result": "string", "ResultPath": "$.heap6", "Type": "Pass", }, - "string__typeof input.obj == \\"object\\"": Object { - "Next": "1__typeof input.obj == \\"object\\"", + "string__typeof input.obj === \\"object\\"": Object { + "Next": "1__typeof input.obj === \\"object\\"", "Result": "string", "ResultPath": "$.heap9", "Type": "Pass", }, - "typeof input.bool == \\"boolean\\"": Object { + "typeof input.bool === \\"boolean\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -12614,7 +12614,7 @@ Object { "Variable": "$.input.bool", }, ], - "Next": "string__typeof input.bool == \\"boolean\\"", + "Next": "string__typeof input.bool === \\"boolean\\"", }, Object { "And": Array [ @@ -12627,7 +12627,7 @@ Object { "Variable": "$.input.bool", }, ], - "Next": "boolean__typeof input.bool == \\"boolean\\"", + "Next": "boolean__typeof input.bool === \\"boolean\\"", }, Object { "And": Array [ @@ -12640,18 +12640,18 @@ Object { "Variable": "$.input.bool", }, ], - "Next": "number__typeof input.bool == \\"boolean\\"", + "Next": "number__typeof input.bool === \\"boolean\\"", }, Object { "IsPresent": true, - "Next": "object__typeof input.bool == \\"boolean\\"", + "Next": "object__typeof input.bool === \\"boolean\\"", "Variable": "$.input.bool", }, ], - "Default": "undefined__typeof input.bool == \\"boolean\\"", + "Default": "undefined__typeof input.bool === \\"boolean\\"", "Type": "Choice", }, - "typeof input.num == \\"number\\"": Object { + "typeof input.num === \\"number\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -12664,7 +12664,7 @@ Object { "Variable": "$.input.num", }, ], - "Next": "string__typeof input.num == \\"number\\"", + "Next": "string__typeof input.num === \\"number\\"", }, Object { "And": Array [ @@ -12677,7 +12677,7 @@ Object { "Variable": "$.input.num", }, ], - "Next": "boolean__typeof input.num == \\"number\\"", + "Next": "boolean__typeof input.num === \\"number\\"", }, Object { "And": Array [ @@ -12690,18 +12690,18 @@ Object { "Variable": "$.input.num", }, ], - "Next": "number__typeof input.num == \\"number\\"", + "Next": "number__typeof input.num === \\"number\\"", }, Object { "IsPresent": true, - "Next": "object__typeof input.num == \\"number\\"", + "Next": "object__typeof input.num === \\"number\\"", "Variable": "$.input.num", }, ], - "Default": "undefined__typeof input.num == \\"number\\"", + "Default": "undefined__typeof input.num === \\"number\\"", "Type": "Choice", }, - "typeof input.obj == \\"object\\"": Object { + "typeof input.obj === \\"object\\"": Object { "Choices": Array [ Object { "And": Array [ @@ -12714,7 +12714,7 @@ Object { "Variable": "$.input.obj", }, ], - "Next": "string__typeof input.obj == \\"object\\"", + "Next": "string__typeof input.obj === \\"object\\"", }, Object { "And": Array [ @@ -12727,7 +12727,7 @@ Object { "Variable": "$.input.obj", }, ], - "Next": "boolean__typeof input.obj == \\"object\\"", + "Next": "boolean__typeof input.obj === \\"object\\"", }, Object { "And": Array [ @@ -12740,31 +12740,31 @@ Object { "Variable": "$.input.obj", }, ], - "Next": "number__typeof input.obj == \\"object\\"", + "Next": "number__typeof input.obj === \\"object\\"", }, Object { "IsPresent": true, - "Next": "object__typeof input.obj == \\"object\\"", + "Next": "object__typeof input.obj === \\"object\\"", "Variable": "$.input.obj", }, ], - "Default": "undefined__typeof input.obj == \\"object\\"", + "Default": "undefined__typeof input.obj === \\"object\\"", "Type": "Choice", }, "undefined__input.arr": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input", + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu", "Result": "undefined", "ResultPath": "$.heap12", "Type": "Pass", }, "undefined__input.bool": Object { - "Next": "typeof input.num == \\"number\\"", + "Next": "typeof input.num === \\"number\\"", "Result": "undefined", "ResultPath": "$.heap5", "Type": "Pass", }, "undefined__input.num": Object { - "Next": "typeof input.obj == \\"object\\"", + "Next": "typeof input.obj === \\"object\\"", "Result": "undefined", "ResultPath": "$.heap8", "Type": "Pass", @@ -12776,31 +12776,31 @@ Object { "Type": "Pass", }, "undefined__input.str": Object { - "Next": "typeof input.bool == \\"boolean\\"", + "Next": "typeof input.bool === \\"boolean\\"", "Result": "undefined", "ResultPath": "$.heap2", "Type": "Pass", }, - "undefined__return {isString: typeof input.str == \\"string\\", stringType: type": Object { - "Next": "1__return {isString: typeof input.str == \\"string\\", stringType: typeof input 1", + "undefined__return {isString: typeof input.str === \\"string\\", stringType: typ": Object { + "Next": "1__return {isString: typeof input.str === \\"string\\", stringType: typeof inpu 1", "Result": "undefined", "ResultPath": "$.heap0", "Type": "Pass", }, - "undefined__typeof input.bool == \\"boolean\\"": Object { - "Next": "1__typeof input.bool == \\"boolean\\"", + "undefined__typeof input.bool === \\"boolean\\"": Object { + "Next": "1__typeof input.bool === \\"boolean\\"", "Result": "undefined", "ResultPath": "$.heap3", "Type": "Pass", }, - "undefined__typeof input.num == \\"number\\"": Object { - "Next": "1__typeof input.num == \\"number\\"", + "undefined__typeof input.num === \\"number\\"": Object { + "Next": "1__typeof input.num === \\"number\\"", "Result": "undefined", "ResultPath": "$.heap6", "Type": "Pass", }, - "undefined__typeof input.obj == \\"object\\"": Object { - "Next": "1__typeof input.obj == \\"object\\"", + "undefined__typeof input.obj === \\"object\\"": Object { + "Next": "1__typeof input.obj === \\"object\\"", "Result": "undefined", "ResultPath": "$.heap9", "Type": "Pass", diff --git a/test/__snapshots__/step-function.test.ts.snap b/test/__snapshots__/step-function.test.ts.snap index 536168cc..6cce6061 100644 --- a/test/__snapshots__/step-function.test.ts.snap +++ b/test/__snapshots__/step-function.test.ts.snap @@ -61,16 +61,16 @@ Object { "$SFN.map([1, 2, 3], function(item))": Object { "ItemsPath": "$.heap1", "Iterator": Object { - "StartAt": "return \`nitem\`", + "StartAt": "return n\${item}", "States": Object { - "1__return \`nitem\`": Object { + "1__return n\${item}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", "Type": "Pass", }, - "return \`nitem\`": Object { - "Next": "1__return \`nitem\`", + "return n\${item}": Object { + "Next": "1__return n\${item}", "Parameters": Object { "string.$": "States.Format('n{}',$.item)", }, @@ -982,7 +982,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "1__return item == {a: \\"a\\"}": Object { + "1__return item === {a: \\"a\\"}": Object { "InputPath": "$.heap3", "Next": "handleResult__[{}].filter(function(item))", "ResultPath": "$.heap2", @@ -1007,14 +1007,14 @@ Object { "ResultPath": "$.heap1", "Type": "Pass", }, - "assignFalse__return item == {a: \\"a\\"}": Object { - "Next": "1__return item == {a: \\"a\\"}", + "assignFalse__return item === {a: \\"a\\"}": Object { + "Next": "1__return item === {a: \\"a\\"}", "Result": false, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignTrue__return item == {a: \\"a\\"}": Object { - "Next": "1__return item == {a: \\"a\\"}", + "assignTrue__return item === {a: \\"a\\"}": Object { + "Next": "1__return item === {a: \\"a\\"}", "Result": true, "ResultPath": "$.heap3", "Type": "Pass", @@ -1119,7 +1119,7 @@ Object { }, "item": Object { "InputPath": "$.heap1.arr[0]", - "Next": "return item == {a: \\"a\\"}", + "Next": "return item === {a: \\"a\\"}", "ResultPath": "$.item", "Type": "Pass", }, @@ -1140,7 +1140,7 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "return item == {a: \\"a\\"}": Object { + "return item === {a: \\"a\\"}": Object { "Choices": Array [ Object { "And": Array [ @@ -1153,10 +1153,10 @@ Object { "Variable": "$$.Execution.Id", }, ], - "Next": "assignTrue__return item == {a: \\"a\\"}", + "Next": "assignTrue__return item === {a: \\"a\\"}", }, ], - "Default": "assignFalse__return item == {a: \\"a\\"}", + "Default": "assignFalse__return item === {a: \\"a\\"}", "Type": "Choice", }, "set__end__[{}].filter(function(item))": Object { @@ -1185,7 +1185,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "1__return value == a": Object { + "1__return value === a": Object { "InputPath": "$.heap3", "Next": "handleResult__[{value: \\"a\\"}].filter(function(item))", "ResultPath": "$.heap2", @@ -1216,14 +1216,14 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "assignFalse__return value == a": Object { - "Next": "1__return value == a", + "assignFalse__return value === a": Object { + "Next": "1__return value === a", "Result": false, "ResultPath": "$.heap3", "Type": "Pass", }, - "assignTrue__return value == a": Object { - "Next": "1__return value == a", + "assignTrue__return value === a": Object { + "Next": "1__return value === a", "Result": true, "ResultPath": "$.heap3", "Type": "Pass", @@ -1351,7 +1351,7 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "return value == a": Object { + "return value === a": Object { "Choices": Array [ Object { "And": Array [ @@ -1412,10 +1412,10 @@ Object { ], }, ], - "Next": "assignTrue__return value == a", + "Next": "assignTrue__return value === a", }, ], - "Default": "assignFalse__return value == a", + "Default": "assignFalse__return value === a", "Type": "Choice", }, "set__end__[{value: \\"a\\"}].filter(function(item))": Object { @@ -1432,7 +1432,7 @@ Object { }, "{value} = item": Object { "InputPath": "$.item['value']", - "Next": "return value == a", + "Next": "return value === a", "ResultPath": "$.value", "Type": "Pass", }, @@ -1603,14 +1603,14 @@ exports[`\`template me \${await task(input.value)}\` 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`template me await task(input.value)\`": Object { + "1__return template me \${await task(input.value)}": Object { "End": true, "InputPath": "$.heap1.string", "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "return \`template me await task(input.value)\`", + "Next": "return template me \${await task(input.value)}", "Parameters": Object { "fnl_context": Object { "null": null, @@ -1620,21 +1620,21 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "\`template me await task(input.value)\`": Object { - "Next": "1__return \`template me await task(input.value)\`", + "return template me \${await task(input.value)}": Object { + "InputPath": "$.input.value", + "Next": "template me \${await task(input.value)}", + "Resource": "__REPLACED_TOKEN", + "ResultPath": "$.heap0", + "Type": "Task", + }, + "template me \${await task(input.value)}": Object { + "Next": "1__return template me \${await task(input.value)}", "Parameters": Object { "string.$": "States.Format('template me {}',$.heap0)", }, "ResultPath": "$.heap1", "Type": "Pass", }, - "return \`template me await task(input.value)\`": Object { - "InputPath": "$.input.value", - "Next": "\`template me await task(input.value)\`", - "Resource": "__REPLACED_TOKEN", - "ResultPath": "$.heap0", - "Type": "Task", - }, }, } `; @@ -1643,14 +1643,14 @@ exports[`\`template me \${input.value}\` 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`template me input.value\`": Object { + "1__return template me \${input.value}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "return \`template me input.value\`", + "Next": "return template me \${input.value}", "Parameters": Object { "fnl_context": Object { "null": null, @@ -1660,8 +1660,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return \`template me input.value\`": Object { - "Next": "1__return \`template me input.value\`", + "return template me \${input.value}": Object { + "Next": "1__return template me \${input.value}", "Parameters": Object { "string.$": "States.Format('template me {}',$.input.value)", }, @@ -1833,12 +1833,12 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "1__for({key,value} = {key: \\"x\\", value: \\"y\\"};;) 1": Object { - "Next": "return \`keyvalue\`", + "Next": "return \${key}\${value}", "Result": "y", "ResultPath": "$.value", "Type": "Pass", }, - "1__return \`keyvalue\`": Object { + "1__return \${key}\${value}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", @@ -1860,8 +1860,8 @@ Object { "ResultPath": "$.key", "Type": "Pass", }, - "return \`keyvalue\`": Object { - "Next": "1__return \`keyvalue\`", + "return \${key}\${value}": Object { + "Next": "1__return \${key}\${value}", "Parameters": Object { "string.$": "States.Format('{}{}',$.key,$.value)", }, @@ -1876,7 +1876,7 @@ exports[`binding forOf 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`keyvaluea\`": Object { + "1__a = \${key}\${value}\${a}": Object { "InputPath": "$.heap0.string", "Next": "tail__for({key,value} of input.value)", "ResultPath": "$.a", @@ -1884,7 +1884,7 @@ Object { }, "1__{ key, value }": Object { "InputPath": "$.heap1[0]['value']", - "Next": "a = \`keyvaluea\`", + "Next": "a = \${key}\${value}\${a}", "ResultPath": "$.value", "Type": "Pass", }, @@ -1905,8 +1905,8 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`keyvaluea\`": Object { - "Next": "1__a = \`keyvaluea\`", + "a = \${key}\${value}\${a}": Object { + "Next": "1__a = \${key}\${value}\${a}", "Parameters": Object { "string.$": "States.Format('{}{}{}',$.key,$.value,$.a)", }, @@ -1972,7 +1972,7 @@ Object { "Iterator": Object { "StartAt": "function({value:b,arr:[c]})", "States": Object { - "1__return \`bc\`": Object { + "1__return \${b}\${c}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", @@ -1980,7 +1980,7 @@ Object { }, "[ c ]": Object { "InputPath": "$.heap1['arr'][0]", - "Next": "return \`bc\`", + "Next": "return \${b}\${c}", "ResultPath": "$.c", "Type": "Pass", }, @@ -1990,8 +1990,8 @@ Object { "ResultPath": "$.b", "Type": "Pass", }, - "return \`bc\`": Object { - "Next": "1__return \`bc\`", + "return \${b}\${c}": Object { + "Next": "1__return \${b}\${c}", "Parameters": Object { "string.$": "States.Format('{}{}',$.b,$.c)", }, @@ -2108,7 +2108,7 @@ Object { "Iterator": Object { "StartAt": "function({value:b,arr:[c]})", "States": Object { - "1__return \`bc\`": Object { + "1__return \${b}\${c}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", @@ -2116,7 +2116,7 @@ Object { }, "[ c ]": Object { "InputPath": "$.heap1['arr'][0]", - "Next": "return \`bc\`", + "Next": "return \${b}\${c}", "ResultPath": "$.c", "Type": "Pass", }, @@ -2126,8 +2126,8 @@ Object { "ResultPath": "$.b", "Type": "Pass", }, - "return \`bc\`": Object { - "Next": "1__return \`bc\`", + "return \${b}\${c}": Object { + "Next": "1__return \${b}\${c}", "Parameters": Object { "string.$": "States.Format('{}{}',$.b,$.c)", }, @@ -2190,7 +2190,7 @@ exports[`binding functions forEach 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`bc\`": Object { + "1__return \${b}\${c}": Object { "InputPath": "$.heap1.string", "Next": "tail__input.value.forEach(function({value:b,arr:[c]}))", "ResultPath": "$.heap0.arr[0]", @@ -2209,7 +2209,7 @@ Object { }, "[ c ]": Object { "InputPath": "$.heap0.arr[0]['arr'][0]", - "Next": "return \`bc\`", + "Next": "return \${b}\${c}", "ResultPath": "$.c", "Type": "Pass", }, @@ -2244,8 +2244,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return \`bc\`": Object { - "Next": "1__return \`bc\`", + "return \${b}\${c}": Object { + "Next": "1__return \${b}\${c}", "Parameters": Object { "string.$": "States.Format('{}{}',$.b,$.c)", }, @@ -2272,7 +2272,7 @@ exports[`binding functions map 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`bc\`": Object { + "1__return \${b}\${c}": Object { "InputPath": "$.heap1.string", "Next": "handleResult__return input.value.map(function({value:b,arr:[c]})).join()", "ResultPath": "$.heap0.arr[0]", @@ -2303,7 +2303,7 @@ Object { }, "[ c ]": Object { "InputPath": "$.heap0.arr[0]['arr'][0]", - "Next": "return \`bc\`", + "Next": "return \${b}\${c}", "ResultPath": "$.c", "Type": "Pass", }, @@ -2392,8 +2392,8 @@ Object { "ResultPath": "$.heap3.string", "Type": "Pass", }, - "return \`bc\`": Object { - "Next": "1__return \`bc\`", + "return \${b}\${c}": Object { + "Next": "1__return \${b}\${c}", "Parameters": Object { "string.$": "States.Format('{}{}',$.b,$.c)", }, @@ -2441,6 +2441,12 @@ exports[`binding functions use in map 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { + "1__return \${value}\${v}": Object { + "InputPath": "$.heap2.string", + "Next": "handleResult__1__return [1, 2, 3].map(function()).join() 2", + "ResultPath": "$.heap1.arr[0]", + "Type": "Pass", + }, "1__return [1, 2, 3].map(function()).join()": Object { "End": true, "InputPath": "$.heap4.string", @@ -2462,12 +2468,6 @@ Object { "ResultPath": "$.heap1", "Type": "Pass", }, - "1__return \`valuev\`": Object { - "InputPath": "$.heap2.string", - "Next": "handleResult__1__return [1, 2, 3].map(function()).join() 2", - "ResultPath": "$.heap1.arr[0]", - "Type": "Pass", - }, "1__{ value, obj }": Object { "InputPath": "$$.Execution.Input['obj']", "Next": "{value:v} = obj", @@ -2496,7 +2496,7 @@ Object { "Choices": Array [ Object { "IsPresent": true, - "Next": "return \`valuev\`", + "Next": "return \${value}\${v}", "Variable": "$.heap1.arr[0]", }, ], @@ -2569,6 +2569,14 @@ Object { "ResultPath": "$.heap4.string", "Type": "Pass", }, + "return \${value}\${v}": Object { + "Next": "1__return \${value}\${v}", + "Parameters": Object { + "string.$": "States.Format('{}{}',$.value,$.v)", + }, + "ResultPath": "$.heap2", + "Type": "Pass", + }, "return [1, 2, 3].map(function()).join()": Object { "Next": "1__return [1, 2, 3].map(function()).join() 2", "Result": Array [ @@ -2579,14 +2587,6 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "return \`valuev\`": Object { - "Next": "1__return \`valuev\`", - "Parameters": Object { - "string.$": "States.Format('{}{}',$.value,$.v)", - }, - "ResultPath": "$.heap2", - "Type": "Pass", - }, "returnEmpty__1__return [1, 2, 3].map(function()).join() 1": Object { "Next": "1__return [1, 2, 3].map(function()).join()", "Result": "", @@ -4294,7 +4294,7 @@ Object { "Default": "return null", "Type": "Choice", }, - "if(item == \\"hello\\")": Object { + "if(item === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -4323,7 +4323,7 @@ Object { }, "item": Object { "InputPath": "$.heap0[0]", - "Next": "if(item == \\"hello\\")", + "Next": "if(item === \\"hello\\")", "ResultPath": "$.item", "Type": "Pass", }, @@ -4384,7 +4384,7 @@ Object { "States": Object { "1__person = await $AWS.DynamoDB.GetItem({Table: personTable, Key: {id: {S: ": Object { "InputPath": "$.heap0", - "Next": "if(person.Item == undefined)", + "Next": "if(person.Item === undefined)", "ResultPath": "$.person", "Type": "Pass", }, @@ -4405,7 +4405,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(person.Item == undefined)": Object { + "if(person.Item === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -4418,7 +4418,7 @@ Object { "Variable": "$$.Execution.Id", }, ], - "Next": "return null", + "Next": "return", }, ], "Default": "score = await computeScore({id: person.Item.id.S, name: person.Item.name.S}", @@ -4438,7 +4438,7 @@ Object { "ResultPath": "$.heap0", "Type": "Task", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -4967,7 +4967,7 @@ exports[`closure from map 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`aitem\`": Object { + "1__return \${a}\${item}": Object { "InputPath": "$.heap1.string", "Next": "handleResult__return input.list.map(function(item))", "ResultPath": "$.heap0.arr[0]", @@ -5026,12 +5026,12 @@ Object { }, "item": Object { "InputPath": "$.heap0.arr[0]", - "Next": "return \`aitem\`", + "Next": "return \${a}\${item}", "ResultPath": "$.item", "Type": "Pass", }, - "return \`aitem\`": Object { - "Next": "1__return \`aitem\`", + "return \${a}\${item}": Object { + "Next": "1__return \${a}\${item}", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.item)", }, @@ -5061,7 +5061,7 @@ exports[`condition on task output 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__if(await task() == 1)": Object { + "1__if(await task() === 1)": Object { "Choices": Array [ Object { "And": Array [ @@ -5082,14 +5082,14 @@ Object { ], }, ], - "Next": "return null 1", + "Next": "return", }, ], "Default": "return null", "Type": "Choice", }, "Initialize Functionless Context": Object { - "Next": "if(await task() == 1)", + "Next": "if(await task() === 1)", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5098,20 +5098,20 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(await task() == 1)": Object { + "if(await task() === 1)": Object { "InputPath": "$.fnl_context.null", - "Next": "1__if(await task() == 1)", + "Next": "1__if(await task() === 1)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", "Type": "Pass", }, - "return null 1": Object { + "return null": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -5126,7 +5126,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.id == \\"hello\\")", + "Next": "if(input.id === \\"hello\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5150,7 +5150,7 @@ Object { "ResultPath": "$.heap0", "Type": "Task", }, - "if(input.id == \\"hello\\")": Object { + "if(input.id === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5192,7 +5192,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.id == \\"hello\\")", + "Next": "if(input.id === \\"hello\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5202,7 +5202,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.id == \\"hello\\")": Object { + "if(input.id === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5223,19 +5223,19 @@ Object { ], }, ], - "Next": "return null 1", + "Next": "return", }, ], "Default": "return null", "Type": "Choice", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", "Type": "Pass", }, - "return null 1": Object { + "return null": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -5250,7 +5250,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.id == \\"hello\\")", + "Next": "if(input.id === \\"hello\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5260,7 +5260,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.id == \\"hello\\")": Object { + "if(input.id === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5281,19 +5281,19 @@ Object { ], }, ], - "Next": "return null 1", + "Next": "return", }, ], "Default": "return null", "Type": "Choice", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", "Type": "Pass", }, - "return null 1": Object { + "return null": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -5308,7 +5308,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.key == \\"sam\\")", + "Next": "if(input.key === \\"sam\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5320,23 +5320,23 @@ Object { }, "await task(input.key)": Object { "InputPath": "$.input.key", - "Next": "if(input.key == \\"sam\\")", + "Next": "if(input.key === \\"sam\\")", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", }, - "if(input.key == \\"sam\\")": Object { + "if(input.key === \\"sam\\")": Object { "Choices": Array [ Object { "IsNull": false, - "Next": "if(input.key == \\"sam\\") 1", + "Next": "if(input.key === \\"sam\\") 1", "Variable": "$$.Execution.Id", }, ], "Default": "return null", "Type": "Choice", }, - "if(input.key == \\"sam\\") 1": Object { + "if(input.key === \\"sam\\") 1": Object { "Choices": Array [ Object { "And": Array [ @@ -5357,7 +5357,7 @@ Object { ], }, ], - "Next": "if(input.key == \\"sam\\")", + "Next": "if(input.key === \\"sam\\")", }, ], "Default": "await task(input.key)", @@ -5405,7 +5405,7 @@ Object { "Default": "return null", "Type": "Choice", }, - "if(item == \\"hello\\")": Object { + "if(item === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5434,7 +5434,7 @@ Object { }, "item": Object { "InputPath": "$.heap0[0]", - "Next": "if(item == \\"hello\\")", + "Next": "if(item === \\"hello\\")", "ResultPath": "$.item", "Type": "Pass", }, @@ -5476,7 +5476,7 @@ Object { "ResultPath": "$.heap0", "Type": "Task", }, - "if(input.key == \\"sam\\")": Object { + "if(input.key === \\"sam\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5513,7 +5513,7 @@ Object { "Choices": Array [ Object { "IsNull": false, - "Next": "if(input.key == \\"sam\\")", + "Next": "if(input.key === \\"sam\\")", "Variable": "$$.Execution.Id", }, ], @@ -5529,7 +5529,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.val == \\"a\\")", + "Next": "if(input.val === \\"a\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5539,7 +5539,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.val == \\"a\\")": Object { + "if(input.val === \\"a\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -5641,7 +5641,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.val == \\"a\\")", + "Next": "if(input.val === \\"a\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -5651,7 +5651,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.val == \\"a\\")": Object { + "if(input.val === \\"a\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6010,13 +6010,13 @@ exports[`for assign 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`i\`": Object { + "1__a = \${i}": Object { "InputPath": "$.heap0.string", "Next": "tail__for(i in input.items)", "ResultPath": "$.a", "Type": "Pass", }, - "1__a = \`i\` 1": Object { + "1__a = \${i} 1": Object { "InputPath": "$.heap2.string", "Next": "tail__for(i of input.items)", "ResultPath": "$.a", @@ -6059,16 +6059,16 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`i\`": Object { - "Next": "1__a = \`i\`", + "a = \${i}": Object { + "Next": "1__a = \${i}", "Parameters": Object { "string.$": "States.Format('{}',$.i)", }, "ResultPath": "$.heap0", "Type": "Pass", }, - "a = \`i\` 1": Object { - "Next": "1__a = \`i\` 1", + "a = \${i} 1": Object { + "Next": "1__a = \${i} 1", "Parameters": Object { "string.$": "States.Format('{}',$.i)", }, @@ -6077,7 +6077,7 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap1[0].item", - "Next": "a = \`i\`", + "Next": "a = \${i}", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -6123,7 +6123,7 @@ Object { }, "i 1": Object { "InputPath": "$.heap3[0]", - "Next": "a = \`i\` 1", + "Next": "a = \${i} 1", "ResultPath": "$.i", "Type": "Pass", }, @@ -6186,7 +6186,7 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap0[0].item", - "Next": "if(input.items[i] == \\"1\\")", + "Next": "if(input.items[i] === \\"1\\")", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -6232,11 +6232,11 @@ Object { }, "i 1": Object { "InputPath": "$.heap1[0]", - "Next": "if(i == \\"1\\")", + "Next": "if(i === \\"1\\")", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == \\"1\\")": Object { + "if(i === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6263,7 +6263,7 @@ Object { "Default": "return i", "Type": "Choice", }, - "if(input.items[i] == \\"1\\")": Object { + "if(input.items[i] === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6435,7 +6435,7 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap0[0].item", - "Next": "if(input.items[i] == \\"1\\")", + "Next": "if(input.items[i] === \\"1\\")", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -6481,11 +6481,11 @@ Object { }, "i 1": Object { "InputPath": "$.heap1[0]", - "Next": "if(i == \\"1\\")", + "Next": "if(i === \\"1\\")", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == \\"1\\")": Object { + "if(i === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6512,7 +6512,7 @@ Object { "Default": "return i", "Type": "Choice", }, - "if(input.items[i] == \\"1\\")": Object { + "if(input.items[i] === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6696,7 +6696,7 @@ Object { }, "assignValue__i": Object { "InputPath": "$.heap0[0].item", - "Next": "if(input.items[i] == \\"1\\")", + "Next": "if(input.items[i] === \\"1\\")", "ResultPath": "$.0__i", "Type": "Pass", }, @@ -6742,11 +6742,11 @@ Object { }, "i 1": Object { "InputPath": "$.heap1[0]", - "Next": "if(i == \\"1\\")", + "Next": "if(i === \\"1\\")", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == \\"1\\")": Object { + "if(i === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6773,7 +6773,7 @@ Object { "Default": "tail__for(i of input.items)", "Type": "Choice", }, - "if(input.items[i] == \\"1\\")": Object { + "if(input.items[i] === \\"1\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -6868,7 +6868,7 @@ exports[`for(;;) loop 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__for(i = 0;i < 3;i = if(i == 0))": Object { + "1__for(i = 0;i < 3;i = if(i === 0))": Object { "Choices": Array [ Object { "And": Array [ @@ -6895,14 +6895,14 @@ Object { "Default": "return null", "Type": "Choice", }, - "1__i = if(i == 0)": Object { + "1__i = if(i === 0)": Object { "InputPath": "$.heap2", - "Next": "1__for(i = 0;i < 3;i = if(i == 0))", + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", "ResultPath": "$.i", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "for(i = 0;i < 3;i = if(i == 0))", + "Next": "for(i = 0;i < 3;i = if(i === 0))", "Parameters": Object { "fnl_context": Object { "null": null, @@ -6911,26 +6911,26 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "assign__doFalse__i = if(i == 0)": Object { + "assign__doFalse__i = if(i === 0)": Object { "InputPath": "$.heap1", - "Next": "1__i = if(i == 0)", + "Next": "1__i = if(i === 0)", "ResultPath": "$.heap2", "Type": "Pass", }, "await task(i)": Object { "InputPath": "$.i", - "Next": "i = if(i == 0)", + "Next": "i = if(i === 0)", "Resource": "__REPLACED_TOKEN", "ResultPath": "$.heap0", "Type": "Task", }, - "doFalse__doFalse__i = if(i == 0)": Object { - "Next": "assign__doFalse__i = if(i == 0)", + "doFalse__doFalse__i = if(i === 0)": Object { + "Next": "assign__doFalse__i = if(i === 0)", "Result": 3, "ResultPath": "$.heap1", "Type": "Pass", }, - "doFalse__i = if(i == 0)": Object { + "doFalse__i = if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -6951,31 +6951,31 @@ Object { ], }, ], - "Next": "doTrue__doFalse__i = if(i == 0)", + "Next": "doTrue__doFalse__i = if(i === 0)", }, ], - "Default": "doFalse__doFalse__i = if(i == 0)", + "Default": "doFalse__doFalse__i = if(i === 0)", "Type": "Choice", }, - "doTrue__doFalse__i = if(i == 0)": Object { - "Next": "assign__doFalse__i = if(i == 0)", + "doTrue__doFalse__i = if(i === 0)": Object { + "Next": "assign__doFalse__i = if(i === 0)", "Result": 2, "ResultPath": "$.heap1", "Type": "Pass", }, - "doTrue__i = if(i == 0)": Object { - "Next": "1__i = if(i == 0)", + "doTrue__i = if(i === 0)": Object { + "Next": "1__i = if(i === 0)", "Result": 1, "ResultPath": "$.heap2", "Type": "Pass", }, - "for(i = 0;i < 3;i = if(i == 0))": Object { - "Next": "1__for(i = 0;i < 3;i = if(i == 0))", + "for(i = 0;i < 3;i = if(i === 0))": Object { + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", "Result": 0, "ResultPath": "$.i", "Type": "Pass", }, - "i = if(i == 0)": Object { + "i = if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -6996,10 +6996,10 @@ Object { ], }, ], - "Next": "doTrue__i = if(i == 0)", + "Next": "doTrue__i = if(i === 0)", }, ], - "Default": "doFalse__i = if(i == 0)", + "Default": "doFalse__i = if(i === 0)", "Type": "Choice", }, "return null": Object { @@ -7159,7 +7159,7 @@ exports[`for(;;) loop empty body 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__for(i = 0;i < 3;i = if(i == 0))": Object { + "1__for(i = 0;i < 3;i = if(i === 0))": Object { "Choices": Array [ Object { "And": Array [ @@ -7180,20 +7180,20 @@ Object { ], }, ], - "Next": "i = if(i == 0)", + "Next": "i = if(i === 0)", }, ], "Default": "return null", "Type": "Choice", }, - "1__i = if(i == 0)": Object { + "1__i = if(i === 0)": Object { "InputPath": "$.heap1", - "Next": "1__for(i = 0;i < 3;i = if(i == 0))", + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", "ResultPath": "$.i", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "for(i = 0;i < 3;i = if(i == 0))", + "Next": "for(i = 0;i < 3;i = if(i === 0))", "Parameters": Object { "fnl_context": Object { "null": null, @@ -7202,19 +7202,19 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "assign__doFalse__i = if(i == 0)": Object { + "assign__doFalse__i = if(i === 0)": Object { "InputPath": "$.heap0", - "Next": "1__i = if(i == 0)", + "Next": "1__i = if(i === 0)", "ResultPath": "$.heap1", "Type": "Pass", }, - "doFalse__doFalse__i = if(i == 0)": Object { - "Next": "assign__doFalse__i = if(i == 0)", + "doFalse__doFalse__i = if(i === 0)": Object { + "Next": "assign__doFalse__i = if(i === 0)", "Result": 3, "ResultPath": "$.heap0", "Type": "Pass", }, - "doFalse__i = if(i == 0)": Object { + "doFalse__i = if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -7235,31 +7235,31 @@ Object { ], }, ], - "Next": "doTrue__doFalse__i = if(i == 0)", + "Next": "doTrue__doFalse__i = if(i === 0)", }, ], - "Default": "doFalse__doFalse__i = if(i == 0)", + "Default": "doFalse__doFalse__i = if(i === 0)", "Type": "Choice", }, - "doTrue__doFalse__i = if(i == 0)": Object { - "Next": "assign__doFalse__i = if(i == 0)", + "doTrue__doFalse__i = if(i === 0)": Object { + "Next": "assign__doFalse__i = if(i === 0)", "Result": 2, "ResultPath": "$.heap0", "Type": "Pass", }, - "doTrue__i = if(i == 0)": Object { - "Next": "1__i = if(i == 0)", + "doTrue__i = if(i === 0)": Object { + "Next": "1__i = if(i === 0)", "Result": 1, "ResultPath": "$.heap1", "Type": "Pass", }, - "for(i = 0;i < 3;i = if(i == 0))": Object { - "Next": "1__for(i = 0;i < 3;i = if(i == 0))", + "for(i = 0;i < 3;i = if(i === 0))": Object { + "Next": "1__for(i = 0;i < 3;i = if(i === 0))", "Result": 0, "ResultPath": "$.i", "Type": "Pass", }, - "i = if(i == 0)": Object { + "i = if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -7280,10 +7280,10 @@ Object { ], }, ], - "Next": "doTrue__i = if(i == 0)", + "Next": "doTrue__i = if(i === 0)", }, ], - "Default": "doFalse__i = if(i == 0)", + "Default": "doFalse__i = if(i === 0)", "Type": "Choice", }, "return null": Object { @@ -7356,10 +7356,10 @@ Object { "Variable": "$.heap0[0]", }, ], - "Default": "return null", + "Default": "return", "Type": "Choice", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -7611,7 +7611,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"you dun' goofed\\")", + "Next": "if(err.message === \\"you dun' goofed\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -7647,7 +7647,7 @@ Object { "Default": "return null", "Type": "Choice", }, - "if(err.message == \\"you dun' goofed\\")": Object { + "if(err.message === \\"you dun' goofed\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -7780,10 +7780,10 @@ Object { "Variable": "$.heap0[0]", }, ], - "Default": "return null", + "Default": "return", "Type": "Choice", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -7809,7 +7809,7 @@ exports[`if (?? === typeof x) 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "5__if(input.id == undefined)": Object { + "5__if(input.id === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -7934,7 +7934,7 @@ Object { "Type": "Choice", }, "Initialize Functionless Context": Object { - "Next": "if(input.id == undefined)", + "Next": "if(input.id === undefined)", "Parameters": Object { "fnl_context": Object { "null": null, @@ -7944,7 +7944,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "boolean__if(input.id == undefined)": Object { + "boolean__if(input.id === undefined)": Object { "Next": "input.id", "Result": "boolean", "ResultPath": "$.heap0", @@ -7969,12 +7969,12 @@ Object { "Type": "Pass", }, "boolean__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "boolean", "ResultPath": "$.heap4", "Type": "Pass", }, - "if(input.id == undefined)": Object { + "if(input.id === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -7987,7 +7987,7 @@ Object { "Variable": "$.input.id", }, ], - "Next": "string__if(input.id == undefined)", + "Next": "string__if(input.id === undefined)", }, Object { "And": Array [ @@ -8000,7 +8000,7 @@ Object { "Variable": "$.input.id", }, ], - "Next": "boolean__if(input.id == undefined)", + "Next": "boolean__if(input.id === undefined)", }, Object { "And": Array [ @@ -8013,15 +8013,15 @@ Object { "Variable": "$.input.id", }, ], - "Next": "number__if(input.id == undefined)", + "Next": "number__if(input.id === undefined)", }, Object { "IsPresent": true, - "Next": "object__if(input.id == undefined)", + "Next": "object__if(input.id === undefined)", "Variable": "$.input.id", }, ], - "Default": "undefined__if(input.id == undefined)", + "Default": "undefined__if(input.id === undefined)", "Type": "Choice", }, "input.id": Object { @@ -8224,7 +8224,7 @@ Object { "Default": "undefined__input.id 3", "Type": "Choice", }, - "number__if(input.id == undefined)": Object { + "number__if(input.id === undefined)": Object { "Next": "input.id", "Result": "number", "ResultPath": "$.heap0", @@ -8249,12 +8249,12 @@ Object { "Type": "Pass", }, "number__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "number", "ResultPath": "$.heap4", "Type": "Pass", }, - "object__if(input.id == undefined)": Object { + "object__if(input.id === undefined)": Object { "Next": "input.id", "Result": "object", "ResultPath": "$.heap0", @@ -8279,7 +8279,7 @@ Object { "Type": "Pass", }, "object__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "object", "ResultPath": "$.heap4", "Type": "Pass", @@ -8326,7 +8326,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "string__if(input.id == undefined)": Object { + "string__if(input.id === undefined)": Object { "Next": "input.id", "Result": "string", "ResultPath": "$.heap0", @@ -8351,12 +8351,12 @@ Object { "Type": "Pass", }, "string__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "string", "ResultPath": "$.heap4", "Type": "Pass", }, - "undefined__if(input.id == undefined)": Object { + "undefined__if(input.id === undefined)": Object { "Next": "input.id", "Result": "undefined", "ResultPath": "$.heap0", @@ -8381,7 +8381,7 @@ Object { "Type": "Pass", }, "undefined__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "undefined", "ResultPath": "$.heap4", "Type": "Pass", @@ -8394,7 +8394,7 @@ exports[`if (typeof x === ??) 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "5__if(input.id == undefined)": Object { + "5__if(input.id === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -8519,7 +8519,7 @@ Object { "Type": "Choice", }, "Initialize Functionless Context": Object { - "Next": "if(input.id == undefined)", + "Next": "if(input.id === undefined)", "Parameters": Object { "fnl_context": Object { "null": null, @@ -8529,7 +8529,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "boolean__if(input.id == undefined)": Object { + "boolean__if(input.id === undefined)": Object { "Next": "input.id", "Result": "boolean", "ResultPath": "$.heap0", @@ -8554,12 +8554,12 @@ Object { "Type": "Pass", }, "boolean__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "boolean", "ResultPath": "$.heap4", "Type": "Pass", }, - "if(input.id == undefined)": Object { + "if(input.id === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -8572,7 +8572,7 @@ Object { "Variable": "$.input.id", }, ], - "Next": "string__if(input.id == undefined)", + "Next": "string__if(input.id === undefined)", }, Object { "And": Array [ @@ -8585,7 +8585,7 @@ Object { "Variable": "$.input.id", }, ], - "Next": "boolean__if(input.id == undefined)", + "Next": "boolean__if(input.id === undefined)", }, Object { "And": Array [ @@ -8598,15 +8598,15 @@ Object { "Variable": "$.input.id", }, ], - "Next": "number__if(input.id == undefined)", + "Next": "number__if(input.id === undefined)", }, Object { "IsPresent": true, - "Next": "object__if(input.id == undefined)", + "Next": "object__if(input.id === undefined)", "Variable": "$.input.id", }, ], - "Default": "undefined__if(input.id == undefined)", + "Default": "undefined__if(input.id === undefined)", "Type": "Choice", }, "input.id": Object { @@ -8809,7 +8809,7 @@ Object { "Default": "undefined__input.id 3", "Type": "Choice", }, - "number__if(input.id == undefined)": Object { + "number__if(input.id === undefined)": Object { "Next": "input.id", "Result": "number", "ResultPath": "$.heap0", @@ -8834,12 +8834,12 @@ Object { "Type": "Pass", }, "number__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "number", "ResultPath": "$.heap4", "Type": "Pass", }, - "object__if(input.id == undefined)": Object { + "object__if(input.id === undefined)": Object { "Next": "input.id", "Result": "object", "ResultPath": "$.heap0", @@ -8864,7 +8864,7 @@ Object { "Type": "Pass", }, "object__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "object", "ResultPath": "$.heap4", "Type": "Pass", @@ -8911,7 +8911,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "string__if(input.id == undefined)": Object { + "string__if(input.id === undefined)": Object { "Next": "input.id", "Result": "string", "ResultPath": "$.heap0", @@ -8936,12 +8936,12 @@ Object { "Type": "Pass", }, "string__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "string", "ResultPath": "$.heap4", "Type": "Pass", }, - "undefined__if(input.id == undefined)": Object { + "undefined__if(input.id === undefined)": Object { "Next": "input.id", "Result": "undefined", "ResultPath": "$.heap0", @@ -8966,7 +8966,7 @@ Object { "Type": "Pass", }, "undefined__input.id 3": Object { - "Next": "5__if(input.id == undefined)", + "Next": "5__if(input.id === undefined)", "Result": "undefined", "ResultPath": "$.heap4", "Type": "Pass", @@ -9021,7 +9021,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.val == \\"a\\")", + "Next": "if(input.val === \\"a\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -9031,7 +9031,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.val == \\"a\\")": Object { + "if(input.val === \\"a\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -9079,7 +9079,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.val != \\"a\\")", + "Next": "if(input.val !== \\"a\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -9089,10 +9089,10 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.val != \\"a\\")": Object { + "if(input.val !== \\"a\\")": Object { "Choices": Array [ Object { - "Next": "if(input.val == \\"b\\")", + "Next": "if(input.val === \\"b\\")", "Not": Object { "And": Array [ Object { @@ -9118,7 +9118,7 @@ Object { "Default": "return \\"woop\\"", "Type": "Choice", }, - "if(input.val == \\"b\\")": Object { + "if(input.val === \\"b\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -9282,7 +9282,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.id == \\"hello\\")", + "Next": "if(input.id === \\"hello\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -9292,7 +9292,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.id == \\"hello\\")": Object { + "if(input.id === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -9340,7 +9340,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "if(input.id == \\"hello\\")", + "Next": "if(input.id === \\"hello\\")", "Parameters": Object { "fnl_context": Object { "null": null, @@ -9350,7 +9350,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(input.id == \\"hello\\")": Object { + "if(input.id === \\"hello\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -9395,24 +9395,24 @@ Object { "Next": "return \\"world\\"", }, ], - "Default": "return null", + "Default": "return", "Type": "Choice", }, - "return \\"hello\\"": Object { + "return": Object { "End": true, - "Result": "hello", + "InputPath": "$.fnl_context.null", "ResultPath": "$", "Type": "Pass", }, - "return \\"world\\"": Object { + "return \\"hello\\"": Object { "End": true, - "Result": "world", + "Result": "hello", "ResultPath": "$", "Type": "Pass", }, - "return null": Object { + "return \\"world\\"": Object { "End": true, - "InputPath": "$.fnl_context.null", + "Result": "world", "ResultPath": "$", "Type": "Pass", }, @@ -10245,11 +10245,11 @@ Object { }, "i": Object { "InputPath": "$.heap0.arr[0].index", - "Next": "if(i == 0)", + "Next": "if(i === 0)", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == 0)": Object { + "if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -10380,11 +10380,11 @@ Object { }, "i": Object { "InputPath": "$.heap0.arr[0].index", - "Next": "if(i == 0)", + "Next": "if(i === 0)", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == 0)": Object { + "if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -10462,7 +10462,7 @@ exports[`list.forEach(item => ) 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__a = \`aitem\`": Object { + "1__a = \${a}\${item}": Object { "InputPath": "$.heap1.string", "Next": "return null 1", "ResultPath": "$.a", @@ -10485,8 +10485,8 @@ Object { "ResultPath": "$.a", "Type": "Pass", }, - "a = \`aitem\`": Object { - "Next": "1__a = \`aitem\`", + "a = \${a}\${item}": Object { + "Next": "1__a = \${a}\${item}", "Parameters": Object { "string.$": "States.Format('{}{}',$.a,$.item)", }, @@ -10520,7 +10520,7 @@ Object { }, "item": Object { "InputPath": "$.heap0.arr[0]", - "Next": "a = \`aitem\`", + "Next": "a = \${a}\${item}", "ResultPath": "$.item", "Type": "Pass", }, @@ -10684,11 +10684,11 @@ Object { }, "i": Object { "InputPath": "$.heap0.arr[0].index", - "Next": "if(i == 0)", + "Next": "if(i === 0)", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == 0)": Object { + "if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -10831,11 +10831,11 @@ Object { }, "i": Object { "InputPath": "$.heap0.arr[0].index", - "Next": "if(i == 0)", + "Next": "if(i === 0)", "ResultPath": "$.i", "Type": "Pass", }, - "if(i == 0)": Object { + "if(i === 0)": Object { "Choices": Array [ Object { "And": Array [ @@ -11885,7 +11885,7 @@ Object { "States": Object { "1__person = await $AWS.DynamoDB.GetItem({Table: personTable, Key: {id: {S: ": Object { "InputPath": "$.heap0", - "Next": "if(person.Item == undefined)", + "Next": "if(person.Item === undefined)", "ResultPath": "$.person", "Type": "Pass", }, @@ -11900,7 +11900,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(person.Item == undefined)": Object { + "if(person.Item === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -11913,7 +11913,7 @@ Object { "Variable": "$$.Execution.Id", }, ], - "Next": "return null", + "Next": "return", }, ], "Default": "return {id: person.Item.id.S, name: person.Item.name.S}", @@ -11933,7 +11933,7 @@ Object { "ResultPath": "$.heap0", "Type": "Task", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -11958,7 +11958,7 @@ Object { "States": Object { "1__person = await $AWS.DynamoDB.GetItem({Table: personTable, Key: {id: {S: ": Object { "InputPath": "$.heap1", - "Next": "if(person.Item == undefined)", + "Next": "if(person.Item === undefined)", "ResultPath": "$.person", "Type": "Pass", }, @@ -11987,7 +11987,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "if(person.Item == undefined)": Object { + "if(person.Item === undefined)": Object { "Choices": Array [ Object { "And": Array [ @@ -12000,7 +12000,7 @@ Object { "Variable": "$$.Execution.Id", }, ], - "Next": "return null", + "Next": "return", }, ], "Default": "return {id: person.Item.id.S, name: person.Item.name.S}", @@ -12025,7 +12025,7 @@ Object { "Default": "takeRight__person = await $AWS.DynamoDB.GetItem({Table: personTable, Key: {", "Type": "Choice", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -12863,7 +12863,7 @@ Object { "StartAt": "Initialize Functionless Context", "States": Object { "Initialize Functionless Context": Object { - "Next": "return null", + "Next": "return", "Parameters": Object { "fnl_context": Object { "null": null, @@ -12872,7 +12872,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return null": Object { + "return": Object { "End": true, "InputPath": "$.fnl_context.null", "ResultPath": "$", @@ -13372,14 +13372,14 @@ exports[`template literal strings 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return task({key: \`input.obj.str hello input.obj.items[0]\`})": Object { + "1__return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}})": Object { "End": true, "InputPath": "$.heap1", "ResultPath": "$", "Type": "Pass", }, - "1__return task({key: \`input.obj.str hello input.obj.items[0]\`}) 1": Object { - "Next": "1__return task({key: \`input.obj.str hello input.obj.items[0]\`})", + "1__return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}}) 1": Object { + "Next": "1__return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}})", "Parameters": Object { "key.$": "$.heap0.string", }, @@ -13388,7 +13388,7 @@ Object { "Type": "Task", }, "Initialize Functionless Context": Object { - "Next": "return task({key: \`input.obj.str hello input.obj.items[0]\`})", + "Next": "return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}})", "Parameters": Object { "fnl_context": Object { "null": null, @@ -13398,8 +13398,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return task({key: \`input.obj.str hello input.obj.items[0]\`})": Object { - "Next": "1__return task({key: \`input.obj.str hello input.obj.items[0]\`}) 1", + "return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}})": Object { + "Next": "1__return task({key: \${input.obj.str} \${\\"hello\\"} \${input.obj.items[0]}}) 1", "Parameters": Object { "string.$": "States.Format('{} hello {}',$.input.obj.str,$.input.obj.items[0])", }, @@ -13414,14 +13414,22 @@ exports[`template literal strings complex 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.item": Object { + "\${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input.obj.items[0] ?? awai": Object { + "Next": "1__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input 1", + "Parameters": Object { + "string.$": "States.Format('{} hello hello {}',$.heap0,$.heap2)", + }, + "ResultPath": "$.heap3", + "Type": "Pass", + }, + "1__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input": Object { "End": true, "InputPath": "$.heap4", "ResultPath": "$", "Type": "Pass", }, - "1__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.item 1": Object { - "Next": "1__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.item", + "1__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input 1": Object { + "Next": "1__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input", "Parameters": Object { "key.$": "$.heap3.string", }, @@ -13430,7 +13438,7 @@ Object { "Type": "Task", }, "Initialize Functionless Context": Object { - "Next": "return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.items[0", + "Next": "return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input.ob", "Parameters": Object { "fnl_context": Object { "null": null, @@ -13440,14 +13448,6 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "\`input.obj.str ?? \\"default\\" hello hello input.obj.items[0] ?? await task()\`": Object { - "Next": "1__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.item 1", - "Parameters": Object { - "string.$": "States.Format('{} hello hello {}',$.heap0,$.heap2)", - }, - "ResultPath": "$.heap3", - "Type": "Pass", - }, "input.obj.items[0] ?? await task()": Object { "InputPath": "$.fnl_context.null", "Next": "input.obj.items[0] ?? await task() 1", @@ -13474,7 +13474,7 @@ Object { "Default": "takeRight__input.obj.items[0] ?? await task() 1", "Type": "Choice", }, - "return task({key: \`input.obj.str ?? \\"default\\" hello hello input.obj.items[0": Object { + "return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input.ob": Object { "Choices": Array [ Object { "And": Array [ @@ -13487,19 +13487,19 @@ Object { "Variable": "$.input.obj.str", }, ], - "Next": "takeLeft__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.o", + "Next": "takeLeft__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} ", }, ], - "Default": "takeRight__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.", + "Default": "takeRight__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"}", "Type": "Choice", }, "takeLeft__input.obj.items[0] ?? await task() 1": Object { "InputPath": "$.input.obj.items[0]", - "Next": "\`input.obj.str ?? \\"default\\" hello hello input.obj.items[0] ?? await task()\`", + "Next": "\${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input.obj.items[0] ?? awai", "ResultPath": "$.heap2", "Type": "Pass", }, - "takeLeft__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.o": Object { + "takeLeft__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} ": Object { "InputPath": "$.input.obj.str", "Next": "input.obj.items[0] ?? await task()", "ResultPath": "$.heap0", @@ -13507,11 +13507,11 @@ Object { }, "takeRight__input.obj.items[0] ?? await task() 1": Object { "InputPath": "$.heap1", - "Next": "\`input.obj.str ?? \\"default\\" hello hello input.obj.items[0] ?? await task()\`", + "Next": "\${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"} \${input.obj.items[0] ?? awai", "ResultPath": "$.heap2", "Type": "Pass", }, - "takeRight__return task({key: \`input.obj.str ?? \\"default\\" hello hello input.": Object { + "takeRight__return task({key: \${input.obj.str ?? \\"default\\"} hello \${\\"hello\\"}": Object { "Next": "input.obj.items[0] ?? await task()", "Result": "default", "ResultPath": "$.heap0", @@ -13854,7 +13854,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"you dun' goofed\\")", + "Next": "if(err.message === \\"you dun' goofed\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -13890,7 +13890,7 @@ Object { "Default": "finally", "Type": "Choice", }, - "if(err.message == \\"you dun' goofed\\")": Object { + "if(err.message === \\"you dun' goofed\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -14219,7 +14219,7 @@ Object { }, "catch__try": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -14240,7 +14240,7 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -14599,7 +14599,7 @@ Object { }, "catch__try": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -14622,7 +14622,7 @@ Object { "ResultPath": "$.heap0", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -15136,7 +15136,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"sam\\")", + "Next": "if(err.message === \\"sam\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -15155,7 +15155,7 @@ Object { "ResultPath": "$.heap1", "Type": "Task", }, - "if(err.message == \\"sam\\")": Object { + "if(err.message === \\"sam\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -15491,11 +15491,11 @@ Object { }, "catch__try": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -15706,7 +15706,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -15718,7 +15718,7 @@ Object { "ResultPath": "$.fnl_tmp_0", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -15823,7 +15823,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -15835,7 +15835,7 @@ Object { "ResultPath": "$.fnl_tmp_0", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -15972,7 +15972,7 @@ Object { }, "catch(err)": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, @@ -15984,7 +15984,7 @@ Object { "ResultPath": "$.fnl_tmp_0", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -16077,11 +16077,11 @@ Object { }, "catch__try": Object { "InputPath": "$.fnl_tmp_0", - "Next": "if(err.message == \\"cause\\")", + "Next": "if(err.message === \\"cause\\")", "ResultPath": "$.err", "Type": "Pass", }, - "if(err.message == \\"cause\\")": Object { + "if(err.message === \\"cause\\")": Object { "Choices": Array [ Object { "And": Array [ @@ -16526,14 +16526,14 @@ exports[`use context parameter in template 1`] = ` Object { "StartAt": "Initialize Functionless Context", "States": Object { - "1__return \`name: context.Execution.Id\`": Object { + "1__return name: \${context.Execution.Id}": Object { "End": true, "InputPath": "$.heap0.string", "ResultPath": "$", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "return \`name: context.Execution.Id\`", + "Next": "return name: \${context.Execution.Id}", "Parameters": Object { "_.$": "$", "fnl_context": Object { @@ -16543,8 +16543,8 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "return \`name: context.Execution.Id\`": Object { - "Next": "1__return \`name: context.Execution.Id\`", + "return name: \${context.Execution.Id}": Object { + "Next": "1__return name: \${context.Execution.Id}", "Parameters": Object { "string.$": "States.Format('name: {}',$$.Execution.Id)", }, @@ -16679,12 +16679,12 @@ Object { "States": Object { "1__cond = await task()": Object { "InputPath": "$.heap0", - "Next": "while (cond == null)", + "Next": "while (cond === null)", "ResultPath": "$.cond", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "while (cond == null)", + "Next": "while (cond === null)", "Parameters": Object { "fnl_context": Object { "null": null, @@ -16706,7 +16706,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "while (cond == null)": Object { + "while (cond === null)": Object { "Choices": Array [ Object { "And": Array [ @@ -16783,12 +16783,12 @@ Object { "States": Object { "1__cond = await task()": Object { "InputPath": "$.heap0", - "Next": "while (cond == null)", + "Next": "while (cond === null)", "ResultPath": "$.cond", "Type": "Pass", }, "Initialize Functionless Context": Object { - "Next": "while (cond == null)", + "Next": "while (cond === null)", "Parameters": Object { "fnl_context": Object { "null": null, @@ -16810,7 +16810,7 @@ Object { "ResultPath": "$", "Type": "Pass", }, - "while (cond == null)": Object { + "while (cond === null)": Object { "Choices": Array [ Object { "And": Array [ diff --git a/test/__snapshots__/vtl.test.ts.snap b/test/__snapshots__/vtl.test.ts.snap index 11104a02..21804fdd 100644 --- a/test/__snapshots__/vtl.test.ts.snap +++ b/test/__snapshots__/vtl.test.ts.snap @@ -392,21 +392,25 @@ Array [ #set($context.stash.b = $context.arguments.b) #set($v1 = {}) #set($v2 = $context.stash.a != $context.stash.b) -$util.qr($v1.put('!=', $v2)) -#set($v3 = $context.stash.a && $context.stash.b) -$util.qr($v1.put('&&', $v3)) -#set($v4 = $context.stash.a || $context.stash.b) -$util.qr($v1.put('||', $v4)) -#set($v5 = $context.stash.a < $context.stash.b) -$util.qr($v1.put('<', $v5)) -#set($v6 = $context.stash.a <= $context.stash.b) -$util.qr($v1.put('<=', $v6)) -#set($v7 = $context.stash.a == $context.stash.b) -$util.qr($v1.put('==', $v7)) -#set($v8 = $context.stash.a > $context.stash.b) -$util.qr($v1.put('>', $v8)) -#set($v9 = $context.stash.a >= $context.stash.b) -$util.qr($v1.put('>=', $v9)) +$util.qr($v1.put('!==', $v2)) +#set($v3 = $context.stash.a != $context.stash.b) +$util.qr($v1.put('!=', $v3)) +#set($v4 = $context.stash.a && $context.stash.b) +$util.qr($v1.put('&&', $v4)) +#set($v5 = $context.stash.a || $context.stash.b) +$util.qr($v1.put('||', $v5)) +#set($v6 = $context.stash.a < $context.stash.b) +$util.qr($v1.put('<', $v6)) +#set($v7 = $context.stash.a <= $context.stash.b) +$util.qr($v1.put('<=', $v7)) +#set($v8 = $context.stash.a == $context.stash.b) +$util.qr($v1.put('===', $v8)) +#set($v9 = $context.stash.a == $context.stash.b) +$util.qr($v1.put('==', $v9)) +#set($v10 = $context.stash.a > $context.stash.b) +$util.qr($v1.put('>', $v10)) +#set($v11 = $context.stash.a >= $context.stash.b) +$util.qr($v1.put('>=', $v11)) #return($v1)", ] `; @@ -414,10 +418,12 @@ $util.qr($v1.put('>=', $v9)) exports[`binary exprs value comparison 2`] = ` Object { "!=": true, + "!==": true, "&&": 2, "<": true, "<=": true, "==": false, + "===": false, ">": false, ">=": false, "||": 1, @@ -427,10 +433,12 @@ Object { exports[`binary exprs value comparison 3`] = ` Object { "!=": true, + "!==": true, "&&": 1, "<": false, "<=": false, "==": false, + "===": false, ">": true, ">=": true, "||": 2, @@ -440,10 +448,12 @@ Object { exports[`binary exprs value comparison 4`] = ` Object { "!=": false, + "!==": false, "&&": 1, "<": false, "<=": true, "==": true, + "===": true, ">": false, ">=": true, "||": 1, diff --git a/test/appsync.test.ts b/test/appsync.test.ts index a7a5ac50..3cb90cb9 100644 --- a/test/appsync.test.ts +++ b/test/appsync.test.ts @@ -430,3 +430,34 @@ test("return error", () => { "Appsync Integration invocations must be unidirectional and defined statically" ); }); + +test("throw SynthError when for-await is used", () => { + expect(() => { + appsyncTestCase<{ strings: string[] }, { pk: string; sk: string }>( + // source https://github.com/functionless/functionless/issues/266 + reflect(async ($context) => { + for await (const _ of $context.arguments.strings) { + } + + return $util.error("Cannot find account."); + }) + ); + }).toThrow( + "VTL does not support for-await, see https://github.com/functionless/functionless/issues/390" + ); +}); + +test("throw SynthError when rest parameter is used", () => { + expect(() => { + appsyncTestCase<{ strings: string[] }, { pk: string; sk: string }>( + // source https://github.com/functionless/functionless/issues/266 + reflect(async ($context) => { + $context.arguments.strings.forEach((...rest) => { + return rest; + }); + + return $util.error("Cannot find account."); + }) + ); + }).toThrow(); +}); diff --git a/test/eventpattern.test.ts b/test/eventpattern.test.ts index 9acfd1d3..b99b6ed5 100644 --- a/test/eventpattern.test.ts +++ b/test/eventpattern.test.ts @@ -1659,3 +1659,12 @@ describe.skip("list some", () => { ); }); }); + +test("error when using rest parameters", () => { + ebEventPatternTestCaseError( + reflect>((...event) => + event[0].resources.some((r) => r.startsWith("hi") && r === "taco") + ), + "Event Bridge does not yet support rest parameters" + ); +}); diff --git a/test/reflect.test.ts b/test/reflect.test.ts index 35b3adca..f77e0d82 100644 --- a/test/reflect.test.ts +++ b/test/reflect.test.ts @@ -26,7 +26,7 @@ test("returns a string", () => { NodeKind.ArrowFunctionExpr ); expect( - assertNodeKind(fn.body.statements[0], NodeKind.ReturnStmt).expr.kindName + assertNodeKind(fn.body.statements[0], NodeKind.ReturnStmt).expr?.kindName ).toEqual("StringLiteralExpr"); }); diff --git a/test/step-function.test.ts b/test/step-function.test.ts index 226e5663..1e922c9b 100644 --- a/test/step-function.test.ts +++ b/test/step-function.test.ts @@ -3973,3 +3973,26 @@ describe("binding", () => { expect(normalizeDefinition(definition)).toMatchSnapshot(); }); }); + +test("throw SynthError when for-await is used", () => { + const { stack } = initStepFunctionApp(); + + expect(() => { + new StepFunction(stack, "MyStepF", async () => { + for await (const _ of []) { + } + }); + }).toThrow("Step Functions does not yet support for-await"); +}); + +test("throw SynthError when rest parameter is used", () => { + const { stack } = initStepFunctionApp(); + + expect(() => { + new StepFunction(stack, "MyStepF", async (input: { prop: string[] }) => { + return input.prop.map((...rest) => { + return rest; + }); + }); + }).toThrow("Step Functions does not yet support rest parameters"); +}); diff --git a/test/vtl.test.ts b/test/vtl.test.ts index 74cf09f9..13f6baad 100644 --- a/test/vtl.test.ts +++ b/test/vtl.test.ts @@ -2,10 +2,11 @@ import "jest"; import { $util, AppsyncContext, - ComparatorOp, - MathBinaryOp, + ArithmeticOp, + BinaryLogicalOp, + EqualityOp, + RelationalOp, ResolverFunction, - ValueComparisonBinaryOp, } from "../src"; import { reflect } from "../src/reflect"; import { appsyncTestCase, testAppsyncVelocity } from "./util"; @@ -549,18 +550,25 @@ test("binary exprs value comparison", () => { reflect< ResolverFunction< { a: number; b: number }, - Record, + Record< + | EqualityOp + | Exclude + | Exclude, + boolean | number + >, any > >(($context) => { const a = $context.arguments.a; const b = $context.arguments.b; return { + "!==": a != b, "!=": a != b, "&&": a && b, "||": a || b, "<": a < b, "<=": a <= b, + "===": a == b, "==": a == b, ">": a > b, ">=": a >= b, @@ -571,9 +579,11 @@ test("binary exprs value comparison", () => { testAppsyncVelocity(templates[1], { arguments: { a: 1, b: 2 }, resultMatch: { + "!==": true, "!=": true, "<": true, "<=": true, + "===": false, "==": false, ">": false, ">=": false, @@ -583,9 +593,11 @@ test("binary exprs value comparison", () => { testAppsyncVelocity(templates[1], { arguments: { a: 2, b: 1 }, resultMatch: { + "!==": true, "!=": true, "<": false, "<=": false, + "===": false, "==": false, ">": true, ">=": true, @@ -595,9 +607,11 @@ test("binary exprs value comparison", () => { testAppsyncVelocity(templates[1], { arguments: { a: 1, b: 1 }, resultMatch: { + "!==": false, "!=": false, "<": false, "<=": true, + "===": true, "==": true, ">": false, ">=": true, @@ -633,7 +647,7 @@ test("binary exprs logical", () => { reflect< ResolverFunction< { a: boolean; b: boolean }, - Record, + Record, any > >(($context) => { @@ -680,7 +694,7 @@ test("binary exprs math", () => { reflect< ResolverFunction< { a: number; b: number }, - Record, + Record, number>, any > >(($context) => {