Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

web.timers.js 1.1KB

12345678910111213141516171819202122232425262728
  1. var $ = require('../internals/export');
  2. var global = require('../internals/global');
  3. var userAgent = require('../internals/engine-user-agent');
  4. var slice = [].slice;
  5. var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
  6. var wrap = function (scheduler) {
  7. return function (handler, timeout /* , ...arguments */) {
  8. var boundArgs = arguments.length > 2;
  9. var args = boundArgs ? slice.call(arguments, 2) : undefined;
  10. return scheduler(boundArgs ? function () {
  11. // eslint-disable-next-line no-new-func -- spec requirement
  12. (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
  13. } : handler, timeout);
  14. };
  15. };
  16. // ie9- setTimeout & setInterval additional parameters fix
  17. // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
  18. $({ global: true, bind: true, forced: MSIE }, {
  19. // `setTimeout` method
  20. // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
  21. setTimeout: wrap(global.setTimeout),
  22. // `setInterval` method
  23. // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
  24. setInterval: wrap(global.setInterval)
  25. });