Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to overwrite interface methods

    Not sure whether this question has been asked before, but I couldn't find it. Given this situation:

    Code:
    isc.defineInterface('MyInterface').addInterfaceProperties({
      myMethod: function () {
        doSomething();
      }
    });
    
    isc.defineClass('MyClass', isc.VLayout, isc.MyInterface).addProperties({
      myMethod: function () {
        this.Super('myMethod', arguments);
    });
    When MyClass.myMethod() is invoked, it doesn't call doSomething(). That's why I changed MyClass to:

    Code:
    isc.defineClass('MyClass', isc.VLayout, isc.MyInterface).addProperties({
      myMethod: function () {
        isc.MyInterface.getPrototype().myMethod.apply(this, arguments)
    });
    Is this the way to do it, or should working with interfaces and overwriting a method in it, be done differently?
Working...
X