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

Function runTimeout

code/communication/public/app.js:831–855  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

829 }
830} ())
831function runTimeout(fun) {
832 if (cachedSetTimeout === setTimeout) {
833 //normal enviroments in sane situations
834 return setTimeout(fun, 0);
835 }
836 // if setTimeout wasn't available but was latter defined
837 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
838 cachedSetTimeout = setTimeout;
839 return setTimeout(fun, 0);
840 }
841 try {
842 // when when somebody has screwed with setTimeout but no I.E. maddness
843 return cachedSetTimeout(fun, 0);
844 } catch(e){
845 try {
846 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
847 return cachedSetTimeout.call(null, fun, 0);
848 } catch(e){
849 // 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
850 return cachedSetTimeout.call(this, fun, 0);
851 }
852 }
853
854
855}
856function runClearTimeout(marker) {
857 if (cachedClearTimeout === clearTimeout) {
858 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected