Created
September 21, 2008 16:38
-
-
Save subtleGradient/11880 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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