Standardize global `setTimeout`/etc.?
These are standard already: www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers
It's rather a matter of "what in the W3C global scope should be available on ECMAScript specifications too" ?
'cause timers are not the only thing that comes handy. Native URLSearchParams and URL are also very handy, so could be fetch VS current http get.
encodeURIComponent is there too ... why is that?
Etcetera
On Sun, Feb 26, 2017 at 1:20 PM, Andrea Giammarchi < andrea.giammarchi at gmail.com> wrote:
These are standard already: www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers
That's only for browsers. As far as I know, there's no standard for the
broader picture Isiah was talking about. For instance, NodeJS's
setTimeout
and setInterval
do not conform to that specification (their
handles aren't numbers, for one thing).
-- T.J.
What I meant, is that I don't think it'd be wise to duplicate DOM standards on the ES side or, even worse, create specification incompatibilities.
Timers are just the top of the iceberg, IMO
Okay. Never mind, then.
Most runtimes (not necessarily engines) in my experience provide either a synchronous
sleep
or the abovesetTimeout
/etc. globals. In addition, many popular testing frameworks (e.g. Mocha, Jasmine) require them for important functionality. So here's my thought: it might be a good idea to standardize these methods in the language proper instead of just within the browser.Isiah Meadows me at isiahmeadows.com