samples/dynamic.js
function check() {
    if (links[currentLink] && currentLink < upTo) {
        this.echo('--- Link ' + currentLink + ' ---');
        start.call(this, links[currentLink]);
        addLinks.call(this, links[currentLink]);
        currentLink++;
        this.run(check);
    } else {
        this.echo("All done.");
        this.exit();
    }
}
function check() {
    if (links[currentLink] && currentLink < upTo) {
        this.echo('--- Link ' + currentLink + ' ---');
        start.call(this, links[currentLink]);
        addLinks.call(this, links[currentLink]);
        currentLink++;
        this.run(check);
    } else {
        this.echo("All done.");
        this.exit();
    }
}
function check ( ) { if ( links [ currentLink ] && currentLink < upTo ) { this . echo ( '--- Link ' + currentLink + ' ---' ) ; start . call ( this , links [ currentLink ] ) ; addLinks . call ( this , links [ currentLink ] ) ; currentLink ++ ; this . run ( check ) ; } else { this . echo ( "All done." ) ; this . exit ( ) ; } }
As long as it has a next link, and is under the maximum limit, will keep running
As long as it has a next link and is under the maximum limit will keep running