summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-byteswritten.js
diff options
context:
space:
mode:
authorJackson Tian <shyvo1987@gmail.com>2017-01-30 16:57:49 +0800
committerItalo A. Casas <me@italoacasas.com>2017-02-01 20:06:04 -0800
commit58dc229d9aac29132cf038ed07b3b7e13b671dca (patch)
tree2b0077284bf4e1f5fa348f799dd780af37a1b93a /test/parallel/test-http-byteswritten.js
parent773cdc31ef3e17327d1eb0a3b92828e25457f015 (diff)
downloadandroid-node-v8-58dc229d9aac29132cf038ed07b3b7e13b671dca.tar.gz
android-node-v8-58dc229d9aac29132cf038ed07b3b7e13b671dca.tar.bz2
android-node-v8-58dc229d9aac29132cf038ed07b3b7e13b671dca.zip
test: use repeat() instead of new Array().join()
The usage of `new Array(length + 1).join(str)` is strange. Change to `str.repeat(length)` is more clearly. PR-URL: https://github.com/nodejs/node/pull/11071 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
Diffstat (limited to 'test/parallel/test-http-byteswritten.js')
-rw-r--r--test/parallel/test-http-byteswritten.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-http-byteswritten.js b/test/parallel/test-http-byteswritten.js
index 3b295ebdcc..c92506e827 100644
--- a/test/parallel/test-http-byteswritten.js
+++ b/test/parallel/test-http-byteswritten.js
@@ -16,7 +16,7 @@ const httpServer = http.createServer(common.mustCall(function(req, res) {
// Write 1.5mb to cause some requests to buffer
// Also, mix up the encodings a bit.
- const chunk = new Array(1024 + 1).join('7');
+ const chunk = '7'.repeat(1024);
const bchunk = Buffer.from(chunk);
for (let i = 0; i < 1024; i++) {
res.write(chunk);