function checkLastSegment(node){var loc=void 0,name=void 0;/*
             * Skip if it expected no return value or unreachable.
             * When unreachable, all paths are returned or thrown.
             */if(!funcInfo.hasReturnValue||funcInfo.codePath.currentSegments.every(isUnreachable)||astUtils.isES5Constructor(node)||isClassConstructor(node)){return;}// Adjust a location and a message.
if(node.type==="Program"){// The head of program.
loc={line:1,column:0};name="program";}else if(node.type==="ArrowFunctionExpression"){// `=>` token
loc=context.getSourceCode().getTokenBefore(node.body,astUtils.isArrowToken).loc.start;}else if(node.parent.type==="MethodDefinition"||node.parent.type==="Property"&&node.parent.method){// Method name.
loc=node.parent.key.loc.start;}else{// Function name or `function` keyword.
loc=(node.id||node).loc.start;}if(!name){name=astUtils.getFunctionNameWithKind(node);}// Reports.
context.report({node:node,loc:loc,message:"Expected to return a value at the end of {{name}}.",data:{name:name}});}
Checks whether of not the implicit returning is consistent if the last
code path segment is reachable.

@param {ASTNode} node - A program/function node to check.
@returns {void}