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

Function Function

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

Source from the content-addressed store, hash-verified

201 const declarations: NodePath<t.FunctionDeclaration>[] = [];
202 loopPath.get("body").traverse({
203 Function(path) {
204 if (
205 path.isFunctionDeclaration() &&
206 (path.parentPath.isBlockStatement() ||
207 path.parentPath.isSwitchCase()) &&
208 path.node.id &&
209 !path.node.generator &&
210 !path.node.async &&
211 !path.isInStrictMode() &&
212 !hasLexicalConflict(loopPath, path.node.id.name)
213 ) {
214 declarations.push(path);
215 }
216 path.skip();
217 },
218 });
219
220 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