X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.Uri%2FUri.js;h=c7c061e864dbaae4514dff49050cddc7d470d45c;hb=10e2511f81d329c9ad401dd979e6ccd9fb64d987;hp=0e5a5ba9c862e5aed98b06fc4a7cc0064a22c83f;hpb=b9333ae6557b86e4b074025c43e77e745610b345;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.Uri/Uri.js b/resources/src/mediawiki.Uri/Uri.js index 0e5a5ba9c8..c7c061e864 100644 --- a/resources/src/mediawiki.Uri/Uri.js +++ b/resources/src/mediawiki.Uri/Uri.js @@ -95,7 +95,7 @@ * * @private * @static - * @property {Array} properties + * @property {string[]} properties */ properties = [ 'protocol', @@ -134,14 +134,14 @@ */ /** - * A factory method to create a Uri class with a default location to resolve relative URLs + * A factory method to create an mw.Uri class with a default location to resolve relative URLs * against (including protocol-relative URLs). * * @method * @param {string|Function} documentLocation A full url, or function returning one. * If passed a function, the return value may change over time and this will be honoured. (T74334) * @member mw - * @return {Function} Uri class + * @return {Function} An mw.Uri class constructor */ mw.UriRelative = function ( documentLocation ) { var getDefaultUri = ( function () { @@ -176,6 +176,7 @@ * @param {boolean} [options.strictMode=false] Trigger strict mode parsing of the url. * @param {boolean} [options.overrideKeys=false] Whether to let duplicate query parameters * override each other (`true`) or automagically convert them to an array (`false`). + * @throws {Error} when the query string or fragment contains an unknown % sequence */ function Uri( uri, options ) { var prop, hrefCur, @@ -266,6 +267,7 @@ * @static * @param {string} s String to decode * @return {string} Decoded string + * @throws {Error} when the string contains an unknown % sequence */ Uri.decode = function ( s ) { return decodeURIComponent( s.replace( /\+/g, '%20' ) ); @@ -279,6 +281,7 @@ * @private * @param {string} str URI, see constructor. * @param {Object} options See constructor. + * @throws {Error} when the query string or fragment contains an unknown % sequence */ parse: function ( str, options ) { var q, matches, @@ -368,7 +371,7 @@ */ getQueryString: function () { var args = []; - // eslint-disable-next-line jquery/no-each-util + // eslint-disable-next-line no-jquery/no-each-util $.each( this.query, function ( key, val ) { var k = Uri.encode( key ), vals = Array.isArray( val ) ? val : [ val ];