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

Function runTimeout

code/dependency-injection/public/app.js:889–913  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

887 }
888} ())
889function runTimeout(fun) {
890 if (cachedSetTimeout === setTimeout) {
891 //normal enviroments in sane situations
892 return setTimeout(fun, 0);
893 }
894 // if setTimeout wasn't available but was latter defined
895 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
896 cachedSetTimeout = setTimeout;
897 return setTimeout(fun, 0);
898 }
899 try {
900 // when when somebody has screwed with setTimeout but no I.E. maddness
901 return cachedSetTimeout(fun, 0);
902 } catch(e){
903 try {
904 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
905 return cachedSetTimeout.call(null, fun, 0);
906 } catch(e){
907 // 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
908 return cachedSetTimeout.call(this, fun, 0);
909 }
910 }
911
912
913}
914function runClearTimeout(marker) {
915 if (cachedClearTimeout === clearTimeout) {
916 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected