I maintain a custom library consisting of many dijit widgets at the company I work at.
Many of the defects/bugs I have had to deal with were the result of this.inherited(arguments)
calls missing from overriden methods such as destroy
startup
and postCreate
.
Some of these go unnoticed easily and are not always discovered until much later.
I suspect I can use dojo\aspect
.after to hook onto the 'base' implementation, but I am not sure how to acquire a handle to the _widgetBase method itself.
Merely using .after on the method of my own widget would be pointless, since that wouldn't check whether this.inherited(..)
was inded called.
How can I write a generic test function that can be passed any dijit/_WidgetBase
instance and checks whether the _widgetBase's methods mentioned above are called from the widget when the same method is called on the subclassing widget itself?
Bottom-line is how do I acquire a reference to the base-implementation of the functions mentioned above?