summaryrefslogtreecommitdiff
path: root/test/pummel/test-tls-throttle.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/pummel/test-tls-throttle.js
parentbac6c8505690b93cead95ee3053353c8e625cdf0 (diff)
downloadnode-new-4d78121b7786ee5b676d45b9d11e9a89d8dd249c.tar.gz
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/pummel/test-tls-throttle.js')
-rw-r--r--test/pummel/test-tls-throttle.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js
index 67efb61b7e..0e5cd455c8 100644
--- a/test/pummel/test-tls-throttle.js
+++ b/test/pummel/test-tls-throttle.js
@@ -12,16 +12,10 @@ if (!common.hasCrypto) {
var tls = require('tls');
var fs = require('fs');
-
-var body = '';
-
process.stdout.write('build body...');
-for (var i = 0; i < 1024 * 1024; i++) {
- body += 'hello world\n';
-}
+var body = 'hello world\n'.repeat(1024 * 1024);
process.stdout.write('done\n');
-
var options = {
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem')