In documentation of the mw.util.addPortletLink() method, we may replace :
new mw.Title( 'Special:Example' ).getUrl()
with:
mw.util.getUrl( 'Special:Example' )
Rationale:
- It is simpler and more usual.
- As it is inside a mw.util.addPortletLink(), the mediawiki.util dependency should be already taken care of, whereas using mw.Title() requires adding the mediawiki.Title dependency (and my guess is that it is often overlooked).
- titleObject.getUrl() just calls mw.util.getUrl() internally.