MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / runTimeout

Function runTimeout

Il2cppHook/_Ufunc.js:13221–13245  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

13219 }
13220} ())
13221function runTimeout(fun) {
13222 if (cachedSetTimeout === setTimeout) {
13223 //normal enviroments in sane situations
13224 return setTimeout(fun, 0);
13225 }
13226 // if setTimeout wasn't available but was latter defined
13227 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
13228 cachedSetTimeout = setTimeout;
13229 return setTimeout(fun, 0);
13230 }
13231 try {
13232 // when when somebody has screwed with setTimeout but no I.E. maddness
13233 return cachedSetTimeout(fun, 0);
13234 } catch(e){
13235 try {
13236 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
13237 return cachedSetTimeout.call(null, fun, 0);
13238 } catch(e){
13239 // 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
13240 return cachedSetTimeout.call(this, fun, 0);
13241 }
13242 }
13243
13244
13245}
13246function runClearTimeout(marker) {
13247 if (cachedClearTimeout === clearTimeout) {
13248 //normal enviroments in sane situations

Callers 2

drainQueueFunction · 0.85
_Ufunc.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected