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

Method mayWriteFromCalls

ark/aot/graph.ts:5987–6006  ·  view source on GitHub ↗
(
		fn: FunctionNode,
		calls: Node[],
		module: SourceModule,
		held: Held
	)

Source from the content-addressed store, hash-verified

5985 // what each call a function returns a value from may write of it, with
5986 // one the function makes of itself followed by the outer call's
5987 private mayWriteFromCalls(
5988 fn: FunctionNode,
5989 calls: Node[],
5990 module: SourceModule,
5991 held: Held
5992 ): Node | undefined {
5993 const key = `${held.depth}:${held.copied}`
5994 let returning = this.returning.get(fn)
5995 if (!returning) this.returning.set(fn, (returning = new Set()))
5996 if (returning.has(key)) return
5997 returning.add(key)
5998 try {
5999 for (const call of calls) {
6000 const write = this.mayWriteFrom(call, module, held)
6001 if (write) return write
6002 }
6003 } finally {
6004 returning.delete(key)
6005 }
6006 }
6007
6008 // the function a call runs, as far as the write analysis follows it: one
6009 // the build reads, a class instance's method and, where the build reads

Callers 1

mayWriteFromMethod · 0.95

Calls 6

mayWriteFromMethod · 0.95
getMethod · 0.65
setMethod · 0.45
hasMethod · 0.45
addMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected