mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +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);
29 KiB
29 KiB