Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use String.prototype.repeat() for clarity #5311

Closed
wants to merge 1 commit into from

Commits on Feb 19, 2016

  1. test: use String.prototype.repeat() for clarity

    There are a few places where tests repeatedly concatenate strings to
    themselves in order to make them very long. Using `.repeat()` makes the
    code clearer.
    
    For example, before:
    
        for (var i = 0; i < 8; ++i) lots_of_headers += lots_of_headers;
    
    After:
    
        lots_of_headers = lots_of_headers.repeat(256);
    
    Using `.repeat()` makes it clear that the string will be repeated 256
    times rather than 8 times. ("What?! That first one doesn't repeat 256
    times! It only repeats 8... Oh, wait. Yes, I see your point now.")
    Trott committed Feb 19, 2016
    Configuration menu
    Copy the full SHA
    95cc99e View commit details
    Browse the repository at this point in the history