Last active
December 11, 2015 01:29
-
-
Save hay/4523765 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var Module = Stapes.subclass({ | |
sayName : function() { | |
console.log('i say my name!'); | |
} | |
}); | |
var BetterModule = Module.subclass({ | |
// Note that this method name is the same as the one in Module | |
sayName : function() { | |
BetterModule.parent.sayName.apply(this, arguments); | |
console.log('i say my name better'); | |
} | |
}); | |
var module = new BetterModule(); | |
module.sayName(); // 'i say my name! i say my name better!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment