B2G/gecko/toolkit/mozapps/update/test/chrome/update.sjs
/**
 * Helper function to create a JS object representing the url parameters from
 * the request's queryString.
 *
 * @param  aQueryString
 *         The request's query string.
 * @return A JS object representing the url parameters from the request's
 *         queryString.
 */
Helper function to create a JS object representing the url parameters from
the request's queryString.

@param  aQueryString
The request's query string.
@return A JS object representing the url parameters from the request's
queryString.
Helper function to create a JS object representing the url parameters from the request ' s queryString . @param aQueryString The request ' s query string . @return A JS object representing the url parameters from the request ' s queryString .
function parseQueryString(aQueryString) {
  var paramArray = aQueryString.split("&");
  var regex = /^([^=]+)=(.*)$/;
  var params = {};
  for (var i = 0, sz = paramArray.length; i < sz; i++) {
    var match = regex.exec(paramArray[i]);
    if (!match)
      throw "Bad parameter in queryString!  '" + paramArray[i] + "'";
    params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
  }
  return params;
}
function parseQueryString ( aQueryString ) { var paramArray = aQueryString . split ( "&" ) ; var regex = / ^([^=]+)=(.*)$ / ; var params = { } ; for ( var i = 0 , sz = paramArray . length ; i < sz ; i ++ ) { var match = regex . exec ( paramArray [ i ] ) ; if ( ! match ) throw "Bad parameter in queryString!  '" + paramArray [ i ] + "'" ; params [ decodeURIComponent ( match [ 1 ] ) ] = decodeURIComponent ( match [ 2 ] ) ; } return params ; }
Helper function to create a JS object representing the url parameters from
 the request's queryString.
Helper function to create a JS object representing the url parameters from the request ' s queryString .