Hello rovs,
The following test runs to completion without script termination or infinite recursion, and the output is exactly as expected:
Is there something you're doing differently?
Thanks!
The following test runs to completion without script termination or infinite recursion, and the output is exactly as expected:
publicclass Test { public ScriptEngine Engine { get; set; } publicvoid Method1(int index) { Console.WriteLine("{0} {1}", index, Engine.GetStackTrace()); } publicvoid Method2(int index) { Console.WriteLine("{0} {1}", index, Engine.Script.getStackTrace()); } }
engine.AddHostObject("test", new Test { Engine = engine }); engine.Execute(@" function getStackTrace() { return new Error().stack; } for (var i = 0; i < 1000; i++) { test.Method1(i); } for (var i = 0; i < 1000; i++) { test.Method2(i); } ");
Thanks!