Created
February 17, 2015 23:05
-
-
Save greenboxal/96d19f049ccaef1a4a54 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
defmod = function TraceBefore() { | |
def = function hello() { | |
console.log('before'); | |
$super(); | |
}; | |
}; | |
defmod = function TraceAfter() { | |
def = function hello() { | |
$super(); | |
console.log('after'); | |
}; | |
}; | |
defclass = function Foo() { | |
def = function hello() { | |
console.log('hello from Foo'); | |
}; | |
defget = function test() { | |
return 5; | |
}; | |
}; | |
// class Bar < Foo | |
// include TraceBefore | |
// prepend TraceAfter | |
defclass = [Foo, function Bar() { | |
this.include(TraceBefore); | |
this.prepend(TraceAfter); | |
def = function hello() { | |
console.log('hello from Bar'); | |
$super(); | |
}; | |
defget = function test() { | |
return $super() + 5; | |
}; | |
}]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment