context: function dcc_getnextport(){    var portList = this.parent.prefs["dcc.listenPorts"];        var newPort = this._lastPort;        for (var i = 0; i < portList.length; i++)    {        var m = portList[i].match(/^(\d+)(?:-(\d+))?$/);        if (m)        {            if (!newPort)            {                // We dodn't have any previous port, so just take the first we                // find.                return this._lastPort = Number(m[1]);            }            else if (arrayHasElementAt(m, 2))            {                // Port range. Anything before range, or in [exl. last value]                // is ok. Make sure first value is lowest value returned.                if (newPort < m[2])                    return this._lastPort = Math.max(newPort + 1, Number(m[1]));            }            else            {                // Single port.                if (newPort < m[1])                    return this._lastPort = Number(m[1]);            }        }    }        // No ports found, and no last port --> use OS.    if (newPort == null)        return -1;        // Didn't find anything... d'oh. Need to start from the begining again.    this._lastPort = null;    return this.getNextPort();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d84f82bf3e11bd09e70e1036662b0018f8834acc/dcc.js/clean/extensions/irc/js/lib/dcc.js