The following script crashes consistently when using 3 iterations in the outer for loop, but runs fine when using 2 iterations.
for (var i = 0; i < 3 /*2 is fine*/; ++i)
{
for (var test of list)
{
}
}
where list is a List<int>. Necessary initialization code is:
var engine = new V8ScriptEngine();
var list = new List<int>();
engine.AddHostObject("list", list);
engine.Execute(...);
Spreading out the enumerator accesses over multiple engine.Execute calls does not seem to cause the problem.
for (var i = 0; i < 3 /*2 is fine*/; ++i)
{
for (var test of list)
{
}
}
where list is a List<int>. Necessary initialization code is:
var engine = new V8ScriptEngine();
var list = new List<int>();
engine.AddHostObject("list", list);
engine.Execute(...);
Spreading out the enumerator accesses over multiple engine.Execute calls does not seem to cause the problem.