From 0230b8b159f95dcc2591c8aac854d5d4ce7d7b5f Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Sat, 4 Dec 2021 11:34:21 +0100 Subject: [PATCH] Fix typo in source code --- src/transforms/passUnwrappedFunctions.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/transforms/passUnwrappedFunctions.ts b/src/transforms/passUnwrappedFunctions.ts index 2825227..65ac682 100644 --- a/src/transforms/passUnwrappedFunctions.ts +++ b/src/transforms/passUnwrappedFunctions.ts @@ -90,13 +90,13 @@ export const createPassUnwrappedFunctionsTransformer = ( if (funcToModify && funcToModify !== 'bail_out') { let bailOut = false; const modifyFunction = ( - nodeInModfifyFunc: ts.Node + nodeInModifyFunc: ts.Node ): ts.VisitResult => { if ( - ts.isCallExpression(nodeInModfifyFunc) && - ts.isIdentifier(nodeInModfifyFunc.expression) + ts.isCallExpression(nodeInModifyFunc) && + ts.isIdentifier(nodeInModifyFunc.expression) ) { - const match = matchWrappedInvocation(nodeInModfifyFunc); + const match = matchWrappedInvocation(nodeInModifyFunc); if ( match && match.calleeName.text === funcToModify.parameterName && @@ -111,13 +111,13 @@ export const createPassUnwrappedFunctionsTransformer = ( ); } - const calledFuncIdentifier = nodeInModfifyFunc.expression; + const calledFuncIdentifier = nodeInModifyFunc.expression; // can be a curried version of callee name in the same body // example: A2(func, a,b) and func(c) if ( calledFuncIdentifier.text === funcToModify.parameterName && - nodeInModfifyFunc.arguments.length === 1 && + nodeInModifyFunc.arguments.length === 1 && funcToModify.arity !== 1 ) { // means that we have an invocation that is not uniform with expected arity @@ -130,7 +130,7 @@ export const createPassUnwrappedFunctionsTransformer = ( return ts.createCall( ts.createIdentifier(deriveNewFuncName(funcToModify.funcName)), undefined, - nodeInModfifyFunc.arguments.map((arg) => + nodeInModifyFunc.arguments.map((arg) => ts.visitNode(arg, modifyFunction) ) ); @@ -140,7 +140,7 @@ export const createPassUnwrappedFunctionsTransformer = ( // that is now unwrapped // thus check if we have an unwrapped version if ( - nodeInModfifyFunc.arguments.some( + nodeInModifyFunc.arguments.some( (arg) => ts.isIdentifier(arg) && arg.text === funcToModify.parameterName @@ -166,7 +166,7 @@ export const createPassUnwrappedFunctionsTransformer = ( deriveNewFuncName(calledFuncIdentifier.text) ), undefined, - nodeInModfifyFunc.arguments.map((arg) => + nodeInModifyFunc.arguments.map((arg) => ts.visitNode(arg, modifyFunction) ) ); @@ -174,7 +174,7 @@ export const createPassUnwrappedFunctionsTransformer = ( } return ts.visitEachChild( - nodeInModfifyFunc, + nodeInModifyFunc, modifyFunction, context );