What would be a correct way to check if a method is overriding a method from parent class? For example:
Ember.Object.createWithMixins({
foo: function() {
if (/*Object has foo defined, and our implementation is overriding it) this._super();
else /* Let's do something else here instead */
}
})
this._super is always going to be a function. Here’s the code:
this._super = superFunc || K;
So you’d have to compare against Em.K if you wanted to know whether the super function existed or not. Personally, I would use a closure and an instantiated instance of the parent class.