Created
January 14, 2014 11:36
-
-
Save mainameiz/8416949 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 View | |
lol: -> | |
console.log "view lol" | |
console.log @ | |
class Foo | |
@delegate: (method, obj) -> | |
console.log "delegating #{method} to #{obj}" | |
console.log @:: | |
@::[method] = ((obj, method) -> | |
-> @[obj][method].apply(@, arguments) | |
)(obj, method) | |
console.log "2" | |
console.log @:: | |
fooLol: -> console.log "fooLol" | |
class Bar extends Foo | |
@delegate("lol", "view") | |
constructor: -> | |
@view = new View() | |
#console.log "3" | |
#console.log Bar.prototype | |
b = new Bar() | |
#console.log Bar.prototype | |
b.lol() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment