MCPcopy Index your code
hub / github.com/BrainJS/brain.js / runTimeout

Function runTimeout

browser.js:23290–23314  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

23288 }
23289} ())
23290function runTimeout(fun) {
23291 if (cachedSetTimeout === setTimeout) {
23292 //normal enviroments in sane situations
23293 return setTimeout(fun, 0);
23294 }
23295 // if setTimeout wasn't available but was latter defined
23296 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
23297 cachedSetTimeout = setTimeout;
23298 return setTimeout(fun, 0);
23299 }
23300 try {
23301 // when when somebody has screwed with setTimeout but no I.E. maddness
23302 return cachedSetTimeout(fun, 0);
23303 } catch(e){
23304 try {
23305 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
23306 return cachedSetTimeout.call(null, fun, 0);
23307 } catch(e){
23308 // 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
23309 return cachedSetTimeout.call(this, fun, 0);
23310 }
23311 }
23312
23313
23314}
23315function runClearTimeout(marker) {
23316 if (cachedClearTimeout === clearTimeout) {
23317 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.70
browser.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected