Created
May 26, 2011 19:53
-
-
Save honza/993930 to your computer and use it in GitHub Desktop.
Object-hiding in CoffeeScript
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
| do -> | |
| class Animal | |
| constructor: -> | |
| alert 'Hello' | |
| class Nothing | |
| constructor: -> | |
| alert "Won't say anything" | |
| this.Animal = Animal | |
| # Will say 'hello' | |
| new Animal | |
| # Will complain because it's not defined | |
| new Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment