MCPcopy Create free account
hub / github.com/TruthHun/BookStack / runTimeout

Function runTimeout

static/word2md/mammoth.browser.js:23901–23925  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

23899 }
23900} ())
23901function runTimeout(fun) {
23902 if (cachedSetTimeout === setTimeout) {
23903 //normal enviroments in sane situations
23904 return setTimeout(fun, 0);
23905 }
23906 // if setTimeout wasn't available but was latter defined
23907 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
23908 cachedSetTimeout = setTimeout;
23909 return setTimeout(fun, 0);
23910 }
23911 try {
23912 // when when somebody has screwed with setTimeout but no I.E. maddness
23913 return cachedSetTimeout(fun, 0);
23914 } catch(e){
23915 try {
23916 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
23917 return cachedSetTimeout.call(null, fun, 0);
23918 } catch(e){
23919 // 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
23920 return cachedSetTimeout.call(this, fun, 0);
23921 }
23922 }
23923
23924
23925}
23926function runClearTimeout(marker) {
23927 if (cachedClearTimeout === clearTimeout) {
23928 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
mammoth.browser.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected