To do this, you need to capture the _super method during the subclass, for example:
dance: function(){ // capture the super method for later usage var superMethod = this._super; window.setTimeout(function(){ return superMethod(); },50); };
The reason this works and your code does not work is because the extend() method in inherit.js captures the superclass' method like this._super before running your overridden method. Then it runs your code, and after your code runs it, restores _super to what was installed before it was run. The action takes place in the next bit of code from inherit.js
var tmp = this._super;
To be more specific; when the source code was run, the function that was used as the parameter for setTimeout was bound to the source object. The reason it didn’t work was because although this referring to the right object, this._super referring to something else since this._super was reset to indicate what it was pointing to launch method. It probably wasn't installed, so the value of this._super was most likely undefined .
source share