-
-
Save jimevans/8308969 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.inject.recompileFunction_ = function(fn, theWindow) { | |
if (goog.isString(fn)) { | |
try { | |
return new theWindow['Function'](fn); | |
} catch (ex) { | |
// Try to recover if in IE-quirks. | |
// Need to initialize the script engine in the passed-in window. | |
if (goog.userAgent.IE && theWindow.execScript) { | |
theWindow.execScript(';'); | |
return new theWindow['Function'](fn); | |
} | |
throw ex; | |
} | |
} | |
return theWindow == window ? fn : new theWindow['Function']( | |
'return (' + fn + ').apply(null,arguments);'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment