From 2f9fee6e8e8d7608d2648c6132836f3f9d1d1947 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/5336 Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Roman Reiss Reviewed-By: Ben Noordhuis --- 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 | 7 ++++--- 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.js | 2 ++ benchmark/http_simple_auto.js | 1 + benchmark/http_simple_cluster.js | 1 + benchmark/idle_clients.js | 3 ++- benchmark/misc/child-process-read.js | 1 + benchmark/misc/domain-fn-args.js | 7 ++++--- 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-posix.js | 1 + benchmark/path/basename-win32.js | 1 + benchmark/path/dirname-posix.js | 1 + benchmark/path/dirname-win32.js | 1 + benchmark/path/extname-posix.js | 1 + benchmark/path/extname-win32.js | 1 + benchmark/path/format-posix.js | 1 + benchmark/path/format-win32.js | 1 + benchmark/path/isAbsolute-posix.js | 1 + benchmark/path/isAbsolute-win32.js | 1 + benchmark/path/join-posix.js | 1 + benchmark/path/join-win32.js | 1 + benchmark/path/makeLong-win32.js | 1 + benchmark/path/normalize-posix.js | 1 + benchmark/path/normalize-win32.js | 1 + benchmark/path/parse-posix.js | 1 + benchmark/path/parse-win32.js | 1 + benchmark/path/relative-posix.js | 1 + benchmark/path/relative-win32.js | 1 + benchmark/path/resolve-posix.js | 1 + benchmark/path/resolve-win32.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/tls/tls-connect.js | 1 + benchmark/url/url-parse.js | 1 + benchmark/url/url-resolve.js | 1 + benchmark/util/inspect.js | 1 + 93 files changed, 105 insertions(+), 14 deletions(-) diff --git a/benchmark/arrays/var-int.js b/benchmark/arrays/var-int.js index 47a7e62dc7681b..4f9010aabc0845 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 Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), diff --git a/benchmark/arrays/zero-float.js b/benchmark/arrays/zero-float.js index a6624205bffdea..0186394ad946ac 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 Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), diff --git a/benchmark/arrays/zero-int.js b/benchmark/arrays/zero-int.js index 29a2d58b665cbe..3b1b0ab821ed59 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 Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js index 76850c1231eda0..0b318f281b07e5 100644 --- a/benchmark/buffers/buffer-base64-decode.js +++ b/benchmark/buffers/buffer-base64-decode.js @@ -1,3 +1,4 @@ +'use strict'; var assert = require('assert'); var common = require('../common.js'); diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index cb520be2a621eb..68171233910eb2 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 6a7afe6921aea1..c40c7897a26aaf 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 bc0c55711858de..6f4b2c9579e5c6 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 c575f54b6a638c..7ae26694900c2f 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'); 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 92138bccef99d6..e50de84b043af7 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 2a2a0e37e3adda..22383319d9ea30 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 c0c7805a5c53db..6878d41d1416bc 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 edb116d0c64baa..fb27d626b59c83 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] ' + @@ -38,9 +39,9 @@ for (var i = 2; i < process.argv.length; i++) { if (!html) { var start = ''; - var green = '\033[1;32m'; - var red = '\033[1;31m'; - var reset = '\033[m'; + var green = '\u001b[1;32m'; + var red = '\u001b[1;31m'; + var reset = '\u001b[m'; var end = ''; } else { var start = '
';
diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js
index 65e1713f0eb1c6..8d4eba54cdb962 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 4e8198931729f4..df1ae8d696255b 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 a14aa220120e4e..31b6706c02ea87 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 2e987f03f5a1cf..2a17ce576c6430 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 1cd7a5e632910b..86d3de4600dbdc 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 fd4260417b2221..200e573294bc44 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 cd9fe3cb7de057..1d8f2a8bae8ec1 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 78a892d457095d..7416915db13abc 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 8d536edd62739b..9fb060a6a14246 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 32721b32e56527..6ea838286cd1da 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 68339bc3eca77a..05b400662c8e85 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 b131d5b736fd38..a251af526a7851 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 a181a2df60291c..6b6a3927966e60 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 9ff58389c7959d..a3eef67aa42f91 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 0589ff3166f04d..9743bc1d6f6631 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');
 var PORT = common.PORT;
@@ -17,7 +18,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 c17e2ffb45fa02..d6b3ebe40939e3 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');
 var PORT = common.PORT;
@@ -18,7 +19,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) {
@@ -27,7 +28,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 5bff9283cb51a1..835fa3d52f5e81 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 a8f99e2f0e7978..4d21415697615c 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 ca923d5b34afde..bc1825b22c4287 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.js b/benchmark/http_simple.js
index 36800f2c9dba5a..df0505b07a053a 100644
--- a/benchmark/http_simple.js
+++ b/benchmark/http_simple.js
@@ -1,3 +1,5 @@
+'use strict';
+
 var path = require('path'),
     exec = require('child_process').exec,
     http = require('http');
diff --git a/benchmark/http_simple_auto.js b/benchmark/http_simple_auto.js
index f72cc01e60aa46..9d165939af8d3f 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 path = require("path");
 var http = require("http");
diff --git a/benchmark/http_simple_cluster.js b/benchmark/http_simple_cluster.js
index 9a886f2ee75dab..c2c792c5cb344b 100644
--- a/benchmark/http_simple_cluster.js
+++ b/benchmark/http_simple_cluster.js
@@ -1,3 +1,4 @@
+'use strict';
 var cluster = require('cluster');
 var os = require('os');
 
diff --git a/benchmark/idle_clients.js b/benchmark/idle_clients.js
index da96b8ac654db4..704ed2e9865bbc 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 36e9e900299bb2..517ca924e9d2cf 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,13 +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 {
       ret = fn.call(this);
diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js
index fc8542a068ccd6..e2e01b17fa23ff 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 e53bc4d801164b..17948604c787a8 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 aa5b4420f65903..f4577796b04ac8 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 74dabd66c02501..74dea02312c097 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 14563cee0d7754..e45016b5593136 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 0eb95aa9e2b2bc..606170acb38618 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 5f8e0fa4357b99..4ca53716b7ddc7 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 49de7c77c9265c..bbfbd883f8e7ca 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 2a5ed8e483659e..d12a45fc9c3f3c 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 79e22494a7b8ed..4dc84621085edd 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 0039313f5235ad..25efc78c0acd2f 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 1504d11db5fa53..e22437f422eb48 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 502586c2a05e29..15f9578b7789fa 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-posix.js b/benchmark/path/basename-posix.js
index d4ea072b57c52d..64da9017793440 100644
--- a/benchmark/path/basename-posix.js
+++ b/benchmark/path/basename-posix.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/basename-win32.js b/benchmark/path/basename-win32.js
index 08938a20502cc6..b8e2186612e76f 100644
--- a/benchmark/path/basename-win32.js
+++ b/benchmark/path/basename-win32.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-posix.js b/benchmark/path/dirname-posix.js
index 037ac636708793..e7ea80ffa313c8 100644
--- a/benchmark/path/dirname-posix.js
+++ b/benchmark/path/dirname-posix.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-win32.js b/benchmark/path/dirname-win32.js
index cd8c190e978cd2..5cb0829437c2ed 100644
--- a/benchmark/path/dirname-win32.js
+++ b/benchmark/path/dirname-win32.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-posix.js b/benchmark/path/extname-posix.js
index 41a4a778834b51..61a1073158f8d3 100644
--- a/benchmark/path/extname-posix.js
+++ b/benchmark/path/extname-posix.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-win32.js b/benchmark/path/extname-win32.js
index fcc1af933749ed..67e53eab85817f 100644
--- a/benchmark/path/extname-win32.js
+++ b/benchmark/path/extname-win32.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-posix.js b/benchmark/path/format-posix.js
index 6dce6d3fae733a..b30b58be4118f0 100644
--- a/benchmark/path/format-posix.js
+++ b/benchmark/path/format-posix.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-win32.js b/benchmark/path/format-win32.js
index 598393b836b9fb..7404f2e93e6868 100644
--- a/benchmark/path/format-win32.js
+++ b/benchmark/path/format-win32.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-posix.js b/benchmark/path/isAbsolute-posix.js
index 4f8d89e654425d..fb8956c073b9db 100644
--- a/benchmark/path/isAbsolute-posix.js
+++ b/benchmark/path/isAbsolute-posix.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-win32.js b/benchmark/path/isAbsolute-win32.js
index c6771a0e7d7b1e..57fb8b8999e838 100644
--- a/benchmark/path/isAbsolute-win32.js
+++ b/benchmark/path/isAbsolute-win32.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-posix.js b/benchmark/path/join-posix.js
index 4b8bb924a2c006..1222f4050aa6ab 100644
--- a/benchmark/path/join-posix.js
+++ b/benchmark/path/join-posix.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-win32.js b/benchmark/path/join-win32.js
index 7309d1f91c773d..86801859d56c3b 100644
--- a/benchmark/path/join-win32.js
+++ b/benchmark/path/join-win32.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/makeLong-win32.js b/benchmark/path/makeLong-win32.js
index c0b0ac124ed2b0..d4b29d7e709b3e 100644
--- a/benchmark/path/makeLong-win32.js
+++ b/benchmark/path/makeLong-win32.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-posix.js b/benchmark/path/normalize-posix.js
index 87cf903b8c897b..19d6461ca51dcf 100644
--- a/benchmark/path/normalize-posix.js
+++ b/benchmark/path/normalize-posix.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-win32.js b/benchmark/path/normalize-win32.js
index 50f1e759f72f74..119f9797681113 100644
--- a/benchmark/path/normalize-win32.js
+++ b/benchmark/path/normalize-win32.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-posix.js b/benchmark/path/parse-posix.js
index 97d84e52754726..ee4306fcd27496 100644
--- a/benchmark/path/parse-posix.js
+++ b/benchmark/path/parse-posix.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-win32.js b/benchmark/path/parse-win32.js
index 7746a10b797a36..5a7b80f0ddb3da 100644
--- a/benchmark/path/parse-win32.js
+++ b/benchmark/path/parse-win32.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/relative-posix.js b/benchmark/path/relative-posix.js
index 59058babaf3e37..7544fb2dc67e7d 100644
--- a/benchmark/path/relative-posix.js
+++ b/benchmark/path/relative-posix.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/relative-win32.js b/benchmark/path/relative-win32.js
index f3eab74d268cb0..92531959c1c3aa 100644
--- a/benchmark/path/relative-win32.js
+++ b/benchmark/path/relative-win32.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-posix.js b/benchmark/path/resolve-posix.js
index 0f0554d6fe25c5..93e5b82191a23a 100644
--- a/benchmark/path/resolve-posix.js
+++ b/benchmark/path/resolve-posix.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-win32.js b/benchmark/path/resolve-win32.js
index 8a5502288f2996..dc0eb30e930049 100644
--- a/benchmark/path/resolve-win32.js
+++ b/benchmark/path/resolve-win32.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 6c912c0ac2e868..581fe7c2161242 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 a22c3ea644c0d1..5870a690555a0a 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 b3a83785e3792f..3288caecb6e6e8 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 442eba338ed643..2e1147cdf9b84a 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/tls/tls-connect.js b/benchmark/tls/tls-connect.js
index 96c9c5ab275f9d..0dd20e1fd2bd31 100644
--- a/benchmark/tls/tls-connect.js
+++ b/benchmark/tls/tls-connect.js
@@ -1,3 +1,4 @@
+'use strict';
 var assert = require('assert'),
     fs = require('fs'),
     path = require('path'),
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 8a59e6b48e54df..d8ba243faf867d 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');