Created
November 4, 2012 21:49
-
-
Save phpnode/4013933 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 AutoWhat | |
constructor: -> | |
console.log "constructing" | |
foo: => console.log this | |
window["whatever"] = -> | |
AutoWhat::constructor.apply this, arguments | |
for attr, val of AutoWhat:: | |
window["whatever"]::[attr] = val | |
b = new whatever | |
console.log b | |
b.foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment