summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/http.js2
-rw-r--r--lib/string_decoder.js2
-rw-r--r--test/disabled/test-dns.js4
-rw-r--r--test/disabled/test-eio-race3.js4
-rw-r--r--test/disabled/test-fs-sendfile.js4
-rw-r--r--test/disabled/test-http-big-proxy-responses.js4
-rw-r--r--test/disabled/test-http-head-request.js4
-rw-r--r--test/disabled/test-http-stress.js4
-rw-r--r--test/disabled/test-http-tls.js4
-rw-r--r--test/disabled/test-idle-watcher.js4
-rw-r--r--test/disabled/test-net-tls-pummel.js4
-rw-r--r--test/disabled/test-net-tls.js4
-rw-r--r--test/disabled/test-readline.js4
-rw-r--r--test/disabled/test-remote-module-loading.js4
-rw-r--r--test/disabled/test-setuidgid.js4
-rw-r--r--test/disabled/tls_client.js4
-rw-r--r--test/disabled/tls_server.js4
-rw-r--r--test/fixtures/a.js2
-rw-r--r--test/fixtures/b/c.js2
-rw-r--r--test/fixtures/b/d.js2
-rw-r--r--test/fixtures/b/package/index.js2
-rw-r--r--test/fixtures/echo.js4
-rw-r--r--test/fixtures/print-chars-from-buffer.js4
-rw-r--r--test/fixtures/print-chars.js4
-rw-r--r--test/pummel/test-child-process-spawn-loop.js4
-rw-r--r--test/pummel/test-http-client-reconnect-bug.js4
-rw-r--r--test/pummel/test-keep-alive.js4
-rw-r--r--test/pummel/test-net-many-clients.js4
-rw-r--r--test/pummel/test-net-pingpong-delay.js4
-rw-r--r--test/pummel/test-net-pingpong.js4
-rw-r--r--test/pummel/test-net-throttle.js4
-rw-r--r--test/pummel/test-net-timeout.js4
-rw-r--r--test/pummel/test-timers.js4
-rw-r--r--test/pummel/test-watch-file.js4
-rw-r--r--test/simple/test-assert.js7
-rw-r--r--test/simple/test-c-ares.js4
-rw-r--r--test/simple/test-chdir.js4
-rw-r--r--test/simple/test-child-process-buffering.js4
-rw-r--r--test/simple/test-child-process-custom-fds.js4
-rw-r--r--test/simple/test-child-process-cwd.js8
-rw-r--r--test/simple/test-child-process-deprecated-api.js2
-rw-r--r--test/simple/test-child-process-env.js8
-rw-r--r--test/simple/test-child-process-exec-cwd.js4
-rw-r--r--test/simple/test-child-process-exec-env.js12
-rw-r--r--test/simple/test-child-process-exit-code.js18
-rw-r--r--test/simple/test-child-process-ipc.js4
-rw-r--r--test/simple/test-child-process-kill.js4
-rw-r--r--test/simple/test-child-process-stdin.js4
-rw-r--r--test/simple/test-child-process-stdout-flush.js6
-rw-r--r--test/simple/test-console.js4
-rw-r--r--test/simple/test-crypto.js6
-rw-r--r--test/simple/test-delayed-require.js5
-rw-r--r--test/simple/test-dgram-multicast.js6
-rw-r--r--test/simple/test-dgram-pingpong.js4
-rw-r--r--test/simple/test-dgram-udp4.js4
-rw-r--r--test/simple/test-dgram-unix-anon.js4
-rw-r--r--test/simple/test-dgram-unix.js20
-rw-r--r--test/simple/test-eio-race.js4
-rw-r--r--test/simple/test-eio-race2.js6
-rw-r--r--test/simple/test-eio-race4.js4
-rw-r--r--test/simple/test-error-reporting.js10
-rw-r--r--test/simple/test-event-emitter-add-listeners.js4
-rw-r--r--test/simple/test-event-emitter-modify-in-emit.js4
-rw-r--r--test/simple/test-event-emitter-num-args.js4
-rw-r--r--test/simple/test-event-emitter-once.js4
-rw-r--r--test/simple/test-event-emitter-remove-listeners.js12
-rw-r--r--test/simple/test-exception-handler.js4
-rw-r--r--test/simple/test-exception-handler2.js4
-rw-r--r--test/simple/test-exec.js8
-rw-r--r--test/simple/test-executable-path.js12
-rw-r--r--test/simple/test-file-read-noexist.js4
-rw-r--r--test/simple/test-file-write-stream.js4
-rw-r--r--test/simple/test-fs-chmod.js4
-rw-r--r--test/simple/test-fs-error-messages.js4
-rw-r--r--test/simple/test-fs-fsync.js4
-rw-r--r--test/simple/test-fs-read-buffer.js4
-rw-r--r--test/simple/test-fs-read-file-sync-hostname.js4
-rw-r--r--test/simple/test-fs-read-file-sync.js10
-rw-r--r--test/simple/test-fs-read-stream.js19
-rw-r--r--test/simple/test-fs-read.js4
-rw-r--r--test/simple/test-fs-readfile-empty.js4
-rw-r--r--test/simple/test-fs-realpath.js4
-rw-r--r--test/simple/test-fs-stat.js4
-rw-r--r--test/simple/test-fs-symlink.js2
-rw-r--r--test/simple/test-fs-write-buffer.js4
-rw-r--r--test/simple/test-fs-write-file.js20
-rw-r--r--test/simple/test-fs-write-stream.js4
-rw-r--r--test/simple/test-fs-write-sync.js17
-rw-r--r--test/simple/test-global.js4
-rw-r--r--test/simple/test-http-1.0.js8
-rw-r--r--test/simple/test-http-304.js10
-rw-r--r--test/simple/test-http-blank-header.js13
-rw-r--r--test/simple/test-http-buffer-sanity.js3
-rw-r--r--test/simple/test-http-cat.js6
-rw-r--r--test/simple/test-http-chunked.js6
-rw-r--r--test/simple/test-http-client-race-2.js8
-rw-r--r--test/simple/test-http-client-race.js8
-rw-r--r--test/simple/test-http-client-upload.js6
-rw-r--r--test/simple/test-http-eof-on-connect.js8
-rw-r--r--test/simple/test-http-exceptions.js6
-rw-r--r--test/simple/test-http-full-response.js20
-rw-r--r--test/simple/test-http-head-request.js14
-rw-r--r--test/simple/test-http-head-response-has-no-body.js4
-rw-r--r--test/simple/test-http-keep-alive-close-on-header.js8
-rw-r--r--test/simple/test-http-keep-alive.js8
-rw-r--r--test/simple/test-http-malformed-request.js14
-rw-r--r--test/simple/test-http-parser.js4
-rw-r--r--test/simple/test-http-proxy.js10
-rw-r--r--test/simple/test-http-server-multiheaders.js4
-rw-r--r--test/simple/test-http-server.js8
-rw-r--r--test/simple/test-http-set-cookies.js8
-rw-r--r--test/simple/test-http-set-timeout.js10
-rw-r--r--test/simple/test-http-set-trailers.js10
-rw-r--r--test/simple/test-http-upgrade-client.js4
-rw-r--r--test/simple/test-http-upgrade-client2.js9
-rw-r--r--test/simple/test-http-upgrade-server.js4
-rw-r--r--test/simple/test-http-upgrade-server2.js8
-rw-r--r--test/simple/test-http-wget.js8
-rw-r--r--test/simple/test-http-write-empty-string.js6
-rw-r--r--test/simple/test-http.js6
-rw-r--r--test/simple/test-listen-fd.js6
-rw-r--r--test/simple/test-memory-usage.js4
-rw-r--r--test/simple/test-mkdir-rmdir.js4
-rw-r--r--test/simple/test-module-loading.js4
-rw-r--r--test/simple/test-net-binary.js6
-rw-r--r--test/simple/test-net-eaddrinuse.js6
-rw-r--r--test/simple/test-net-isip.js6
-rw-r--r--test/simple/test-net-keepalive.js8
-rw-r--r--test/simple/test-net-pingpong.js6
-rw-r--r--test/simple/test-net-reconnect.js6
-rw-r--r--test/simple/test-net-server-max-connections.js6
-rw-r--r--test/simple/test-next-tick-errors.js4
-rw-r--r--test/simple/test-next-tick-ordering.js4
-rw-r--r--test/simple/test-next-tick-ordering2.js4
-rw-r--r--test/simple/test-next-tick.js4
-rw-r--r--test/simple/test-path.js4
-rw-r--r--test/simple/test-pipe-head.js4
-rw-r--r--test/simple/test-pump-file2tcp-noexist.js12
-rw-r--r--test/simple/test-pump-file2tcp.js12
-rw-r--r--test/simple/test-querystring.js4
-rw-r--r--test/simple/test-readdir.js4
-rw-r--r--test/simple/test-repl.js4
-rw-r--r--test/simple/test-script-context.js4
-rw-r--r--test/simple/test-script-new.js4
-rw-r--r--test/simple/test-script-static-context.js4
-rw-r--r--test/simple/test-script-static-new.js4
-rw-r--r--test/simple/test-script-static-this.js4
-rw-r--r--test/simple/test-script-this.js4
-rw-r--r--test/simple/test-sendfd.js4
-rw-r--r--test/simple/test-signal-handler.js4
-rw-r--r--test/simple/test-signal-unregister.js4
-rw-r--r--test/simple/test-stdin-from-file.js6
-rw-r--r--test/simple/test-stdout-to-file.js8
-rw-r--r--test/simple/test-string-decoder.js4
-rw-r--r--test/simple/test-sync-fileread.js4
-rw-r--r--test/simple/test-sys.js4
-rw-r--r--test/simple/test-umask.js4
-rw-r--r--test/simple/test-url.js4
-rw-r--r--test/simple/test-utf8-scripts.js4
159 files changed, 461 insertions, 458 deletions
diff --git a/lib/http.js b/lib/http.js
index 7df210a7b..0b4a0e221 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -426,6 +426,7 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
if (headers) {
var keys = Object.keys(headers);
var isArray = (Array.isArray(headers));
+ var field, value;
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
@@ -526,6 +527,7 @@ OutgoingMessage.prototype.addTrailers = function(headers) {
this._trailer = '';
var keys = Object.keys(headers);
var isArray = (Array.isArray(headers));
+ var field, value;
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
if (isArray) {
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index 3ed283904..00a1bcb49 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -49,7 +49,7 @@ StringDecoder.prototype.write = function(buffer) {
// Figure out if one of the last i bytes of our buffer announces an
// incomplete char.
for (; i > 0; i--) {
- c = buffer[buffer.length - i];
+ var c = buffer[buffer.length - i];
// See http://en.wikipedia.org/wiki/UTF-8#Description
diff --git a/test/disabled/test-dns.js b/test/disabled/test-dns.js
index 1599a17db..f469aed0f 100644
--- a/test/disabled/test-dns.js
+++ b/test/disabled/test-dns.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var dns = require("dns"),
child_process = require("child_process");
diff --git a/test/disabled/test-eio-race3.js b/test/disabled/test-eio-race3.js
index 458c3dacd..11ad5afde 100644
--- a/test/disabled/test-eio-race3.js
+++ b/test/disabled/test-eio-race3.js
@@ -1,7 +1,7 @@
/* XXX Can this test be modified to not call the now-removed wait()? */
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
console.log('first stat ...');
diff --git a/test/disabled/test-fs-sendfile.js b/test/disabled/test-fs-sendfile.js
index 3aa218ca7..9f280aa1f 100644
--- a/test/disabled/test-fs-sendfile.js
+++ b/test/disabled/test-fs-sendfile.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
tcp = require("tcp");
util = require("util");
diff --git a/test/disabled/test-http-big-proxy-responses.js b/test/disabled/test-http-big-proxy-responses.js
index 31d4a19f7..dfbe3df80 100644
--- a/test/disabled/test-http-big-proxy-responses.js
+++ b/test/disabled/test-http-big-proxy-responses.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var util = require("util"),
fs = require("fs"),
http = require("http"),
diff --git a/test/disabled/test-http-head-request.js b/test/disabled/test-http-head-request.js
index 492764756..57fe37124 100644
--- a/test/disabled/test-http-head-request.js
+++ b/test/disabled/test-http-head-request.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var assert = require("assert");
var http = require("http");
diff --git a/test/disabled/test-http-stress.js b/test/disabled/test-http-stress.js
index d8778d8a9..0b86a3f4d 100644
--- a/test/disabled/test-http-stress.js
+++ b/test/disabled/test-http-stress.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
http = require("http");
diff --git a/test/disabled/test-http-tls.js b/test/disabled/test-http-tls.js
index 4c0ebe18e..b222b0003 100644
--- a/test/disabled/test-http-tls.js
+++ b/test/disabled/test-http-tls.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
net = require("net");
http = require("http");
url = require("url");
diff --git a/test/disabled/test-idle-watcher.js b/test/disabled/test-idle-watcher.js
index 274d27acb..6273bd408 100644
--- a/test/disabled/test-idle-watcher.js
+++ b/test/disabled/test-idle-watcher.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var complete = false;
var idle = new process.IdleWatcher();
diff --git a/test/disabled/test-net-tls-pummel.js b/test/disabled/test-net-tls-pummel.js
index fb05c33d5..e8f05d447 100644
--- a/test/disabled/test-net-tls-pummel.js
+++ b/test/disabled/test-net-tls-pummel.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
net = require("net");
fs=require("fs");
diff --git a/test/disabled/test-net-tls.js b/test/disabled/test-net-tls.js
index ce9f98736..c40adfd3d 100644
--- a/test/disabled/test-net-tls.js
+++ b/test/disabled/test-net-tls.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
var net = require('net');
diff --git a/test/disabled/test-readline.js b/test/disabled/test-readline.js
index 1ed935e84..23b4595b3 100644
--- a/test/disabled/test-readline.js
+++ b/test/disabled/test-readline.js
@@ -1,7 +1,7 @@
// Can't test this when 'make test' doesn't assign a tty to the stdout.
// Yet another use-case for require('tty').spawn ?
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var readline = require("readline");
var key = {
diff --git a/test/disabled/test-remote-module-loading.js b/test/disabled/test-remote-module-loading.js
index e207f4e5b..073e487bf 100644
--- a/test/disabled/test-remote-module-loading.js
+++ b/test/disabled/test-remote-module-loading.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var http = require('http');
var util = require('util');
diff --git a/test/disabled/test-setuidgid.js b/test/disabled/test-setuidgid.js
index 1f505cd8f..54cb20285 100644
--- a/test/disabled/test-setuidgid.js
+++ b/test/disabled/test-setuidgid.js
@@ -1,6 +1,6 @@
// Requires special privlages
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var assert = require('assert');
var oldgid = process.getgid();
diff --git a/test/disabled/tls_client.js b/test/disabled/tls_client.js
index e2a36aea1..903999dfd 100644
--- a/test/disabled/tls_client.js
+++ b/test/disabled/tls_client.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var util=require('util');
var net=require('net');
var fs=require('fs');
diff --git a/test/disabled/tls_server.js b/test/disabled/tls_server.js
index 37f06561d..0dc5e7f66 100644
--- a/test/disabled/tls_server.js
+++ b/test/disabled/tls_server.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var util=require('util');
var net=require('net');
diff --git a/test/fixtures/a.js b/test/fixtures/a.js
index 672da8089..ebbfe0352 100644
--- a/test/fixtures/a.js
+++ b/test/fixtures/a.js
@@ -1,6 +1,6 @@
var c = require('./b/c');
-common.debug('load fixtures/a.js');
+console.error('load fixtures/a.js');
var string = 'A';
diff --git a/test/fixtures/b/c.js b/test/fixtures/b/c.js
index cb4bb5528..8eec4704a 100644
--- a/test/fixtures/b/c.js
+++ b/test/fixtures/b/c.js
@@ -6,7 +6,7 @@ var package = require('./package');
assert.equal('world', package.hello);
-common.debug('load fixtures/b/c.js');
+console.error('load fixtures/b/c.js');
var string = 'C';
diff --git a/test/fixtures/b/d.js b/test/fixtures/b/d.js
index 55c812b7f..77dbb8be9 100644
--- a/test/fixtures/b/d.js
+++ b/test/fixtures/b/d.js
@@ -1,4 +1,4 @@
-common.debug('load fixtures/b/d.js');
+console.error('load fixtures/b/d.js');
var string = 'D';
diff --git a/test/fixtures/b/package/index.js b/test/fixtures/b/package/index.js
index c69024b7e..cbf16fdc2 100644
--- a/test/fixtures/b/package/index.js
+++ b/test/fixtures/b/package/index.js
@@ -1,2 +1,2 @@
exports.hello = 'world';
-common.debug('load package/index.js');
+console.error('load package/index.js');
diff --git a/test/fixtures/echo.js b/test/fixtures/echo.js
index 3aba96b8a..748b83bf2 100644
--- a/test/fixtures/echo.js
+++ b/test/fixtures/echo.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
common.print('hello world\r\n');
diff --git a/test/fixtures/print-chars-from-buffer.js b/test/fixtures/print-chars-from-buffer.js
index 9409c1dd8..9f15b15e4 100644
--- a/test/fixtures/print-chars-from-buffer.js
+++ b/test/fixtures/print-chars-from-buffer.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
Buffer = require('buffer').Buffer;
var n = parseInt(process.argv[2]);
diff --git a/test/fixtures/print-chars.js b/test/fixtures/print-chars.js
index 25a4f0632..ec9760492 100644
--- a/test/fixtures/print-chars.js
+++ b/test/fixtures/print-chars.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
var n = parseInt(process.argv[2]);
diff --git a/test/pummel/test-child-process-spawn-loop.js b/test/pummel/test-child-process-spawn-loop.js
index bd81341bd..b36a13208 100644
--- a/test/pummel/test-child-process-spawn-loop.js
+++ b/test/pummel/test-child-process-spawn-loop.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var spawn = require('child_process').spawn;
diff --git a/test/pummel/test-http-client-reconnect-bug.js b/test/pummel/test-http-client-reconnect-bug.js
index 3a5de31ca..a85e1e93b 100644
--- a/test/pummel/test-http-client-reconnect-bug.js
+++ b/test/pummel/test-http-client-reconnect-bug.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var net = require('net'),
util = require('util'),
diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js
index d75ac9bd5..178fc8736 100644
--- a/test/pummel/test-keep-alive.js
+++ b/test/pummel/test-keep-alive.js
@@ -1,6 +1,6 @@
// This test requires the program 'ab'
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
http = require('http');
exec = require('child_process').exec;
diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js
index e38909982..ab42762f7 100644
--- a/test/pummel/test-net-many-clients.js
+++ b/test/pummel/test-net-many-clients.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
net = require('net');
// settings
var bytes = 1024 * 40;
diff --git a/test/pummel/test-net-pingpong-delay.js b/test/pummel/test-net-pingpong-delay.js
index 41c69227c..cac841838 100644
--- a/test/pummel/test-net-pingpong-delay.js
+++ b/test/pummel/test-net-pingpong-delay.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
net = require('net');
diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js
index 4546470f5..d6b828ab6 100644
--- a/test/pummel/test-net-pingpong.js
+++ b/test/pummel/test-net-pingpong.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
net = require('net');
var tests_run = 0;
diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js
index 66f74f087..11799cb7a 100644
--- a/test/pummel/test-net-throttle.js
+++ b/test/pummel/test-net-throttle.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
net = require('net');
N = 160 * 1024; // 30kb
diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js
index d571acd4c..0b58256b3 100644
--- a/test/pummel/test-net-timeout.js
+++ b/test/pummel/test-net-timeout.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
net = require('net');
exchanges = 0;
starttime = null;
diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js
index e25f5844e..0afe5a609 100644
--- a/test/pummel/test-timers.js
+++ b/test/pummel/test-timers.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
assert = require('assert');
diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js
index f949c1371..f38e660e0 100644
--- a/test/pummel/test-watch-file.js
+++ b/test/pummel/test-watch-file.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
var path = require('path');
diff --git a/test/simple/test-assert.js b/test/simple/test-assert.js
index 906d96a01..73d354497 100644
--- a/test/simple/test-assert.js
+++ b/test/simple/test-assert.js
@@ -1,6 +1,5 @@
-common = require("../common");
-assert = common.assert
-
+var common = require("../common");
+var assert = require('assert');
var a = require('assert');
function makeBlock (f) {
@@ -115,7 +114,7 @@ assert.throws(makeBlock(a.deepEqual, 'a', {}), a.AssertionError);
function thrower (errorConstructor){
throw new errorConstructor('test');
}
-aethrow = makeBlock(thrower, a.AssertionError);
+var aethrow = makeBlock(thrower, a.AssertionError);
aethrow = makeBlock(thrower, a.AssertionError);
// the basic calls work
diff --git a/test/simple/test-c-ares.js b/test/simple/test-c-ares.js
index 234cf1380..6daa33351 100644
--- a/test/simple/test-c-ares.js
+++ b/test/simple/test-c-ares.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var dns = require("dns");
diff --git a/test/simple/test-chdir.js b/test/simple/test-chdir.js
index c4ece6a3b..8d699369f 100644
--- a/test/simple/test-chdir.js
+++ b/test/simple/test-chdir.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
assert.equal(true, process.cwd() !== __dirname);
diff --git a/test/simple/test-child-process-buffering.js b/test/simple/test-child-process-buffering.js
index ef9259e5c..ae5c837ba 100644
--- a/test/simple/test-child-process-buffering.js
+++ b/test/simple/test-child-process-buffering.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var spawn = require('child_process').spawn;
diff --git a/test/simple/test-child-process-custom-fds.js b/test/simple/test-child-process-custom-fds.js
index 135ac0299..21b757954 100644
--- a/test/simple/test-child-process-custom-fds.js
+++ b/test/simple/test-child-process-custom-fds.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require("../common");
+var assert = require('assert');
var assert = require('assert');
var spawn = require('child_process').spawn;
diff --git a/test/simple/test-child-process-cwd.js b/test/simple/test-child-process-cwd.js
index 08252aac5..f0ec7aab1 100644
--- a/test/simple/test-child-process-cwd.js
+++ b/test/simple/test-child-process-cwd.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-spawn = require('child_process').spawn,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+var path = require('path');
var returns = 0;
diff --git a/test/simple/test-child-process-deprecated-api.js b/test/simple/test-child-process-deprecated-api.js
index 9cbffefd5..bebd51a69 100644
--- a/test/simple/test-child-process-deprecated-api.js
+++ b/test/simple/test-child-process-deprecated-api.js
@@ -56,4 +56,4 @@ var exits = 0;
// Check if all child processes exited
process.addListener('exit', function () {
assert.equal(2, exits);
-}); \ No newline at end of file
+});
diff --git a/test/simple/test-child-process-env.js b/test/simple/test-child-process-env.js
index c5fb0ef10..33bc42729 100644
--- a/test/simple/test-child-process-env.js
+++ b/test/simple/test-child-process-env.js
@@ -1,10 +1,10 @@
-common = require("../common");
-assert = common.assert
+var common = require("../common");
+var assert = require('assert');
var spawn = require('child_process').spawn;
-child = spawn('/usr/bin/env', [], {env: {'HELLO' : 'WORLD'}});
+var child = spawn('/usr/bin/env', [], {env: {'HELLO' : 'WORLD'}});
-response = "";
+var response = "";
child.stdout.setEncoding('utf8');
diff --git a/test/simple/test-child-process-exec-cwd.js b/test/simple/test-child-process-exec-cwd.js
index 20d73b2e3..79677f1c9 100644
--- a/test/simple/test-child-process-exec-cwd.js
+++ b/test/simple/test-child-process-exec-cwd.js
@@ -5,7 +5,7 @@ var exec = require('child_process').exec;
var success_count = 0;
var error_count = 0;
-child = exec('pwd', {cwd: "/dev"}, function (err, stdout, stderr) {
+var child = exec('pwd', {cwd: "/dev"}, function (err, stdout, stderr) {
if (err) {
error_count++;
console.log('error!: ' + err.code);
@@ -21,4 +21,4 @@ child = exec('pwd', {cwd: "/dev"}, function (err, stdout, stderr) {
process.addListener('exit', function () {
assert.equal(1, success_count);
assert.equal(0, error_count);
-}); \ No newline at end of file
+});
diff --git a/test/simple/test-child-process-exec-env.js b/test/simple/test-child-process-exec-env.js
index 4da856326..f781b9b70 100644
--- a/test/simple/test-child-process-exec-env.js
+++ b/test/simple/test-child-process-exec-env.js
@@ -1,11 +1,11 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var exec = require('child_process').exec;
-success_count = 0;
-error_count = 0;
-response = "";
+var success_count = 0;
+var error_count = 0;
+var response = "";
-child = exec('/usr/bin/env', { env: {'HELLO' : 'WORLD'}}, function (err, stdout, stderr) {
+var child = exec('/usr/bin/env', { env: {'HELLO' : 'WORLD'}}, function (err, stdout, stderr) {
if (err) {
error_count++;
console.log('error!: ' + err.code);
diff --git a/test/simple/test-child-process-exit-code.js b/test/simple/test-child-process-exit-code.js
index f81437141..e9198608d 100644
--- a/test/simple/test-child-process-exit-code.js
+++ b/test/simple/test-child-process-exit-code.js
@@ -1,12 +1,12 @@
-common = require("../common");
-assert = common.assert
-spawn = require('child_process').spawn,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+var path = require('path');
-exits = 0;
+var exits = 0;
-exitScript = path.join(common.fixturesDir, 'exit.js')
-exitChild = spawn(process.argv[0], [exitScript, 23]);
+var exitScript = path.join(common.fixturesDir, 'exit.js')
+var exitChild = spawn(process.argv[0], [exitScript, 23]);
exitChild.addListener('exit', function(code, signal) {
assert.strictEqual(code, 23);
assert.strictEqual(signal, null);
@@ -16,8 +16,8 @@ exitChild.addListener('exit', function(code, signal) {
-errorScript = path.join(common.fixturesDir, 'child_process_should_emit_error.js')
-errorChild = spawn(process.argv[0], [errorScript]);
+var errorScript = path.join(common.fixturesDir, 'child_process_should_emit_error.js')
+var errorChild = spawn(process.argv[0], [errorScript]);
errorChild.addListener('exit', function(code, signal) {
assert.ok(code !== 0);
assert.strictEqual(signal, null);
diff --git a/test/simple/test-child-process-ipc.js b/test/simple/test-child-process-ipc.js
index b3eac8166..ca3344f9a 100644
--- a/test/simple/test-child-process-ipc.js
+++ b/test/simple/test-child-process-ipc.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var spawn = require('child_process').spawn;
diff --git a/test/simple/test-child-process-kill.js b/test/simple/test-child-process-kill.js
index eef723a93..19921bcb1 100644
--- a/test/simple/test-child-process-kill.js
+++ b/test/simple/test-child-process-kill.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var spawn = require('child_process').spawn;
diff --git a/test/simple/test-child-process-stdin.js b/test/simple/test-child-process-stdin.js
index c3b93c489..5707abb50 100644
--- a/test/simple/test-child-process-stdin.js
+++ b/test/simple/test-child-process-stdin.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var spawn = require('child_process').spawn;
diff --git a/test/simple/test-child-process-stdout-flush.js b/test/simple/test-child-process-stdout-flush.js
index dd35e9a60..acc67523f 100644
--- a/test/simple/test-child-process-stdout-flush.js
+++ b/test/simple/test-child-process-stdout-flush.js
@@ -1,10 +1,10 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var spawn = require('child_process').spawn;
var sub = path.join(common.fixturesDir, 'print-chars.js');
-n = 500000;
+var n = 500000;
var child = spawn(process.argv[0], [sub, n]);
diff --git a/test/simple/test-console.js b/test/simple/test-console.js
index 8e25f2877..a77772dc7 100644
--- a/test/simple/test-console.js
+++ b/test/simple/test-console.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var stdout_write = global.process.stdout.write;
var strings = [];
diff --git a/test/simple/test-crypto.js b/test/simple/test-crypto.js
index 012c1a613..a245175dd 100644
--- a/test/simple/test-crypto.js
+++ b/test/simple/test-crypto.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
try {
var crypto = require('crypto');
@@ -45,7 +45,7 @@ var h2 = crypto.createHash("sha1").update("Test").update("123").digest("hex");
assert.equal(h1, h2, "multipled updates");
// Test hashing for binary files
-fn = path.join(common.fixturesDir, 'sample.png');
+var fn = path.join(common.fixturesDir, 'sample.png');
var sha1Hash = crypto.createHash('sha1');
var fileStream = fs.createReadStream(fn);
fileStream.addListener('data', function(data){
diff --git a/test/simple/test-delayed-require.js b/test/simple/test-delayed-require.js
index f44aa9910..125e9dd00 100644
--- a/test/simple/test-delayed-require.js
+++ b/test/simple/test-delayed-require.js
@@ -1,6 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var a;
setTimeout(function () {
a = require("../fixtures/a");
}, 50);
diff --git a/test/simple/test-dgram-multicast.js b/test/simple/test-dgram-multicast.js
index a493c0d0e..7edcd0848 100644
--- a/test/simple/test-dgram-multicast.js
+++ b/test/simple/test-dgram-multicast.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var dgram = require("dgram"),
util = require('util'),
@@ -41,7 +41,7 @@ sendSocket.sendNext = function () {
});
};
-listener_count = 0;
+var listener_count = 0;
function mkListener() {
var receivedMessages = [];
diff --git a/test/simple/test-dgram-pingpong.js b/test/simple/test-dgram-pingpong.js
index 10652372c..c5317bf86 100644
--- a/test/simple/test-dgram-pingpong.js
+++ b/test/simple/test-dgram-pingpong.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Buffer = require('buffer').Buffer;
var dgram = require("dgram");
diff --git a/test/simple/test-dgram-udp4.js b/test/simple/test-dgram-udp4.js
index 755d629aa..2d5ac4c47 100644
--- a/test/simple/test-dgram-udp4.js
+++ b/test/simple/test-dgram-udp4.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Buffer = require("buffer").Buffer,
fs = require("fs"),
diff --git a/test/simple/test-dgram-unix-anon.js b/test/simple/test-dgram-unix-anon.js
index 1068261dc..12582ef7b 100644
--- a/test/simple/test-dgram-unix-anon.js
+++ b/test/simple/test-dgram-unix-anon.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Buffer = require("buffer").Buffer,
fs = require("fs"),
diff --git a/test/simple/test-dgram-unix.js b/test/simple/test-dgram-unix.js
index 0465a3a75..327da5e1f 100644
--- a/test/simple/test-dgram-unix.js
+++ b/test/simple/test-dgram-unix.js
@@ -1,14 +1,16 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
-fs = require("fs");
-dgram = require("dgram");
+var fs = require("fs");
+var dgram = require("dgram");
-serverPath = "/tmp/dgram_server_sock";
-clientPath = "/tmp/dgram_client_sock";
-msgToSend = new Buffer("A message to send");
+// TODO use common.tmpDir here
+var serverPath = "/tmp/dgram_server_sock";
+var clientPath = "/tmp/dgram_client_sock";
-server = dgram.createSocket("unix_dgram");
+var msgToSend = new Buffer("A message to send");
+
+var server = dgram.createSocket("unix_dgram");
server.on("message", function (msg, rinfo) {
console.log("server got: " + msg + " from " + rinfo.address);
assert.strictEqual(rinfo.address, clientPath);
@@ -19,7 +21,7 @@ server.on("message", function (msg, rinfo) {
server.on("listening", function () {
console.log("server is listening");
- client = dgram.createSocket("unix_dgram");
+ var client = dgram.createSocket("unix_dgram");
client.on("message", function (msg, rinfo) {
console.log("client got: " + msg + " from " + rinfo.address);
diff --git a/test/simple/test-eio-race.js b/test/simple/test-eio-race.js
index d21b03593..c87fa2df5 100644
--- a/test/simple/test-eio-race.js
+++ b/test/simple/test-eio-race.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var count = 100;
var fs = require('fs');
diff --git a/test/simple/test-eio-race2.js b/test/simple/test-eio-race2.js
index 3d2277819..0d8424e24 100644
--- a/test/simple/test-eio-race2.js
+++ b/test/simple/test-eio-race2.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var testTxt = path.join(common.fixturesDir, "x.txt");
var fs = require('fs');
@@ -7,7 +7,7 @@ var fs = require('fs');
setTimeout(function () {
// put this in a timeout, just so it doesn't get bunched up with the
// require() calls..
- N = 30;
+ var N = 30;
for (var i=0; i < N; i++) {
console.log("start " + i);
fs.readFile(testTxt, function(err, data) {
diff --git a/test/simple/test-eio-race4.js b/test/simple/test-eio-race4.js
index 4f322b235..23e2d67b0 100644
--- a/test/simple/test-eio-race4.js
+++ b/test/simple/test-eio-race4.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
var N = 100;
var j = 0;
diff --git a/test/simple/test-error-reporting.js b/test/simple/test-error-reporting.js
index e65ad7c38..af1e1a36e 100644
--- a/test/simple/test-error-reporting.js
+++ b/test/simple/test-error-reporting.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
-exec = require('child_process').exec,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var exec = require('child_process').exec;
+var path = require('path');
-exits = 0;
+var exits = 0;
function errExec (script, callback) {
var cmd = process.argv[0] + ' ' + path.join(common.fixturesDir, script);
diff --git a/test/simple/test-event-emitter-add-listeners.js b/test/simple/test-event-emitter-add-listeners.js
index 30aba8d45..fa067a430 100644
--- a/test/simple/test-event-emitter-add-listeners.js
+++ b/test/simple/test-event-emitter-add-listeners.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var events = require('events');
var e = new events.EventEmitter();
diff --git a/test/simple/test-event-emitter-modify-in-emit.js b/test/simple/test-event-emitter-modify-in-emit.js
index 161e8c3c7..38b74a42c 100644
--- a/test/simple/test-event-emitter-modify-in-emit.js
+++ b/test/simple/test-event-emitter-modify-in-emit.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var events = require('events');
var callbacks_called = [ ];
diff --git a/test/simple/test-event-emitter-num-args.js b/test/simple/test-event-emitter-num-args.js
index 93a5149cc..a31095c91 100644
--- a/test/simple/test-event-emitter-num-args.js
+++ b/test/simple/test-event-emitter-num-args.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var events = require('events');
var e = new events.EventEmitter(),
diff --git a/test/simple/test-event-emitter-once.js b/test/simple/test-event-emitter-once.js
index 863923128..b53bc114d 100644
--- a/test/simple/test-event-emitter-once.js
+++ b/test/simple/test-event-emitter-once.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var events = require('events');
var e = new events.EventEmitter();
diff --git a/test/simple/test-event-emitter-remove-listeners.js b/test/simple/test-event-emitter-remove-listeners.js
index da8628eeb..d46061c1e 100644
--- a/test/simple/test-event-emitter-remove-listeners.js
+++ b/test/simple/test-event-emitter-remove-listeners.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var events = require('events');
-count = 0;
+var count = 0;
function listener1 () {
console.log('listener1');
@@ -20,17 +20,17 @@ function listener3 () {
count++;
}
-e1 = new events.EventEmitter();
+var e1 = new events.EventEmitter();
e1.addListener("hello", listener1);
e1.removeListener("hello", listener1);
assert.deepEqual([], e1.listeners('hello'));
-e2 = new events.EventEmitter();
+var e2 = new events.EventEmitter();
e2.addListener("hello", listener1);
e2.removeListener("hello", listener2);
assert.deepEqual([listener1], e2.listeners('hello'));
-e3 = new events.EventEmitter();
+var e3 = new events.EventEmitter();
e3.addListener("hello", listener1);
e3.addListener("hello", listener2);
e3.removeListener("hello", listener1);
diff --git a/test/simple/test-exception-handler.js b/test/simple/test-exception-handler.js
index f1227e80a..880514c66 100644
--- a/test/simple/test-exception-handler.js
+++ b/test/simple/test-exception-handler.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var MESSAGE = 'catch me if you can';
var caughtException = false;
diff --git a/test/simple/test-exception-handler2.js b/test/simple/test-exception-handler2.js
index 868862a12..96fc3da65 100644
--- a/test/simple/test-exception-handler2.js
+++ b/test/simple/test-exception-handler2.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
diff --git a/test/simple/test-exec.js b/test/simple/test-exec.js
index f4f3cf873..860eda1cb 100644
--- a/test/simple/test-exec.js
+++ b/test/simple/test-exec.js
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var exec = require('child_process').exec;
-success_count = 0;
-error_count = 0;
+var success_count = 0;
+var error_count = 0;
exec("ls /", function (err, stdout, stderr) {
if (err) {
diff --git a/test/simple/test-executable-path.js b/test/simple/test-executable-path.js
index 6ba09f4d2..b251fbb09 100644
--- a/test/simple/test-executable-path.js
+++ b/test/simple/test-executable-path.js
@@ -1,11 +1,11 @@
-common = require("../common");
-assert = common.assert;
-path = require("path");
+var common = require('../common');
+var assert = require('assert');;
+var path = require("path");
-isDebug = (process.version.indexOf('debug') >= 0);
+var isDebug = (process.version.indexOf('debug') >= 0);
-debugPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'debug', 'node_g'));
-defaultPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'default', 'node'));
+var debugPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'debug', 'node_g'));
+var defaultPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'default', 'node'));
console.log('debugPath: ' + debugPath);
console.log('defaultPath: ' + defaultPath);
diff --git a/test/simple/test-file-read-noexist.js b/test/simple/test-file-read-noexist.js
index 63f049cb3..216d6734d 100644
--- a/test/simple/test-file-read-noexist.js
+++ b/test/simple/test-file-read-noexist.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var fs = require('fs');
var got_error = false;
diff --git a/test/simple/test-file-write-stream.js b/test/simple/test-file-write-stream.js
index 69449bce7..651eac906 100644
--- a/test/simple/test-file-write-stream.js
+++ b/test/simple/test-file-write-stream.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var
path = require('path'),
diff --git a/test/simple/test-fs-chmod.js b/test/simple/test-fs-chmod.js
index fc870a08a..1225dcc38 100644
--- a/test/simple/test-fs-chmod.js
+++ b/test/simple/test-fs-chmod.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var fs = require('fs');
var got_error = false;
diff --git a/test/simple/test-fs-error-messages.js b/test/simple/test-fs-error-messages.js
index 387ceded8..c8bf79dca 100644
--- a/test/simple/test-fs-error-messages.js
+++ b/test/simple/test-fs-error-messages.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
fs = require('fs'),
diff --git a/test/simple/test-fs-fsync.js b/test/simple/test-fs-fsync.js
index 20ddcd425..94705ae57 100644
--- a/test/simple/test-fs-fsync.js
+++ b/test/simple/test-fs-fsync.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var fs = require('fs');
diff --git a/test/simple/test-fs-read-buffer.js b/test/simple/test-fs-read-buffer.js
index 60c5917b2..c78013b8d 100644
--- a/test/simple/test-fs-read-buffer.js
+++ b/test/simple/test-fs-read-buffer.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
Buffer = require('buffer').Buffer,
fs = require('fs'),
diff --git a/test/simple/test-fs-read-file-sync-hostname.js b/test/simple/test-fs-read-file-sync-hostname.js
index 1929ac8bc..45c9da457 100644
--- a/test/simple/test-fs-read-file-sync-hostname.js
+++ b/test/simple/test-fs-read-file-sync-hostname.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
// test reading from hostname
diff --git a/test/simple/test-fs-read-file-sync.js b/test/simple/test-fs-read-file-sync.js
index 69502aef3..f4ba62886 100644
--- a/test/simple/test-fs-read-file-sync.js
+++ b/test/simple/test-fs-read-file-sync.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
+var fs = require('fs');
-path = require('path');
-fs = require('fs');
-fn = path.join(common.fixturesDir, 'elipses.txt');
+var fn = path.join(common.fixturesDir, 'elipses.txt');
var s = fs.readFileSync(fn, 'utf8');
for (var i = 0; i < s.length; i++) {
diff --git a/test/simple/test-fs-read-stream.js b/test/simple/test-fs-read-stream.js
index 55feddef1..8ec3d01df 100644
--- a/test/simple/test-fs-read-stream.js
+++ b/test/simple/test-fs-read-stream.js
@@ -1,21 +1,20 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
// TODO Improved this test. test_ca.pem is too small. A proper test would
// great a large utf8 (with multibyte chars) file and stream it in,
// performing sanity checks throughout.
-Buffer = require('buffer').Buffer;
-path = require('path');
-fs = require('fs');
-fn = path.join(common.fixturesDir, 'elipses.txt');
-rangeFile = path.join(common.fixturesDir, 'x.txt');
+var path = require('path');
+var fs = require('fs');
+var fn = path.join(common.fixturesDir, 'elipses.txt');
+var rangeFile = path.join(common.fixturesDir, 'x.txt');
-callbacks = { open: 0, end: 0, close: 0, destroy: 0 };
+var callbacks = { open: 0, end: 0, close: 0, destroy: 0 };
-paused = false;
+var paused = false;
-file = fs.ReadStream(fn);
+var file = fs.ReadStream(fn);
file.addListener('open', function(fd) {
file.length = 0;
diff --git a/test/simple/test-fs-read.js b/test/simple/test-fs-read.js
index 3d0d334c0..c6be50447 100644
--- a/test/simple/test-fs-read.js
+++ b/test/simple/test-fs-read.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
fs = require('fs'),
filepath = path.join(common.fixturesDir, 'x.txt'),
diff --git a/test/simple/test-fs-readfile-empty.js b/test/simple/test-fs-readfile-empty.js
index 090f668e1..5391c95fe 100644
--- a/test/simple/test-fs-readfile-empty.js
+++ b/test/simple/test-fs-readfile-empty.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var
path = require('path'),
diff --git a/test/simple/test-fs-realpath.js b/test/simple/test-fs-realpath.js
index 906b6c61d..cd020cbe5 100644
--- a/test/simple/test-fs-realpath.js
+++ b/test/simple/test-fs-realpath.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
diff --git a/test/simple/test-fs-stat.js b/test/simple/test-fs-stat.js
index 5793ebb86..3b84ab249 100644
--- a/test/simple/test-fs-stat.js
+++ b/test/simple/test-fs-stat.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var fs = require('fs');
var got_error = false;
var success_count = 0;
diff --git a/test/simple/test-fs-symlink.js b/test/simple/test-fs-symlink.js
index 0360bcf8b..1cd5312cb 100644
--- a/test/simple/test-fs-symlink.js
+++ b/test/simple/test-fs-symlink.js
@@ -1,4 +1,4 @@
-common = require("../common");
+var common = require('../common');
var assert = common.assert;
var path = require('path');
var fs = require('fs');
diff --git a/test/simple/test-fs-write-buffer.js b/test/simple/test-fs-write-buffer.js
index 3d458aa57..e85cb598f 100644
--- a/test/simple/test-fs-write-buffer.js
+++ b/test/simple/test-fs-write-buffer.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
Buffer = require('buffer').Buffer,
fs = require('fs'),
diff --git a/test/simple/test-fs-write-file.js b/test/simple/test-fs-write-file.js
index a44859229..0d29f189c 100644
--- a/test/simple/test-fs-write-file.js
+++ b/test/simple/test-fs-write-file.js
@@ -1,17 +1,15 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+var join = require('path').join;
-join = require('path').join;
-fs = require('fs');
-Buffer = require('buffer').Buffer;
-
-filename = join(common.fixturesDir, 'test.txt');
+var filename = join(common.fixturesDir, 'test.txt');
common.error('writing to ' + filename);
-s = "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n";
+var s = "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n";
-ncallbacks = 0;
+var ncallbacks = 0;
fs.writeFile(filename, s, function (e) {
if (e) throw e;
@@ -28,8 +26,8 @@ fs.writeFile(filename, s, function (e) {
});
// test that writeFile accepts buffers
-filename2 = join(common.fixturesDir, 'test2.txt');
-buf = new Buffer(s, 'utf8');
+var filename2 = join(common.fixturesDir, 'test2.txt');
+var buf = new Buffer(s, 'utf8');
common.error('writing to ' + filename2);
fs.writeFile(filename2, buf, function (e) {
diff --git a/test/simple/test-fs-write-stream.js b/test/simple/test-fs-write-stream.js
index a604107c5..d1fa51a3d 100644
--- a/test/simple/test-fs-write-stream.js
+++ b/test/simple/test-fs-write-stream.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
fs = require('fs');
diff --git a/test/simple/test-fs-write-sync.js b/test/simple/test-fs-write-sync.js
index ecbb474b5..c01b4e7fb 100644
--- a/test/simple/test-fs-write-sync.js
+++ b/test/simple/test-fs-write-sync.js
@@ -1,20 +1,19 @@
-common = require("../common");
-assert = common.assert
-path = require('path'),
-Buffer = require('buffer').Buffer
-fs = require('fs')
-fn = path.join(common.tmpDir, 'write.txt');
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
+var fs = require('fs');
+var fn = path.join(common.tmpDir, 'write.txt');
-foo = 'foo'
+var foo = 'foo'
var fd = fs.openSync(fn, 'w');
-written = fs.writeSync(fd, '');
+var written = fs.writeSync(fd, '');
assert.strictEqual(0, written);
fs.writeSync(fd, foo);
-bar = 'bár'
+var bar = 'bár'
written = fs.writeSync(fd, new Buffer(bar), 0, Buffer.byteLength(bar));
assert.ok(written > 3);
fs.closeSync(fd);
diff --git a/test/simple/test-global.js b/test/simple/test-global.js
index ce4d3e8df..61510034c 100644
--- a/test/simple/test-global.js
+++ b/test/simple/test-global.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
baseFoo = "foo";
global.baseBar = "bar";
diff --git a/test/simple/test-http-1.0.js b/test/simple/test-http-1.0.js
index 6dbad0643..c3ab565ff 100644
--- a/test/simple/test-http-1.0.js
+++ b/test/simple/test-http-1.0.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require("net");
+var http = require("http");
var body = "hello world\n";
var server_response = "";
diff --git a/test/simple/test-http-304.js b/test/simple/test-http-304.js
index d6b92ad55..563da13b5 100644
--- a/test/simple/test-http-304.js
+++ b/test/simple/test-http-304.js
@@ -1,10 +1,10 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
-http = require('http');
-childProcess = require('child_process');
+var http = require('http');
+var childProcess = require('child_process');
-s = http.createServer(function (request, response) {
+var s = http.createServer(function (request, response) {
response.writeHead(304);
response.end();
});
diff --git a/test/simple/test-http-blank-header.js b/test/simple/test-http-blank-header.js
index 5c8f2ebe8..3cc4d190d 100644
--- a/test/simple/test-http-blank-header.js
+++ b/test/simple/test-http-blank-header.js
@@ -1,12 +1,11 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
-http = require('http');
-net = require('net');
+var gotReq = false;
-gotReq = false;
-
-server = http.createServer(function (req, res) {
+var server = http.createServer(function (req, res) {
common.error('got req');
gotReq = true;
assert.equal('GET', req.method);
diff --git a/test/simple/test-http-buffer-sanity.js b/test/simple/test-http-buffer-sanity.js
index 2e0f57062..c25a79d5c 100644
--- a/test/simple/test-http-buffer-sanity.js
+++ b/test/simple/test-http-buffer-sanity.js
@@ -42,6 +42,8 @@ var web = http.Server(function (req, res) {
});
});
+var gotThanks = false;
+
web.listen(common.PORT, function () {
console.log("Making request");
@@ -62,4 +64,5 @@ web.listen(common.PORT, function () {
process.on('exit', function () {
assert.equal(bufferSize, measuredSize);
+ assert.ok(gotThanks);
});
diff --git a/test/simple/test-http-cat.js b/test/simple/test-http-cat.js
index b837dffd6..f967b2ed2 100644
--- a/test/simple/test-http-cat.js
+++ b/test/simple/test-http-cat.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
+var common = require("../common");
+var assert = require('assert');
+var http = require("http");
var body = "exports.A = function() { return 'A';}";
var server = http.createServer(function (req, res) {
diff --git a/test/simple/test-http-chunked.js b/test/simple/test-http-chunked.js
index 9a6b2e100..eb8c7ab63 100644
--- a/test/simple/test-http-chunked.js
+++ b/test/simple/test-http-chunked.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var http = require("http");
var UTF8_STRING = "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、经济现状。";
@@ -19,4 +19,4 @@ server.addListener("listening", function() {
console.log(data);
server.close();
});
-}); \ No newline at end of file
+});
diff --git a/test/simple/test-http-client-race-2.js b/test/simple/test-http-client-race-2.js
index 51caf393c..97df9ef54 100644
--- a/test/simple/test-http-client-race-2.js
+++ b/test/simple/test-http-client-race-2.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require("url");
//
// Slight variation on test-http-client-race to test for another race
diff --git a/test/simple/test-http-client-race.js b/test/simple/test-http-client-race.js
index deb1990a5..6d93201a5 100644
--- a/test/simple/test-http-client-race.js
+++ b/test/simple/test-http-client-race.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require("url");
var body1_s = "1111111111111111";
var body2_s = "22222";
diff --git a/test/simple/test-http-client-upload.js b/test/simple/test-http-client-upload.js
index cac5e887b..b49235e29 100644
--- a/test/simple/test-http-client-upload.js
+++ b/test/simple/test-http-client-upload.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
var sent_body = "";
var server_req_complete = false;
diff --git a/test/simple/test-http-eof-on-connect.js b/test/simple/test-http-eof-on-connect.js
index 367538d5c..4a23659fa 100644
--- a/test/simple/test-http-eof-on-connect.js
+++ b/test/simple/test-http-eof-on-connect.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
// This is a regression test for http://github.com/ry/node/issues/#issue/44
// It is separate from test-http-malformed-request.js because it is only
diff --git a/test/simple/test-http-exceptions.js b/test/simple/test-http-exceptions.js
index 260dc0d55..48e95cd99 100644
--- a/test/simple/test-http-exceptions.js
+++ b/test/simple/test-http-exceptions.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert;
-http = require("http");
+var common = require('../common');
+var assert = require('assert');;
+var http = require('http');
server = http.createServer(function (req, res) {
intentionally_not_defined();
diff --git a/test/simple/test-http-full-response.js b/test/simple/test-http-full-response.js
index 2b543058f..6a7d77ff6 100644
--- a/test/simple/test-http-full-response.js
+++ b/test/simple/test-http-full-response.js
@@ -1,15 +1,17 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
// This test requires the program "ab"
-http = require("http");
-exec = require("child_process").exec;
+var http = require('http');
+var exec = require("child_process").exec;
-bodyLength = 12345;
+var bodyLength = 12345;
-body = "";
-for (var i = 0; i < bodyLength; i++) body += 'c';
+var body = "";
+for (var i = 0; i < bodyLength; i++) {
+ body += 'c';
+}
-server = http.createServer(function (req, res) {
+var server = http.createServer(function (req, res) {
res.writeHead(200, {
"Content-Length": bodyLength,
"Content-Type": "text/plain"
@@ -17,7 +19,7 @@ server = http.createServer(function (req, res) {
res.end(body);
});
-runs = 0;
+var runs = 0;
function runAb(opts, callback) {
var command = "ab " + opts + " http://127.0.0.1:" + common.PORT + "/";
diff --git a/test/simple/test-http-head-request.js b/test/simple/test-http-head-request.js
index bde0b85c2..57878d455 100644
--- a/test/simple/test-http-head-request.js
+++ b/test/simple/test-http-head-request.js
@@ -1,14 +1,12 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
-assert = require("assert");
-http = require("http");
-util = require("util");
+var body = "hello world\n";
-body = "hello world\n";
-
-server = http.createServer(function (req, res) {
+var server = http.createServer(function (req, res) {
common.error('req: ' + req.method);
res.writeHead(200, {"Content-Length": body.length});
res.end();
diff --git a/test/simple/test-http-head-response-has-no-body.js b/test/simple/test-http-head-response-has-no-body.js
index 13b3ead3b..270a5e73e 100644
--- a/test/simple/test-http-head-response-has-no-body.js
+++ b/test/simple/test-http-head-response-has-no-body.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var http = require('http');
diff --git a/test/simple/test-http-keep-alive-close-on-header.js b/test/simple/test-http-keep-alive-close-on-header.js
index 329fe3981..7d5546903 100644
--- a/test/simple/test-http-keep-alive-close-on-header.js
+++ b/test/simple/test-http-keep-alive-close-on-header.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
assert = require("assert");
-http = require("http");
-util = require("util");
+var http = require('http');
+var util = require('util');
body = "hello world\n";
headers = {'connection':'keep-alive'}
diff --git a/test/simple/test-http-keep-alive.js b/test/simple/test-http-keep-alive.js
index 6aa3f485c..032f1cdba 100644
--- a/test/simple/test-http-keep-alive.js
+++ b/test/simple/test-http-keep-alive.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
assert = require("assert");
-http = require("http");
-util = require("util");
+var http = require('http');
+var util = require('util');
body = "hello world\n";
headers = {'connection':'keep-alive'}
diff --git a/test/simple/test-http-malformed-request.js b/test/simple/test-http-malformed-request.js
index b47cae556..db571ac55 100644
--- a/test/simple/test-http-malformed-request.js
+++ b/test/simple/test-http-malformed-request.js
@@ -1,14 +1,14 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
+var url = require("url");
// Make sure no exceptions are thrown when receiving malformed HTTP
// requests.
-nrequests_completed = 0;
-nrequests_expected = 1;
+var nrequests_completed = 0;
+var nrequests_expected = 1;
var server = http.createServer(function (req, res) {
console.log("req: " + JSON.stringify(url.parse(req.url)));
diff --git a/test/simple/test-http-parser.js b/test/simple/test-http-parser.js
index 2068be5fb..aa5551a8e 100644
--- a/test/simple/test-http-parser.js
+++ b/test/simple/test-http-parser.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
// The purpose of this test is not to check HTTP compliance but to test the
// binding. Tests for pathological http messages should be submitted
diff --git a/test/simple/test-http-proxy.js b/test/simple/test-http-proxy.js
index 58fa995e2..b8e946288 100644
--- a/test/simple/test-http-proxy.js
+++ b/test/simple/test-http-proxy.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require("url");
var PROXY_PORT = common.PORT;
var BACKEND_PORT = common.PORT+1;
@@ -48,7 +48,7 @@ var proxy = http.createServer(function (req, res) {
var body = "";
-nlistening = 0;
+var nlistening = 0;
function startReq () {
nlistening++;
if (nlistening < 2) return;
diff --git a/test/simple/test-http-server-multiheaders.js b/test/simple/test-http-server-multiheaders.js
index 10fc68a4c..ad609c6ce 100644
--- a/test/simple/test-http-server-multiheaders.js
+++ b/test/simple/test-http-server-multiheaders.js
@@ -2,8 +2,8 @@
// of the same header as per RFC2616: joining the handful of fields by ', '
// that support it, and dropping duplicates for other fields.
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var http = require('http');
var srv = http.createServer(function(req, res) {
diff --git a/test/simple/test-http-server.js b/test/simple/test-http-server.js
index 4b9b77688..2919c9630 100644
--- a/test/simple/test-http-server.js
+++ b/test/simple/test-http-server.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
url = require("url");
qs = require("querystring");
diff --git a/test/simple/test-http-set-cookies.js b/test/simple/test-http-set-cookies.js
index e242da875..b99bf05a7 100644
--- a/test/simple/test-http-set-cookies.js
+++ b/test/simple/test-http-set-cookies.js
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert;
-http = require("http");
+var common = require('../common');
+var assert = require('assert');;
+var http = require('http');
-nresponses = 0;
+var nresponses = 0;
var server = http.createServer(function(req, res) {
if (req.url == '/one') {
diff --git a/test/simple/test-http-set-timeout.js b/test/simple/test-http-set-timeout.js
index 54abd7dc2..5e0bae521 100644
--- a/test/simple/test-http-set-timeout.js
+++ b/test/simple/test-http-set-timeout.js
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert;
-http = require('http');
+var common = require('../common');
+var assert = require('assert');;
+var http = require('http');
-server = http.createServer(function (req, res) {
+var server = http.createServer(function (req, res) {
console.log('got request. setting 1 second timeout');
req.connection.setTimeout(500);
@@ -15,7 +15,7 @@ server = http.createServer(function (req, res) {
server.listen(common.PORT, function () {
console.log('Server running at http://127.0.0.1:'+common.PORT+'/');
- errorTimer = setTimeout(function () {
+ var errorTimer = setTimeout(function () {
throw new Error('Timeout was not sucessful');
}, 2000);
diff --git a/test/simple/test-http-set-trailers.js b/test/simple/test-http-set-trailers.js
index e5c643898..35d2b9ede 100644
--- a/test/simple/test-http-set-trailers.js
+++ b/test/simple/test-http-set-trailers.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert;
-http = require("http");
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
-outstanding_reqs = 0;
+var outstanding_reqs = 0;
var server = http.createServer(function(req, res) {
res.writeHead(200, [ ['content-type', 'text/plain'] ]);
diff --git a/test/simple/test-http-upgrade-client.js b/test/simple/test-http-upgrade-client.js
index 4ee5d96f2..84bdaf11c 100644
--- a/test/simple/test-http-upgrade-client.js
+++ b/test/simple/test-http-upgrade-client.js
@@ -2,8 +2,8 @@
// the HTTP client. This test uses a raw TCP server to better control server
// behavior.
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var http = require('http');
var net = require('net');
diff --git a/test/simple/test-http-upgrade-client2.js b/test/simple/test-http-upgrade-client2.js
index 504850591..3550f70f5 100644
--- a/test/simple/test-http-upgrade-client2.js
+++ b/test/simple/test-http-upgrade-client2.js
@@ -1,7 +1,8 @@
var common = require("../common");
-var assert = common.assert
-var http = require('http'),
- CRLF = '\r\n';
+var assert = require('assert');
+var http = require('http');
+
+var CRLF = '\r\n';
var server = http.createServer();
server.on('upgrade', function(req, socket, head) {
@@ -13,6 +14,7 @@ server.on('upgrade', function(req, socket, head) {
});
});
+var successCount = 0;
server.listen(common.PORT, function () {
@@ -45,7 +47,6 @@ server.listen(common.PORT, function () {
}
- successCount = 0;
upgradeRequest(function() {
successCount++;
upgradeRequest(function() {
diff --git a/test/simple/test-http-upgrade-server.js b/test/simple/test-http-upgrade-server.js
index accc18bcc..8662df4df 100644
--- a/test/simple/test-http-upgrade-server.js
+++ b/test/simple/test-http-upgrade-server.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var util = require("util");
var net = require("net");
diff --git a/test/simple/test-http-upgrade-server2.js b/test/simple/test-http-upgrade-server2.js
index ade541ac6..a5129a480 100644
--- a/test/simple/test-http-upgrade-server2.js
+++ b/test/simple/test-http-upgrade-server2.js
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
-http = require('http');
-net = require('net');
+var http = require('http');
+var net = require('net');
server = http.createServer(function (req, res) {
common.error('got req');
diff --git a/test/simple/test-http-wget.js b/test/simple/test-http-wget.js
index 266f5f5aa..1fa970bd9 100644
--- a/test/simple/test-http-wget.js
+++ b/test/simple/test-http-wget.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
// wget sends an HTTP/1.0 request with Connection: Keep-Alive
//
diff --git a/test/simple/test-http-write-empty-string.js b/test/simple/test-http-write-empty-string.js
index afe7f7f03..1e4a1698d 100644
--- a/test/simple/test-http-write-empty-string.js
+++ b/test/simple/test-http-write-empty-string.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
-http = require('http');
+var http = require('http');
assert = require('assert');
server = http.createServer(function (request, response) {
diff --git a/test/simple/test-http.js b/test/simple/test-http.js
index 899406dab..a60398a01 100644
--- a/test/simple/test-http.js
+++ b/test/simple/test-http.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
url = require("url");
function p (x) {
diff --git a/test/simple/test-listen-fd.js b/test/simple/test-listen-fd.js
index 295747897..3323e2db2 100644
--- a/test/simple/test-listen-fd.js
+++ b/test/simple/test-listen-fd.js
@@ -1,9 +1,9 @@
// Verify that net.Server.listenFD() can be used to accept connections on an
// already-bound, already-listening socket.
-common = require("../common");
-assert = common.assert
-http = require('http');
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
netBinding = process.binding('net');
// Create an server and set it listening on a socket bound to common.PORT
diff --git a/test/simple/test-memory-usage.js b/test/simple/test-memory-usage.js
index e4a0ea30d..806b0f781 100644
--- a/test/simple/test-memory-usage.js
+++ b/test/simple/test-memory-usage.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var r = process.memoryUsage();
console.log(common.inspect(r));
diff --git a/test/simple/test-mkdir-rmdir.js b/test/simple/test-mkdir-rmdir.js
index ea36b7453..0b409ca21 100644
--- a/test/simple/test-mkdir-rmdir.js
+++ b/test/simple/test-mkdir-rmdir.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var fs = require('fs');
diff --git a/test/simple/test-module-loading.js b/test/simple/test-module-loading.js
index e03b74e4a..500e7ef9e 100644
--- a/test/simple/test-module-loading.js
+++ b/test/simple/test-module-loading.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path'),
fs = require('fs');
diff --git a/test/simple/test-net-binary.js b/test/simple/test-net-binary.js
index e2687be5a..476ab4ef3 100644
--- a/test/simple/test-net-binary.js
+++ b/test/simple/test-net-binary.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
binaryString = "";
for (var i = 255; i >= 0; i--) {
diff --git a/test/simple/test-net-eaddrinuse.js b/test/simple/test-net-eaddrinuse.js
index 9278eb549..38428c14c 100644
--- a/test/simple/test-net-eaddrinuse.js
+++ b/test/simple/test-net-eaddrinuse.js
@@ -1,6 +1,6 @@
-common = require('../common');
-assert = common.assert
-net = require('net');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
var server1 = net.createServer(function (socket) {
});
diff --git a/test/simple/test-net-isip.js b/test/simple/test-net-isip.js
index 1ae5806e0..178a09e01 100644
--- a/test/simple/test-net-isip.js
+++ b/test/simple/test-net-isip.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
assert.equal(net.isIP("127.0.0.1"), 4);
assert.equal(net.isIP("x127.0.0.1"), 0);
diff --git a/test/simple/test-net-keepalive.js b/test/simple/test-net-keepalive.js
index 11698aa6e..04a050674 100644
--- a/test/simple/test-net-keepalive.js
+++ b/test/simple/test-net-keepalive.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-net = require('net');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
var serverConnection;
var echoServer = net.createServer(function (connection) {
@@ -27,4 +27,4 @@ echoServer.addListener("listening", function() {
clientConnection.end();
echoServer.close();
}, 1200);
-}); \ No newline at end of file
+});
diff --git a/test/simple/test-net-pingpong.js b/test/simple/test-net-pingpong.js
index 6596d0030..889886819 100644
--- a/test/simple/test-net-pingpong.js
+++ b/test/simple/test-net-pingpong.js
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
-net = require("net");
+var net = require('net');
var tests_run = 0;
diff --git a/test/simple/test-net-reconnect.js b/test/simple/test-net-reconnect.js
index d6027de61..8e4e7eab8 100644
--- a/test/simple/test-net-reconnect.js
+++ b/test/simple/test-net-reconnect.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert
-net = require('net');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
var N = 50;
var c = 0;
diff --git a/test/simple/test-net-server-max-connections.js b/test/simple/test-net-server-max-connections.js
index daf516d56..301c12a91 100644
--- a/test/simple/test-net-server-max-connections.js
+++ b/test/simple/test-net-server-max-connections.js
@@ -1,6 +1,6 @@
-common = require("../common");
-assert = common.assert;
-net = require('net');
+var common = require('../common');
+var assert = require('assert');;
+var net = require('net');
// This test creates 200 connections to a server and sets the server's
// maxConnections property to 100. The first 100 connections make it through
diff --git a/test/simple/test-next-tick-errors.js b/test/simple/test-next-tick-errors.js
index 8ae3f5e54..eec454621 100644
--- a/test/simple/test-next-tick-errors.js
+++ b/test/simple/test-next-tick-errors.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var order = [],
exceptionHandled = false;
diff --git a/test/simple/test-next-tick-ordering.js b/test/simple/test-next-tick-ordering.js
index 90dec646a..aa10aab1b 100644
--- a/test/simple/test-next-tick-ordering.js
+++ b/test/simple/test-next-tick-ordering.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var i;
var N = 30;
diff --git a/test/simple/test-next-tick-ordering2.js b/test/simple/test-next-tick-ordering2.js
index a699c51f2..33badf864 100644
--- a/test/simple/test-next-tick-ordering2.js
+++ b/test/simple/test-next-tick-ordering2.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var order = [];
process.nextTick(function() {
diff --git a/test/simple/test-next-tick.js b/test/simple/test-next-tick.js
index 3965cba2f..049cb98a3 100644
--- a/test/simple/test-next-tick.js
+++ b/test/simple/test-next-tick.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var complete = 0;
diff --git a/test/simple/test-path.js b/test/simple/test-path.js
index e91597bbb..f97fd15ed 100644
--- a/test/simple/test-path.js
+++ b/test/simple/test-path.js
@@ -1,6 +1,6 @@
var path = require("path");
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var f = __filename;
diff --git a/test/simple/test-pipe-head.js b/test/simple/test-pipe-head.js
index 3dbef16d9..51d765998 100644
--- a/test/simple/test-pipe-head.js
+++ b/test/simple/test-pipe-head.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
exec = require('child_process').exec;
join = require('path').join;
diff --git a/test/simple/test-pump-file2tcp-noexist.js b/test/simple/test-pump-file2tcp-noexist.js
index 61fc6c4f9..1cf2c6ab5 100644
--- a/test/simple/test-pump-file2tcp-noexist.js
+++ b/test/simple/test-pump-file2tcp-noexist.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-fs = require("fs");
-util = require("util");
-path = require("path");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
fn = path.join(common.fixturesDir, 'does_not_exist.txt');
var got_error = false;
diff --git a/test/simple/test-pump-file2tcp.js b/test/simple/test-pump-file2tcp.js
index 96c516710..07572ae34 100644
--- a/test/simple/test-pump-file2tcp.js
+++ b/test/simple/test-pump-file2tcp.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-fs = require("fs");
-util = require("util");
-path = require("path");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
fn = path.join(common.fixturesDir, 'elipses.txt');
expected = fs.readFileSync(fn, 'utf8');
diff --git a/test/simple/test-querystring.js b/test/simple/test-querystring.js
index 58744f527..c84ebcb1f 100644
--- a/test/simple/test-querystring.js
+++ b/test/simple/test-querystring.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
// test using assert
var qs = require("querystring");
diff --git a/test/simple/test-readdir.js b/test/simple/test-readdir.js
index 9012f935b..739790248 100644
--- a/test/simple/test-readdir.js
+++ b/test/simple/test-readdir.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var path = require('path');
var fs = require('fs');
diff --git a/test/simple/test-repl.js b/test/simple/test-repl.js
index 08176039c..a3280d998 100644
--- a/test/simple/test-repl.js
+++ b/test/simple/test-repl.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var net = require("net"),
repl = require("repl"),
diff --git a/test/simple/test-script-context.js b/test/simple/test-script-context.js
index 2af7bd0fe..865c47342 100644
--- a/test/simple/test-script-context.js
+++ b/test/simple/test-script-context.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var Script = require('vm').Script;
var script = new Script('"passed";');
diff --git a/test/simple/test-script-new.js b/test/simple/test-script-new.js
index 117b62afc..73cdf14d7 100644
--- a/test/simple/test-script-new.js
+++ b/test/simple/test-script-new.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Script = require('vm').Script;
common.debug('run a string');
diff --git a/test/simple/test-script-static-context.js b/test/simple/test-script-static-context.js
index 87ff3e19b..9d2930e80 100644
--- a/test/simple/test-script-static-context.js
+++ b/test/simple/test-script-static-context.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var Script = require('vm').Script;
diff --git a/test/simple/test-script-static-new.js b/test/simple/test-script-static-new.js
index 81453e82b..ef135c925 100644
--- a/test/simple/test-script-static-new.js
+++ b/test/simple/test-script-static-new.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Script = require('vm').Script;
diff --git a/test/simple/test-script-static-this.js b/test/simple/test-script-static-this.js
index c9809ff14..dc031939e 100644
--- a/test/simple/test-script-static-this.js
+++ b/test/simple/test-script-static-this.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Script = require('vm').Script;
diff --git a/test/simple/test-script-this.js b/test/simple/test-script-this.js
index b8eeb97e6..576a5b714 100644
--- a/test/simple/test-script-this.js
+++ b/test/simple/test-script-this.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var Script = require('vm').Script;
diff --git a/test/simple/test-sendfd.js b/test/simple/test-sendfd.js
index 7ed7b02c1..468413217 100644
--- a/test/simple/test-sendfd.js
+++ b/test/simple/test-sendfd.js
@@ -25,8 +25,8 @@
// seen in a response yet. This is intended to ensure that all blobs
// sent out have been relayed back to us.
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
var buffer = require('buffer');
var child_process = require('child_process');
diff --git a/test/simple/test-signal-handler.js b/test/simple/test-signal-handler.js
index 8622e7cc9..c3fa6b686 100644
--- a/test/simple/test-signal-handler.js
+++ b/test/simple/test-signal-handler.js
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
console.log("process.pid: " + process.pid);
diff --git a/test/simple/test-signal-unregister.js b/test/simple/test-signal-unregister.js
index 20732ecba..bfa2aa1c5 100644
--- a/test/simple/test-signal-unregister.js
+++ b/test/simple/test-signal-unregister.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var childKilled = false, done = false,
spawn = require('child_process').spawn,
diff --git a/test/simple/test-stdin-from-file.js b/test/simple/test-stdin-from-file.js
index c433bbc85..8fa0c248a 100644
--- a/test/simple/test-stdin-from-file.js
+++ b/test/simple/test-stdin-from-file.js
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
join = require('path').join;
childProccess = require('child_process');
-fs = require('fs');
+var fs = require('fs');
stdoutScript = join(common.fixturesDir, 'echo.js');
tmpFile = join(common.fixturesDir, 'stdin.txt');
diff --git a/test/simple/test-stdout-to-file.js b/test/simple/test-stdout-to-file.js
index 0cf7cb265..4ba1c7c1d 100644
--- a/test/simple/test-stdout-to-file.js
+++ b/test/simple/test-stdout-to-file.js
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
childProccess = require('child_process');
-fs = require('fs');
+var fs = require('fs');
scriptString = path.join(common.fixturesDir, 'print-chars.js');
scriptBuffer = path.join(common.fixturesDir, 'print-chars-from-buffer.js');
tmpFile = path.join(common.fixturesDir, 'stdout.txt');
diff --git a/test/simple/test-string-decoder.js b/test/simple/test-string-decoder.js
index 6c3a3e304..3fb081159 100644
--- a/test/simple/test-string-decoder.js
+++ b/test/simple/test-string-decoder.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
Buffer = require('buffer').Buffer;
StringDecoder = require('string_decoder').StringDecoder;
diff --git a/test/simple/test-sync-fileread.js b/test/simple/test-sync-fileread.js
index 5b8602e4c..6c9685e16 100644
--- a/test/simple/test-sync-fileread.js
+++ b/test/simple/test-sync-fileread.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var path = require('path');
var fs = require('fs');
diff --git a/test/simple/test-sys.js b/test/simple/test-sys.js
index 625c02b1b..86f123d95 100644
--- a/test/simple/test-sys.js
+++ b/test/simple/test-sys.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
assert.equal('0', common.inspect(0));
assert.equal('1', common.inspect(1));
diff --git a/test/simple/test-umask.js b/test/simple/test-umask.js
index 850bfb503..9284fd1f0 100644
--- a/test/simple/test-umask.js
+++ b/test/simple/test-umask.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
var mask = 0664;
var old = process.umask(mask);
diff --git a/test/simple/test-url.js b/test/simple/test-url.js
index 1bd94bcb5..dd01e3a16 100644
--- a/test/simple/test-url.js
+++ b/test/simple/test-url.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
var url = require('url'),
util = require('util');
diff --git a/test/simple/test-utf8-scripts.js b/test/simple/test-utf8-scripts.js
index 2fea454b5..3b4005e61 100644
--- a/test/simple/test-utf8-scripts.js
+++ b/test/simple/test-utf8-scripts.js
@@ -1,5 +1,5 @@
-common = require('../common');
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');;
// üäö