MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / runTimeout

Function runTimeout

code/presentational-and-container/public/app.js:669–693  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

667 }
668} ())
669function runTimeout(fun) {
670 if (cachedSetTimeout === setTimeout) {
671 //normal enviroments in sane situations
672 return setTimeout(fun, 0);
673 }
674 // if setTimeout wasn't available but was latter defined
675 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
676 cachedSetTimeout = setTimeout;
677 return setTimeout(fun, 0);
678 }
679 try {
680 // when when somebody has screwed with setTimeout but no I.E. maddness
681 return cachedSetTimeout(fun, 0);
682 } catch(e){
683 try {
684 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
685 return cachedSetTimeout.call(null, fun, 0);
686 } catch(e){
687 // 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
688 return cachedSetTimeout.call(this, fun, 0);
689 }
690 }
691
692
693}
694function runClearTimeout(marker) {
695 if (cachedClearTimeout === clearTimeout) {
696 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected