You can clone with
There's another reason we need to update the widget base class:
It seems that, when you subclass a widget, objects declared in the superclass' prototype and overriden in the subclass' prototype clobber the objects in the superclass' prototype upon getting overridden.
Please have a look at this for an example. If you replace the link to jqm master's version of jquery.ui.widget.js with that of juery UI's master, the subclassing will start to work properly.
I just dropped jquery.ui.widget.js 1.8.17 into our source tree and tests are passing so to upgrading to the latest version of this component.
Unfortunately 1.8.17 does not contain that fix.
This bug is fixed in the following jquery-ui commit: b915325
So which version of jquery-ui is that? It looks like that commit is pretty old.
It is in 1.9m5 ... 1.9m4 is still broken. My guess is that while the commit may be old, they never tagged any of its descendents as 1.8.x, because they're saving it for 1.9.
I did a checkout of 1.9m4 vs. 1.9m5 and it is indeed broken in 1.9m4 whereas it is fixed in 1.9m5.
[widget] Took widget from jQuery UI 1.9m7 - Fixes: #3544