Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Forked from subtleGradient/global1.js
Created March 8, 2011 16:08
Show Gist options
  • Save ibolmo/860453 to your computer and use it in GitHub Desktop.
Save ibolmo/860453 to your computer and use it in GitHub Desktop.
var Foo = 'bar';
this.Foo = 'bar';
var global = function(){return this || (1,eval)('this')}();
global.Foo = 'bar';
!function(){
var GLOBAL = function(){return this || (1,eval)('this')}()
Function.prototype.globalize = function(){
return this.apply(GLOBAL, arguments)
}
}()
!function(){
this.Foo = 'bar';
}.globalize()
function Export(fn){var G = this||(7,eval)('this'); fn.call(G,G)}
Export (function(exports){
exports.Foo = 'bar';
})
function Export(fn){fn.call(this||(7,eval)('this'))}
Export (function(){
this.Foo = 'bar';
})
if (typeof global == 'undefined') (function(){ var global = this || (1,eval)('this'); global.global = global; })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment