function isInTailCallPosition(node) {
            if (node.parent.type === "ArrowFunctionExpression") {
                return true;
            }
            if (node.parent.type === "ReturnStatement") {
                return !hasErrorHandler(node.parent);
            }
            if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) {
                return isInTailCallPosition(node.parent);
            }
            if (node.parent.type === "LogicalExpression" && node === node.parent.right) {
                return isInTailCallPosition(node.parent);
            }
            if (node.parent.type === "SequenceExpression" && node === node.parent.expressions[node.parent.expressions.length - 1]) {
                return isInTailCallPosition(node.parent);
            }
            return false;
        }
function isInTailCallPosition(node) {
            if (node.parent.type === "ArrowFunctionExpression") {
                return true;
            }
            if (node.parent.type === "ReturnStatement") {
                return !hasErrorHandler(node.parent);
            }
            if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) {
                return isInTailCallPosition(node.parent);
            }
            if (node.parent.type === "LogicalExpression" && node === node.parent.right) {
                return isInTailCallPosition(node.parent);
            }
            if (node.parent.type === "SequenceExpression" && node === node.parent.expressions[node.parent.expressions.length - 1]) {
                return isInTailCallPosition(node.parent);
            }
            return false;
        }
function isInTailCallPosition ( node ) { if ( node . parent . type === "ArrowFunctionExpression" ) { return true ; } if ( node . parent . type === "ReturnStatement" ) { return ! hasErrorHandler ( node . parent ) ; } if ( node . parent . type === "ConditionalExpression" && ( node === node . parent . consequent || node === node . parent . alternate ) ) { return isInTailCallPosition ( node . parent ) ; } if ( node . parent . type === "LogicalExpression" && node === node . parent . right ) { return isInTailCallPosition ( node . parent ) ; } if ( node . parent . type === "SequenceExpression" && node === node . parent . expressions [ node . parent . expressions . length - 1 ] ) { return isInTailCallPosition ( node . parent ) ; } return false ; }
Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression,
an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position.
@param {ASTNode} node A node representing the `await` expression to check
@returns {boolean} The checking result
Checks if a node is placed in tail call position . Once return arguments ( or arrow function expressions ) can be a complex expression an await expression could or could not be unnecessary by the definition of this rule . So we re looking for await expressions that are in tail position .
Check if a node is in the tail of the call