Skip to content

Instantly share code, notes, and snippets.

@greenboxal
Created February 17, 2015 23:05
Show Gist options
  • Save greenboxal/96d19f049ccaef1a4a54 to your computer and use it in GitHub Desktop.
Save greenboxal/96d19f049ccaef1a4a54 to your computer and use it in GitHub Desktop.
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