MCPcopy
hub / github.com/microsoft/SandDance / runTimeout

Function runTimeout

docs/app/js/sanddance-app.js:52718–52738  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

52716 }
52717})();
52718function runTimeout(fun) {
52719 if (cachedSetTimeout === setTimeout) //normal enviroments in sane situations
52720 return setTimeout(fun, 0);
52721 // if setTimeout wasn't available but was latter defined
52722 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
52723 cachedSetTimeout = setTimeout;
52724 return setTimeout(fun, 0);
52725 }
52726 try {
52727 // when when somebody has screwed with setTimeout but no I.E. maddness
52728 return cachedSetTimeout(fun, 0);
52729 } catch (e) {
52730 try {
52731 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
52732 return cachedSetTimeout.call(null, fun, 0);
52733 } catch (e) {
52734 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
52735 return cachedSetTimeout.call(this, fun, 0);
52736 }
52737 }
52738}
52739function runClearTimeout(marker) {
52740 if (cachedClearTimeout === clearTimeout) //normal enviroments in sane situations
52741 return clearTimeout(marker);

Callers 2

drainQueueFunction · 0.70
sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected