"Krinkle" posted a comment on MediaWiki.r99444.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99444#c26723

Commit summary for MediaWiki.r99444:

protocol-relative URLs for javascript. Could also be extended to relative urls 
of any kind -- now mw.Uri is just "relative" to the current URL

Krinkle's comment:

Diff confusing indeed, ViewVC link on top is fine though (it ignores whitespace 
by default).

<pre>
-       mw.Uri = function( uri, strictMode ) {
+               function Uri( uri, strictMode ) {
+               return Uri;     
</pre>

This means mw.Uri is no longer a public object constructor that can be 
extended. Or does it ?

Oh I see, the <code>mw.UriRelative</code> is a factory-like function using the 
(now private) object constructor as base to create new object constructors.

Idea: To allow future extendability, perhaps expose this base constructor as 
well so that its prototype is accessible. Would also be nice if the created 
object constructor would extend/inherit from the base constructor, so that 
everything is inherited / re-used by reference (instead of the constructor and 
all prototypes being re-created on every call to <code>mw.UriRelative</code>, 
albeit that <code>mw.UriRelative</code> is likely only called once or twice on 
a regular page).

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to