summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-full-response.js
diff options
context:
space:
mode:
authorJackson Tian <puling.tyq@alibaba-inc.com>2016-02-19 11:01:11 +0800
committerJames M Snell <jasnell@gmail.com>2016-03-21 16:42:58 -0700
commit4d78121b7786ee5b676d45b9d11e9a89d8dd249c (patch)
treef47c73370ebf0887c86e9a29d9ae580fa1107805 /test/parallel/test-http-full-response.js
parentbac6c8505690b93cead95ee3053353c8e625cdf0 (diff)
downloadandroid-node-v8-4d78121b7786ee5b676d45b9d11e9a89d8dd249c.tar.gz
android-node-v8-4d78121b7786ee5b676d45b9d11e9a89d8dd249c.tar.bz2
android-node-v8-4d78121b7786ee5b676d45b9d11e9a89d8dd249c.zip
lib: simplify code with String.prototype.repeat()
use String.prototype.repeat() to simplify code, less code, more semantically. PR-URL: https://github.com/nodejs/node/pull/5359 Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http-full-response.js')
-rw-r--r--test/parallel/test-http-full-response.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/parallel/test-http-full-response.js b/test/parallel/test-http-full-response.js
index 8472a84fb9..767efa3cd6 100644
--- a/test/parallel/test-http-full-response.js
+++ b/test/parallel/test-http-full-response.js
@@ -7,10 +7,7 @@ var exec = require('child_process').exec;
var bodyLength = 12345;
-var body = '';
-for (var i = 0; i < bodyLength; i++) {
- body += 'c';
-}
+var body = 'c'.repeat(bodyLength);
var server = http.createServer(function(req, res) {
res.writeHead(200, {