MCPcopy Create free account
hub / github.com/arktypeio/arktype / enclosingThisFunctionOf

Function enclosingThisFunctionOf

ark/aot/usage.ts:2152–2159  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

2150
2151// the function a this is read in, where it has one a class doesn't bind
2152const enclosingThisFunctionOf = (node: Node): Node | undefined => {
2153 for (let at: Node | null | undefined = node.parent; at; at = at.parent) {
2154 if (at.type === "FunctionExpression" || at.type === "FunctionDeclaration")
2155 return at
2156 // a bare `this` outside any function is the module's
2157 if (at.type === "PropertyDefinition" || at.type === "StaticBlock") return
2158 }
2159}
2160
2161const forwardingMethods = new Set(["apply", "call"])
2162

Callers 3

thisReadsOfFunction · 0.85
receivesNoEscapedThisFunction · 0.85
isContainedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected