MCPcopy Create free account
hub / github.com/babel/babel / Function

Function Function

packages/babel-plugin-transform-block-scoping/src/loop.ts:192–206  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

190 const declarations: NodePath<t.FunctionDeclaration>[] = [];
191 loopPath.get("body").traverse({
192 Function(path) {
193 if (
194 path.isFunctionDeclaration() &&
195 (path.parentPath.isBlockStatement() ||
196 path.parentPath.isSwitchCase()) &&
197 path.node.id &&
198 !path.node.generator &&
199 !path.node.async &&
200 !path.isInStrictMode() &&
201 !hasLexicalConflict(loopPath, path.node.id.name)
202 ) {
203 declarations.push(path);
204 }
205 path.skip();
206 },
207 });
208
209 if (declarations.length === 0) return;

Callers

nothing calls this directly

Calls 5

hasLexicalConflictFunction · 0.85
isFunctionDeclarationMethod · 0.80
isBlockStatementMethod · 0.80
isSwitchCaseMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected