I have set up a base class as standard:
MyBase = function() {
this.m_Stuff = 0; // etc
};
MyBase.prototype.MySuperFunction = function (arg1) {
alert("Hello" + arg1);
};
Next I set up another class that inherits MyBase
MyChild = function () {
MyBase.call(this);
this.m_OtherStuff = 1; // etc
};
MyChild.prototype = new MyBase(); // innherit
But then (and this is the bit I dont know how to do) I want to override MyBase's MySuperFunction with a better one, but calling the base class function in the process:
MyChild.prototype.MySuperFunction = function (arg1, arg2) {
MyBase.MySuperFunction(arg1); // THIS LINE IS THE LINE I DONT KNOW HOW TO DO
alert("You is a " + arg2 + "'th level idiot");
};
Its a child class that wants to override is base class function, but wants to call the base class function in the new improved definition.
Is this possible, and if so, how can it be done?