test: use String.prototype.repeat() for clarity
authorRich Trott <rtrott@gmail.com>
Thu, 18 Feb 2016 23:01:12 +0000 (15:01 -0800)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
commit6d5f4c418aaae60d6322e3b00ffcebc213251e6b
tree77a5f78a7277db24043ff613e04c0fc376b2c633
parent3d10afa9c6ffcbede29dcca86928768028b98f2f
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.")

PR-URL: https://github.com/nodejs/node/pull/5311
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
test/parallel/test-crypto-from-binary.js
test/parallel/test-http-dns-error.js
test/parallel/test-http-parser.js
test/parallel/test-net-dns-error.js