Skip to content

Commit

Permalink
chore: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 3, 2024
1 parent 18f4a6a commit 18cddef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rules/no-loop-func.js
Expand Up @@ -21,7 +21,7 @@ function isIIFE(node) {
/**
* Gets the containing loop node of a specified node.
*
* We don't need to check nested functions, so this ignores those.
* We don't need to check nested functions, so this ignores those, with the exception of IIFE.
* `Scope.through` contains references of nested functions.
* @param {ASTNode} node An AST node to get.
* @returns {ASTNode|null} The containing loop node of the specified node, or
Expand Down Expand Up @@ -56,9 +56,12 @@ function getContainingLoopNode(node) {
case "ArrowFunctionExpression":
case "FunctionExpression":
case "FunctionDeclaration":

// We need to check nested functions only in case of IIFE.
if (isIIFE(node)) {
break;
}

return null;
default:
break;
Expand Down

0 comments on commit 18cddef

Please sign in to comment.