Closed scgm0 closed 7 months ago
Engine engine = new(); engine.SetValue("setTimeout", (Action action, int delay) => { Task.Delay(delay).ContinueWith(_ => action()); }); var result = engine.Evaluate(@" const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay)); async function main() { await waitFor(500); return 'hello'; } main;"); Console.WriteLine(result.Call());
I got the same problem.