private SourceInfo(string source, DebuggableScript[] functions, string normilizedUrl)
{
this.source = source;
this.url = normilizedUrl;
int N = functions.Length;
int[][] lineArrays = new int[N][];
for (int i = 0; i != N; ++i)
{
lineArrays[i] = functions[i].GetLineNumbers();
}
int minAll = 0;
int maxAll = -1;
int[] firstLines = new int[N];
for (int i_1 = 0; i_1 != N; ++i_1)
{
int[] lines = lineArrays[i_1];
if (lines == null || lines.Length == 0)
{
firstLines[i_1] = -1;
}
else
{
int min;
int max;
min = max = lines[0];
for (int j = 1; j != lines.Length; ++j)
{
int line = lines[j];
if (line < min)
{
min = line;
}
else
{
if (line > max)
{
max = line;
}
}
}
firstLines[i_1] = min;
if (minAll > maxAll)
{
minAll = min;
maxAll = max;
}
else
{
if (min < minAll)
{
minAll = min;
}
if (max > maxAll)
{
maxAll = max;
}
}
}
}
if (minAll > maxAll)
{
// No line information
this.breakableLines = EMPTY_BOOLEAN_ARRAY;
this.breakpoints = EMPTY_BOOLEAN_ARRAY;
}
else
{
if (minAll < 0)
{
// Line numbers can not be negative
throw new InvalidOperationException(minAll.ToString());
}
int linesTop = maxAll + 1;
this.breakableLines = new bool[linesTop];
this.breakpoints = new bool[linesTop];
for (int i_2 = 0; i_2 != N; ++i_2)
{
int[] lines = lineArrays[i_2];
if (lines != null && lines.Length != 0)
{
for (int j = 0; j != lines.Length; ++j)
{
int line = lines[j];
this.breakableLines[line] = true;
}
}
}
}
this.functionSources = new Dim.FunctionSource[N];
for (int i_3 = 0; i_3 != N; ++i_3)
{
string name = functions[i_3].GetFunctionName();
if (name == null)
{
name = string.Empty;
}
this.functionSources[i_3] = new Dim.FunctionSource(this, firstLines[i_3], name);
}
}