mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-30 01:08:11 +00:00
Instead of passing a function it is also possible to pass a string, which is then evaluated as a classic script. This means we now support the following example from the "timer initialization steps", step 16 - except that it runs the timers in reverse order, so the `log` result is `"TWO ONE "`. https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps var log = ''; function logger(s) { log += s + ' '; } setTimeout({ toString: function () { setTimeout("logger('ONE')", 100); return "logger('TWO')"; } }, 100);