Created
November 11, 2008 19:06
-
-
Save kangax/23934 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
// Only one closure is created here - i.e. when one of these functions is returned from within anonymous-outer one. | |
// That returned function will be part of the closure and have access to [[Scope]] of anonymous-outer one. | |
// The returned function is the only Function object that's being created. | |
// Function expressions from other blocks are never reached and so are never created | |
var globalEval = (function(){ | |
if (window.eval) { | |
return function(s){ window.eval(s) } | |
} | |
else if (window.execScript) { | |
return function(s){ window.execScript(s) } | |
} | |
return function(s){ | |
// use script insertion | |
} | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment