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 47a7e62dc7..4f9010aabc 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 a6624205bf..0186394ad9 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 29a2d58b66..3b1b0ab821 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 76850c1231..0b318f281b 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 cb520be2a6..6817123391 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 6a7afe6921..c40c7897a2 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 b02e8a7403..c83bb67fa2 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 bc0c557118..6f4b2c9579 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 c575f54b6a..7ae2669490 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 77a0b59b8a..fb8abc1aee 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 92138bccef..e50de84b04 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 f632fa64ad..70cf3a705c 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 2a2a0e37e3..22383319d9 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 ce0064edb6..ab9c1d1d23 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 c0c7805a5c..6878d41d14 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 edb116d0c6..fb27d626b5 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 65e1713f0e..8d4eba54cd 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 4e81989317..df1ae8d696 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 a14aa22012..31b6706c02 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 2e987f03f5..2a17ce576c 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 1cd7a5e632..86d3de4600 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 fd4260417b..200e573294 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 cd9fe3cb7d..1d8f2a8bae 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 78a892d457..7416915db1 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 4c45bd9b71..87772222f0 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 8d536edd62..9fb060a6a1 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 32721b32e5..6ea838286c 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 68339bc3ec..05b400662c 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 b131d5b736..a251af526a 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 a181a2df60..6b6a392796 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 ac3241901b..0f39f64f57 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 9ff58389c7..a3eef67aa4 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 0589ff3166..9743bc1d6f 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 1c27dea2a2..befa3811dd 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 6391704ff7..9934883f7c 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 c17e2ffb45..d6b3ebe409 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 5bff9283cb..835fa3d52f 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 a8f99e2f0e..4d21415697 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 ca923d5b34..bc1825b22c 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 36800f2c9d..df0505b07a 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 f72cc01e60..9d165939af 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 9a886f2ee7..c2c792c5cb 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 da96b8ac65..704ed2e986 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 894dd55d30..c1a7474aae 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 36e9e90029..517ca924e9 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 fc8542a068..e2e01b17fa 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 e53bc4d801..17948604c7 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 6524081443..87d130f3a7 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 8a2c8e0a6a..bc513d338d 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 2b1b989e67..7c9e851aac 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 aa5b4420f6..f4577796b0 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 74dabd66c0..74dea02312 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 14563cee0d..e45016b559 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 23f571bb45..13b18fffc5 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 6c2799b6cb..78fe7b6c56 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 0eb95aa9e2..606170acb3 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 5f8e0fa435..4ca53716b7 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 49de7c77c9..bbfbd883f8 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 2a5ed8e483..d12a45fc9c 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 79e22494a7..4dc8462108 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 0039313f52..25efc78c0a 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 1504d11db5..e22437f422 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 502586c2a0..15f9578b77 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 d4ea072b57..64da901779 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 08938a2050..b8e2186612 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 037ac63670..e7ea80ffa3 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 cd8c190e97..5cb0829437 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 41a4a77883..61a1073158 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 fcc1af9337..67e53eab85 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 6dce6d3fae..b30b58be41 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 598393b836..7404f2e93e 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 4f8d89e654..fb8956c073 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 c6771a0e7d..57fb8b8999 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 4b8bb924a2..1222f4050a 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 7309d1f91c..86801859d5 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 c0b0ac124e..d4b29d7e70 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 87cf903b8c..19d6461ca5 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 50f1e759f7..119f979768 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 97d84e5275..ee4306fcd2 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 7746a10b79..5a7b80f0dd 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 59058babaf..7544fb2dc6 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 f3eab74d26..92531959c1 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 0f0554d6fe..93e5b82191 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 8a5502288f..dc0eb30e93 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 6c912c0ac2..581fe7c216 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 a22c3ea644..5870a69055 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 14e56231ec..6d796307f4 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 b3a83785e3..3288caecb6 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 442eba338e..2e1147cdf9 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 96c9c5ab27..0dd20e1fd2 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 ffa47c4ccd..89679548b8 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 5f6c1f7600..18f67e82e3 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 8a59e6b48e..d8ba243faf 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');