Created
April 12, 2009 15:55
-
-
Save fearphage/94033 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 ok1, ok2, ok3, ok4, ok5, ok6; | |
| function A(){ | |
| ok1 = (this.constructor!=arguments.callee); | |
| }; | |
| function B(){ | |
| ok2 = (this.constructor==arguments.callee); | |
| }; | |
| A(); | |
| new B(); | |
| function Foo(){ | |
| if (this.constructor!=arguments.callee) | |
| return new arguments.callee({__is_arguments:arguments}); | |
| else if(arguments[0] && arguments[0].__is_arguments) | |
| return arguments.callee.apply(this,arguments[0].__is_arguments); | |
| this.init.apply(this, arguments); | |
| } | |
| Foo.prototype = { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment