From c901741c6042ed1f41cc7f05535f38e9a0c1be28 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 19 Feb 2016 17:03:16 -0800 Subject: [PATCH] benchmark: use strict mode Apply strict mode to benchmark code. PR-URL: https://github.com/nodejs/node/pull/5773 Reviewed-By: James M Snell Reviewed-By: Myles Borins --- benchmark/arrays/var-int.js | 1 + benchmark/arrays/zero-float.js | 1 + benchmark/arrays/zero-int.js | 1 + benchmark/buffers/buffer-base64-decode.js | 1 + benchmark/buffers/buffer-base64-encode.js | 1 + benchmark/buffers/buffer-bytelength.js | 1 + benchmark/buffers/buffer-compare.js | 1 + benchmark/buffers/buffer-creation.js | 3 ++- benchmark/buffers/buffer-indexof.js | 1 + benchmark/buffers/buffer-iterate.js | 1 + benchmark/buffers/buffer-read.js | 1 + benchmark/buffers/buffer-slice.js | 1 + benchmark/buffers/buffer-write.js | 2 +- benchmark/buffers/dataview-set.js | 2 +- benchmark/common.js | 1 + benchmark/compare.js | 1 + benchmark/crypto/aes-gcm-throughput.js | 1 + benchmark/crypto/cipher-stream.js | 1 + benchmark/crypto/hash-stream-creation.js | 1 + benchmark/crypto/hash-stream-throughput.js | 1 + benchmark/crypto/rsa-encrypt-decrypt-throughput.js | 1 + benchmark/crypto/rsa-sign-verify-throughput.js | 1 + benchmark/events/ee-add-remove.js | 1 + benchmark/events/ee-emit-multi-args.js | 1 + benchmark/events/ee-emit.js | 1 + benchmark/events/ee-listener-count-on-prototype.js | 1 + benchmark/events/ee-listeners-many.js | 1 + benchmark/events/ee-listeners.js | 1 + benchmark/fs-write-stream-throughput.js | 2 +- benchmark/fs/read-stream-throughput.js | 1 + benchmark/fs/readfile.js | 1 + benchmark/fs/write-stream-throughput.js | 1 + benchmark/http/chunked.js | 3 ++- benchmark/http/client-request-body.js | 1 + benchmark/http/cluster.js | 1 + benchmark/http/end-vs-write-end.js | 4 ++-- benchmark/http/simple.js | 1 + benchmark/http_bench.js | 1 + benchmark/http_server_lag.js | 2 ++ benchmark/http_simple_auto.js | 1 + benchmark/idle_clients.js | 3 ++- benchmark/misc/child-process-read.js | 1 + benchmark/misc/domain-fn-args.js | 8 ++++---- benchmark/misc/function_call/index.js | 1 + benchmark/misc/module-loader.js | 1 + benchmark/misc/next-tick-breadth.js | 1 + benchmark/misc/next-tick-depth.js | 1 + benchmark/misc/spawn-echo.js | 1 + benchmark/misc/startup.js | 1 + benchmark/misc/string-creation.js | 1 + benchmark/misc/string-decoder.js | 1 + benchmark/misc/timers.js | 1 + benchmark/misc/url.js | 1 + benchmark/misc/v8-bench.js | 1 + benchmark/net/net-c2s-cork.js | 1 + benchmark/net/net-c2s.js | 1 + benchmark/net/net-pipe.js | 1 + benchmark/net/net-s2c.js | 1 + benchmark/net/tcp-raw-c2s.js | 1 + benchmark/net/tcp-raw-pipe.js | 1 + benchmark/net/tcp-raw-s2c.js | 1 + benchmark/path/basename.js | 1 + benchmark/path/dirname.js | 1 + benchmark/path/extname.js | 1 + benchmark/path/format.js | 1 + benchmark/path/isAbsolute.js | 1 + benchmark/path/join.js | 1 + benchmark/path/normalize.js | 1 + benchmark/path/parse.js | 1 + benchmark/path/resolve.js | 1 + benchmark/querystring/querystring-parse.js | 1 + benchmark/querystring/querystring-stringify.js | 1 + benchmark/report-startup-memory.js | 1 + benchmark/static_http_server.js | 1 + benchmark/tls/throughput.js | 1 + benchmark/url/url-parse.js | 1 + benchmark/url/url-resolve.js | 1 + benchmark/util/inspect.js | 1 + 78 files changed, 86 insertions(+), 12 deletions(-) diff --git a/benchmark/arrays/var-int.js b/benchmark/arrays/var-int.js index 2b5fefc126ac1f..74a73c9515fffa 100644 --- a/benchmark/arrays/var-int.js +++ b/benchmark/arrays/var-int.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', diff --git a/benchmark/arrays/zero-float.js b/benchmark/arrays/zero-float.js index 015e9a08f95725..e2569eed5c4e75 100644 --- a/benchmark/arrays/zero-float.js +++ b/benchmark/arrays/zero-float.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', diff --git a/benchmark/arrays/zero-int.js b/benchmark/arrays/zero-int.js index 4dad3e9980e78b..8be70c1e87113a 100644 --- a/benchmark/arrays/zero-int.js +++ b/benchmark/arrays/zero-int.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js index 23ab92462f8927..36094f632d4eec 100644 --- a/benchmark/buffers/buffer-base64-decode.js +++ b/benchmark/buffers/buffer-base64-decode.js @@ -1,3 +1,4 @@ +'use strict'; const assert = require('assert'); const common = require('../common.js'); diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index 630995a2fe8ff5..8e2eec3cf5bb37 100644 --- a/benchmark/buffers/buffer-base64-encode.js +++ b/benchmark/buffers/buffer-base64-encode.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, {}); diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js index 42795d0bdf2104..50f420f412d30b 100644 --- a/benchmark/buffers/buffer-bytelength.js +++ b/benchmark/buffers/buffer-bytelength.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index b02e8a74030042..c83bb67fa24ad8 100644 --- a/benchmark/buffers/buffer-compare.js +++ b/benchmark/buffers/buffer-compare.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-creation.js b/benchmark/buffers/buffer-creation.js index fc498d0bf717d7..dfb68467cc54b9 100644 --- a/benchmark/buffers/buffer-creation.js +++ b/benchmark/buffers/buffer-creation.js @@ -1,4 +1,5 @@ -SlowBuffer = require('buffer').SlowBuffer; +'use strict'; +const SlowBuffer = require('buffer').SlowBuffer; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index 0f54930296f268..6f10033020bc74 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var fs = require('fs'); const path = require('path'); diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index 77a0b59b8ac081..fb8abc1aee1c63 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -1,3 +1,4 @@ +'use strict'; var SlowBuffer = require('buffer').SlowBuffer; var common = require('../common.js'); var assert = require('assert'); diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index ba289e1fd319dc..2810aa1b463321 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-slice.js b/benchmark/buffers/buffer-slice.js index f632fa64adff11..70cf3a705c0d8b 100644 --- a/benchmark/buffers/buffer-slice.js +++ b/benchmark/buffers/buffer-slice.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var SlowBuffer = require('buffer').SlowBuffer; diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index b84bcf22d9bd58..4e07fc511be12a 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -1,4 +1,4 @@ - +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { noAssert: [false, true], diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js index ce0064edb6e0cd..ab9c1d1d23b736 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -1,4 +1,4 @@ - +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { type: ['Uint8', 'Uint16LE', 'Uint16BE', diff --git a/benchmark/common.js b/benchmark/common.js index c4f7e3b86e3be9..eb1959be791495 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -1,3 +1,4 @@ +'use strict'; var assert = require('assert'); var fs = require('fs'); var path = require('path'); diff --git a/benchmark/compare.js b/benchmark/compare.js index 0855c62f56eb9d..44854aefa7b5e8 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -1,3 +1,4 @@ +'use strict'; var usage = 'node benchmark/compare.js ' + ' ' + '[--html] [--red|-r] [--green|-g] ' + diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 450d7982781f99..fc379b21b748bf 100644 --- a/benchmark/crypto/aes-gcm-throughput.js +++ b/benchmark/crypto/aes-gcm-throughput.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); var keylen = {'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32}; diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 594b51aa7c2e0e..5da6f2481ecbc3 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index e7308dbc617c18..4bcd37f00aaae8 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -1,5 +1,6 @@ // throughput benchmark // creates a single hasher, then pushes a bunch of data through it +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index bc64b1d47330dc..050bbeb1ae54d3 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -1,5 +1,6 @@ // throughput benchmark // creates a single hasher, then pushes a bunch of data through it +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 6bba234d5a2b0d..cf0579134cfb62 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -1,3 +1,4 @@ +'use strict'; // throughput benchmark in signing and verifying var common = require('../common.js'); var crypto = require('crypto'); diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index f2a6c9e59a602a..779cc8bca1c6a8 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -1,3 +1,4 @@ +'use strict'; // throughput benchmark in signing and verifying var common = require('../common.js'); var crypto = require('crypto'); diff --git a/benchmark/events/ee-add-remove.js b/benchmark/events/ee-add-remove.js index b6dacb1f1b048b..99d85367cb8d6f 100644 --- a/benchmark/events/ee-add-remove.js +++ b/benchmark/events/ee-add-remove.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var events = require('events'); diff --git a/benchmark/events/ee-emit-multi-args.js b/benchmark/events/ee-emit-multi-args.js index 0d84e58f1231ee..b423c216b1ed73 100644 --- a/benchmark/events/ee-emit-multi-args.js +++ b/benchmark/events/ee-emit-multi-args.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/events/ee-emit.js b/benchmark/events/ee-emit.js index 4c45bd9b719665..87772222f0a467 100644 --- a/benchmark/events/ee-emit.js +++ b/benchmark/events/ee-emit.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/events/ee-listener-count-on-prototype.js b/benchmark/events/ee-listener-count-on-prototype.js index e7fda58d230d1d..dfe7e27cd09144 100644 --- a/benchmark/events/ee-listener-count-on-prototype.js +++ b/benchmark/events/ee-listener-count-on-prototype.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/events/ee-listeners-many.js b/benchmark/events/ee-listeners-many.js index a88cc14a1deef4..063732e1facb4b 100644 --- a/benchmark/events/ee-listeners-many.js +++ b/benchmark/events/ee-listeners-many.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/events/ee-listeners.js b/benchmark/events/ee-listeners.js index c24e95a1e66cd8..e91ca5078f5f98 100644 --- a/benchmark/events/ee-listeners.js +++ b/benchmark/events/ee-listeners.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/fs-write-stream-throughput.js b/benchmark/fs-write-stream-throughput.js index 3e968e66dd07a1..4c767cf666e579 100644 --- a/benchmark/fs-write-stream-throughput.js +++ b/benchmark/fs-write-stream-throughput.js @@ -1,5 +1,5 @@ - // If there are no args, then this is the root. Run all the benchmarks! +'use strict'; if (!process.argv[2]) parent(); else diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index e7adf87a90ccfe..c305485cd5f8dc 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -1,4 +1,5 @@ // test the throughput of the fs.WriteStream class. +'use strict'; var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index ac3241901b931e..0f39f64f57c418 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -1,6 +1,7 @@ // Call fs.readFile over and over again really fast. // Then see how many times it got called. // Yes, this is a silly benchmark. Most benchmarks are silly. +'use strict'; var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 10508a01e9e234..4f41d2b4bb4af3 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -1,4 +1,5 @@ // test the throughput of the fs.WriteStream class. +'use strict'; var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/http/chunked.js b/benchmark/http/chunked.js index 62a74db2d48a51..642f2962cdce78 100644 --- a/benchmark/http/chunked.js +++ b/benchmark/http/chunked.js @@ -6,6 +6,7 @@ // always as hot as it could be. // // Verify that our assumptions are valid. +'use strict'; var common = require('../common.js'); @@ -16,7 +17,7 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - http = require('http'); + const http = require('http'); var chunk = new Buffer(conf.size); chunk.fill('8'); diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js index 1c27dea2a2066e..befa3811ddd1c3 100644 --- a/benchmark/http/client-request-body.js +++ b/benchmark/http/client-request-body.js @@ -1,4 +1,5 @@ // Measure the time it takes for the HTTP client to send a request body. +'use strict'; var common = require('../common.js'); var http = require('http'); diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js index 6391704ff7836b..9934883f7c3fa4 100644 --- a/benchmark/http/cluster.js +++ b/benchmark/http/cluster.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/http/end-vs-write-end.js b/benchmark/http/end-vs-write-end.js index cec721ac7119b2..4e12e543f0bd92 100644 --- a/benchmark/http/end-vs-write-end.js +++ b/benchmark/http/end-vs-write-end.js @@ -6,6 +6,7 @@ // always as hot as it could be. // // Verify that our assumptions are valid. +'use strict'; var common = require('../common.js'); @@ -17,7 +18,7 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - http = require('http'); + const http = require('http'); var chunk; var len = conf.kb * 1024; switch (conf.type) { @@ -26,7 +27,6 @@ function main(conf) { chunk.fill('x'); break; case 'utf': - encoding = 'utf8'; chunk = new Array(len / 2 + 1).join('ΓΌ'); break; case 'asc': diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index ad7352daf2aba8..5449c49be97614 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/http_bench.js b/benchmark/http_bench.js index 6b7cbd0bac9d10..354993a2706a95 100644 --- a/benchmark/http_bench.js +++ b/benchmark/http_bench.js @@ -1,3 +1,4 @@ +'use strict'; var spawn = require('child_process').spawn; var cluster = require('cluster'); var http = require('http'); diff --git a/benchmark/http_server_lag.js b/benchmark/http_server_lag.js index 78d04fe2e27670..a3c18628ec68ba 100644 --- a/benchmark/http_server_lag.js +++ b/benchmark/http_server_lag.js @@ -1,3 +1,5 @@ +'use strict'; + var http = require('http'); var port = parseInt(process.env.PORT, 10) || 8000; var defaultLag = parseInt(process.argv[2], 10) || 100; diff --git a/benchmark/http_simple_auto.js b/benchmark/http_simple_auto.js index 2eb617a2d14dab..6f56879cc08aaa 100644 --- a/benchmark/http_simple_auto.js +++ b/benchmark/http_simple_auto.js @@ -6,6 +6,7 @@ // Arguments to pass to `ab`. // Target to benchmark, e.g. `bytes/1024` or `buffer/8192`. // +'use strict'; var http = require('http'); var spawn = require('child_process').spawn; diff --git a/benchmark/idle_clients.js b/benchmark/idle_clients.js index aca2090e9e563f..d294e685224d8b 100644 --- a/benchmark/idle_clients.js +++ b/benchmark/idle_clients.js @@ -1,4 +1,5 @@ -net = require('net'); +'use strict'; +const net = require('net'); var errors = 0, connections = 0; diff --git a/benchmark/misc/child-process-read.js b/benchmark/misc/child-process-read.js index 894dd55d301249..c1a7474aae32c1 100644 --- a/benchmark/misc/child-process-read.js +++ b/benchmark/misc/child-process-read.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { len: [64, 256, 1024, 4096, 32768], diff --git a/benchmark/misc/domain-fn-args.js b/benchmark/misc/domain-fn-args.js index ed9b30aa91285f..6f1adcaec68584 100644 --- a/benchmark/misc/domain-fn-args.js +++ b/benchmark/misc/domain-fn-args.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var domain = require('domain'); @@ -12,14 +13,13 @@ var gargs = [1, 2, 3]; function main(conf) { var args, ret, n = +conf.n; - var arguments = gargs.slice(0, conf.arguments); - + var myArguments = gargs.slice(0, conf.arguments); bench.start(); bdomain.enter(); for (var i = 0; i < n; i++) { - if (arguments.length >= 2) { - args = Array.prototype.slice.call(arguments, 1); + if (myArguments.length >= 2) { + args = Array.prototype.slice.call(myArguments, 1); ret = fn.apply(this, args); } else { fn.call(this); diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index e722a219c97b0b..04f5627093893e 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -2,6 +2,7 @@ // relative to a comparable C++ function. // Reports millions of calls per second. // Note that JS speed goes up, while cxx speed stays about the same. +'use strict'; var assert = require('assert'); var common = require('../../common.js'); diff --git a/benchmark/misc/module-loader.js b/benchmark/misc/module-loader.js index ad86891bb8ff3a..1df7a74cbe77e1 100644 --- a/benchmark/misc/module-loader.js +++ b/benchmark/misc/module-loader.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs'); var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/misc/next-tick-breadth.js b/benchmark/misc/next-tick-breadth.js index 652408144373f6..87d130f3a7e102 100644 --- a/benchmark/misc/next-tick-breadth.js +++ b/benchmark/misc/next-tick-breadth.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/misc/next-tick-depth.js b/benchmark/misc/next-tick-depth.js index 8a2c8e0a6ae148..bc513d338d6d8c 100644 --- a/benchmark/misc/next-tick-depth.js +++ b/benchmark/misc/next-tick-depth.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { millions: [2] diff --git a/benchmark/misc/spawn-echo.js b/benchmark/misc/spawn-echo.js index 2b1b989e679b96..7c9e851aacb641 100644 --- a/benchmark/misc/spawn-echo.js +++ b/benchmark/misc/spawn-echo.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { thousands: [1] diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup.js index 09cf88e73643f8..34604911d250f3 100644 --- a/benchmark/misc/startup.js +++ b/benchmark/misc/startup.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var spawn = require('child_process').spawn; var path = require('path'); diff --git a/benchmark/misc/string-creation.js b/benchmark/misc/string-creation.js index b8683ed1b104a7..59fb1b52b4ec12 100644 --- a/benchmark/misc/string-creation.js +++ b/benchmark/misc/string-creation.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/misc/string-decoder.js b/benchmark/misc/string-decoder.js index fe08c0e9fece41..b10b0a6e9cbd48 100644 --- a/benchmark/misc/string-decoder.js +++ b/benchmark/misc/string-decoder.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var StringDecoder = require('string_decoder').StringDecoder; diff --git a/benchmark/misc/timers.js b/benchmark/misc/timers.js index 23f571bb4528a1..13b18fffc5ead7 100644 --- a/benchmark/misc/timers.js +++ b/benchmark/misc/timers.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/misc/url.js b/benchmark/misc/url.js index 6c2799b6cb92b2..78fe7b6c560ef2 100644 --- a/benchmark/misc/url.js +++ b/benchmark/misc/url.js @@ -1,3 +1,4 @@ +'use strict'; var url = require('url') var n = 25 * 100; diff --git a/benchmark/misc/v8-bench.js b/benchmark/misc/v8-bench.js index efe81f8ebb8a0e..0b9a5139ba23cf 100644 --- a/benchmark/misc/v8-bench.js +++ b/benchmark/misc/v8-bench.js @@ -1,4 +1,5 @@ // compare with "google-chrome deps/v8/benchmarks/run.html" +'use strict'; var fs = require('fs'); var path = require('path'); var vm = require('vm'); diff --git a/benchmark/net/net-c2s-cork.js b/benchmark/net/net-c2s-cork.js index a811c86c56ae9d..5d1c8a7495ead9 100644 --- a/benchmark/net/net-c2s-cork.js +++ b/benchmark/net/net-c2s-cork.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/net/net-c2s.js b/benchmark/net/net-c2s.js index 718d4407c66d5b..370ff4f138cafd 100644 --- a/benchmark/net/net-c2s.js +++ b/benchmark/net/net-c2s.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/net/net-pipe.js b/benchmark/net/net-pipe.js index 63a0a26a563870..ea8af249a35b50 100644 --- a/benchmark/net/net-pipe.js +++ b/benchmark/net/net-pipe.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index c4ab05a44aae94..af40d8d58d8852 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index e3fc9edaa1d499..e13af85c6774dd 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index 69fbac6c2fe17b..c05c816855e7a6 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index 34f67bf0176e37..822a74c679db12 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); diff --git a/benchmark/path/basename.js b/benchmark/path/basename.js index 57d9492746b32c..6c710dbb58ceb6 100644 --- a/benchmark/path/basename.js +++ b/benchmark/path/basename.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/dirname.js b/benchmark/path/dirname.js index e95adf28811a4e..4a9c04158cdee6 100644 --- a/benchmark/path/dirname.js +++ b/benchmark/path/dirname.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/extname.js b/benchmark/path/extname.js index c655ee7e3e160a..4f7c6b542d21c4 100644 --- a/benchmark/path/extname.js +++ b/benchmark/path/extname.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/format.js b/benchmark/path/format.js index bc77f888116963..478a30cbaedbd2 100644 --- a/benchmark/path/format.js +++ b/benchmark/path/format.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/isAbsolute.js b/benchmark/path/isAbsolute.js index d4c79b99cdbeb7..0d412f925388c6 100644 --- a/benchmark/path/isAbsolute.js +++ b/benchmark/path/isAbsolute.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/join.js b/benchmark/path/join.js index 58f4dc3e1e9e44..0262e25d249cb0 100644 --- a/benchmark/path/join.js +++ b/benchmark/path/join.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/normalize.js b/benchmark/path/normalize.js index 6f7f05e4f9e1c8..56a637f401c0cc 100644 --- a/benchmark/path/normalize.js +++ b/benchmark/path/normalize.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/parse.js b/benchmark/path/parse.js index f3fbb2a1f5c98f..2afc143090c6c8 100644 --- a/benchmark/path/parse.js +++ b/benchmark/path/parse.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/path/resolve.js b/benchmark/path/resolve.js index 375e8b134ba0ea..5235b94b74d328 100644 --- a/benchmark/path/resolve.js +++ b/benchmark/path/resolve.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var path = require('path'); var v8 = require('v8'); diff --git a/benchmark/querystring/querystring-parse.js b/benchmark/querystring/querystring-parse.js index 4fbc18bf2e4453..1019a941dfdecb 100644 --- a/benchmark/querystring/querystring-parse.js +++ b/benchmark/querystring/querystring-parse.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var querystring = require('querystring'); var v8 = require('v8'); diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index d4bb95c21e5af4..c2f38554166aa4 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var querystring = require('querystring'); var v8 = require('v8'); diff --git a/benchmark/report-startup-memory.js b/benchmark/report-startup-memory.js index 14e56231ec2ddd..6d796307f4f437 100644 --- a/benchmark/report-startup-memory.js +++ b/benchmark/report-startup-memory.js @@ -1 +1,2 @@ +'use strict'; console.log(process.memoryUsage().rss); diff --git a/benchmark/static_http_server.js b/benchmark/static_http_server.js index 1a88fb58234317..804f83c208bb39 100644 --- a/benchmark/static_http_server.js +++ b/benchmark/static_http_server.js @@ -1,3 +1,4 @@ +'use strict'; var http = require('http'); var concurrency = 30; diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js index 58778561da3faa..7b545267ace7fe 100644 --- a/benchmark/tls/throughput.js +++ b/benchmark/tls/throughput.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { dur: [5], diff --git a/benchmark/url/url-parse.js b/benchmark/url/url-parse.js index ffa47c4ccd6105..89679548b8f193 100644 --- a/benchmark/url/url-parse.js +++ b/benchmark/url/url-parse.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var url = require('url'); var v8 = require('v8'); diff --git a/benchmark/url/url-resolve.js b/benchmark/url/url-resolve.js index 5f6c1f7600ce4e..18f67e82e30787 100644 --- a/benchmark/url/url-resolve.js +++ b/benchmark/url/url-resolve.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var url = require('url'); var v8 = require('v8'); diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js index 9955bc6d64876a..3312bd683ba81b 100644 --- a/benchmark/util/inspect.js +++ b/benchmark/util/inspect.js @@ -1,3 +1,4 @@ +'use strict'; var util = require('util'); var common = require('../common.js');