MCPcopy Index your code
hub / github.com/MoonHighway/learning-react / runTimeout

Function runTimeout

chapter-12/server-render-recipes/assets/bundle.js:107–131  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

105 }
106} ())
107function runTimeout(fun) {
108 if (cachedSetTimeout === setTimeout) {
109 //normal enviroments in sane situations
110 return setTimeout(fun, 0);
111 }
112 // if setTimeout wasn't available but was latter defined
113 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
114 cachedSetTimeout = setTimeout;
115 return setTimeout(fun, 0);
116 }
117 try {
118 // when when somebody has screwed with setTimeout but no I.E. maddness
119 return cachedSetTimeout(fun, 0);
120 } catch(e){
121 try {
122 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
123 return cachedSetTimeout.call(null, fun, 0);
124 } catch(e){
125 // 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
126 return cachedSetTimeout.call(this, fun, 0);
127 }
128 }
129
130
131}
132function runClearTimeout(marker) {
133 if (cachedClearTimeout === clearTimeout) {
134 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.85
bundle.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected