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

Function runTimeout

code/event-handlers/public/app.js:766–790  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

764 }
765} ())
766function runTimeout(fun) {
767 if (cachedSetTimeout === setTimeout) {
768 //normal enviroments in sane situations
769 return setTimeout(fun, 0);
770 }
771 // if setTimeout wasn't available but was latter defined
772 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
773 cachedSetTimeout = setTimeout;
774 return setTimeout(fun, 0);
775 }
776 try {
777 // when when somebody has screwed with setTimeout but no I.E. maddness
778 return cachedSetTimeout(fun, 0);
779 } catch(e){
780 try {
781 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
782 return cachedSetTimeout.call(null, fun, 0);
783 } catch(e){
784 // 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
785 return cachedSetTimeout.call(this, fun, 0);
786 }
787 }
788
789
790}
791function runClearTimeout(marker) {
792 if (cachedClearTimeout === clearTimeout) {
793 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected