Method or Property is Undefined

When setting up class inheritance, you may have seen the error that the method or property is undefined.  This results from the fact that a property or method exists in the base class, or is not explicitly defined or overridden in the derived class.  This will result from not calling initializeBase in the constructor.  By adding this in and making the code look like the following:

 function TerminatedBankState() {

    TerminatedBankState.initializeBase(this);

}

TerminatedBankState.prototype = { .. }

TerminatedBankState.registerClass("TerminatedBankState", BaseBankState);

The instance of the terminated bank state object now has references to the properties and methods from the BaseBankState object.

Published Sunday, August 31, 2008 5:50 AM by bmains
Filed under:

Comments

No Comments