internal static FunctionInfo CreateFunctionInfo(
Delegate generatorFactory,
string name,
DebugSourceSpan[] locationSpanMap,
IList<VariableInfo>[] scopedVariables,
IList<VariableInfo> variables,
object customPayload) {
FunctionInfo funcInfo = new FunctionInfo(
generatorFactory,
name,
locationSpanMap,
scopedVariables,
variables,
customPayload);
foreach (DebugSourceSpan sourceSpan in (DebugSourceSpan[])locationSpanMap) {
lock (sourceSpan.SourceFile.FunctionInfoMap) {
sourceSpan.SourceFile.FunctionInfoMap[sourceSpan] = funcInfo;
}
}
return funcInfo;
}