Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created September 21, 2008 16:38
Show Gist options
  • Select an option

  • Save subtleGradient/11880 to your computer and use it in GitHub Desktop.

Select an option

Save subtleGradient/11880 to your computer and use it in GitHub Desktop.
var Something = function(arg){
console.log(['something:', arg]);
};
var Weird = function(fn){
this.Something = function(arg){
console.log(['something weird:', arg]);
};
if(fn && typeof fn == 'function'){
return fn.call(this);
}
};
new Something('test outside');
new Weird(function(){with(this)
new Something('test inside');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment