I've created a standard base class like this:
MyBase = function() {
this.m_Stuff = 0; // etc
};
MyBase.prototype.MySuperFunction = function (arg1) {
alert("Hello" + arg1);
};
Next, I defined another class that inherits MyBase:
MyChild = function () {
MyBase.call(this);
this.m_OtherStuff = 1; // etc
};
MyChild.prototype = new MyBase(); // inherit
However, I want to override MyBase's MySuperFunction with an improved version while still calling the original base class function:
MyChild.prototype.MySuperFunction = function (arg1, arg2) {
MyBase.MySuperFunction(arg1); // THIS IS THE PART I'M UNCERTAIN ABOUT
alert("You are a " + arg2 + "'th level idiot");
};
Is it possible for a child class to override its base class function but still call the base class function in the new definition?
If so, how can this be achieved?