We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version used
3.0.1
Describe the bug
Tasks cannot be executed sequentially
Code
var engine = new Engine(option => { option.DebugMode(false); option.TimeZone = TimeZoneInfo.Utc; }); engine.Execute("const global = this;"); engine.Execute("const exports = {};"); engine.SetValue("console", new ConsoleService()); engine.SetValue("InternalSetTimeout", async (int delay) => { await Task.Delay(delay); }); engine.Evaluate(@" function setTimeout(callback, interval){ InternalSetTimeout(interval).then(success=> { callback(); }).catch(error=>{ console.log(error) }) }"); Console.WriteLine($"Begin: {DateTime.UtcNow}"); var script = @" setTimeout(()=>console.log('5000', new Date()), 5000); setTimeout(()=>console.log('3000', new Date()), 3000); setTimeout(()=>console.log('1000', new Date()), 1000);"; engine.Evaluate(script).UnwrapIfPromise();
Expected behavior
Begin: 2024/3/26 3:08:27 1000 2024/3/26 3:08:28 3000 2024/3/26 3:08:30 5000 2024/3/26 3:08:32
Actual behavior
Begin: 2024/3/26 3:08:27 1000 2024/3/26 3:08:32 3000 2024/3/26 3:08:32 5000 2024/3/26 3:08:32
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version used
3.0.1
Describe the bug
Tasks cannot be executed sequentially
Code
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: