Why is `goog.Disposable.call(this);` necessary?
- by David Faux
In this snippet of Google Closure javascript code involving a constructor, why is goog.Disposable.call(this); necessary? Doesn't Foo already inherit from Disposable with goog.inherits(foo, goog.Disposable);?
goog.provide('foo');
/**
* @constructor
*/
foo = function(){
goog.Disposable.call(this);
}
goog.inherits(foo, goog.Disposable);
foo.prototype.doSomething = function(){
...
}
foo.prototype.disposeInternal = function(){
...
}