MCPcopy Create free account
hub / github.com/nodejs/node / isFreeIdentifier

Function isFreeIdentifier

test/fixtures/snapshot/typescript.js:152522–152534  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

152520 node.forEachChild(function (child) { return forEachFreeIdentifier(child, cb); });
152521 }
152522 function isFreeIdentifier(node) {
152523 var parent = node.parent;
152524 switch (parent.kind) {
152525 case 206 /* SyntaxKind.PropertyAccessExpression */:
152526 return parent.name !== node;
152527 case 203 /* SyntaxKind.BindingElement */:
152528 return parent.propertyName !== node;
152529 case 270 /* SyntaxKind.ImportSpecifier */:
152530 return parent.propertyName !== node;
152531 default:
152532 return true;
152533 }
152534 }
152535 // Node helpers
152536 function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) {
152537 return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal.

Callers 1

forEachFreeIdentifierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected