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

Function runTimeout

code/higher-order-components/public/app.js:790–814  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

788 }
789} ())
790function runTimeout(fun) {
791 if (cachedSetTimeout === setTimeout) {
792 //normal enviroments in sane situations
793 return setTimeout(fun, 0);
794 }
795 // if setTimeout wasn't available but was latter defined
796 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
797 cachedSetTimeout = setTimeout;
798 return setTimeout(fun, 0);
799 }
800 try {
801 // when when somebody has screwed with setTimeout but no I.E. maddness
802 return cachedSetTimeout(fun, 0);
803 } catch(e){
804 try {
805 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
806 return cachedSetTimeout.call(null, fun, 0);
807 } catch(e){
808 // 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
809 return cachedSetTimeout.call(this, fun, 0);
810 }
811 }
812
813
814}
815function runClearTimeout(marker) {
816 if (cachedClearTimeout === clearTimeout) {
817 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected