Created
March 6, 2010 04:49
-
-
Save tim-smart/323500 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 Test = function Test() {}; | |
| var temp = function Test() {}; | |
| temp.prototype = Array.prototype; | |
| Test.prototype = new temp(); | |
| Test.prototype.constructor = Test; | |
| // Prints "Test" | |
| new Test().constructor.name; | |
| // We can then process the name to generate our url names | |
| // "Test" would be "test", "TestModel" would be "test_model", "Test_Model" would also be "test_model" | |
| // Over-riden by __name property or something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment