Created
August 1, 2014 02:59
-
-
Save leafo/99d0817d28771f8ffe4e to your computer and use it in GitHub Desktop.
This file contains 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
class Test | |
__field_missing: (name) => | |
print "method is missing:", name | |
old = @__base.__index | |
@__base.__index = (name) => | |
old[name] or @__field_missing name | |
x = Test! | |
x.hello -- will trigger the __field_missing method in the class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment