diff --git a/lib/http.js b/lib/http.js index 7df210a7ba..0b4a0e2212 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 3ed2839047..00a1bcb495 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 1599a17dba..f469aed0f7 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 458c3dacd4..11ad5afde8 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 3aa218ca71..9f280aa1fc 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 31d4a19f73..dfbe3df802 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 4927647561..57fe371242 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 d8778d8a9b..0b86a3f4da 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 4c0ebe18e3..b222b0003a 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 274d27acbd..6273bd408d 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 fb05c33d5b..e8f05d4476 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 ce9f987366..c40adfd3d0 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 1ed935e84a..23b4595b3e 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 e207f4e5bd..073e487bf0 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 1f505cd8f0..54cb20285a 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 e2a36aea14..903999dfdb 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 37f06561d7..0dc5e7f662 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 672da80896..ebbfe03527 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 cb4bb5528c..8eec4704a9 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 55c812b7f4..77dbb8be9a 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 c69024b7e2..cbf16fdc28 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 3aba96b8a7..748b83bf22 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 9409c1dd89..9f15b15e41 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 25a4f0632b..ec97604921 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 bd81341bd5..b36a132083 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 3a5de31caf..a85e1e93b3 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 d75ac9bd53..178fc8736c 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 e389099829..ab42762f7f 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 41c69227c7..cac8418385 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 4546470f53..d6b828ab67 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 66f74f0870..11799cb7ac 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 d571acd4c3..0b58256b3f 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 e25f5844e1..0afe5a609d 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 f949c13710..f38e660e06 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 906d96a019..73d3544970 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 234cf13806..6daa333510 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 c4ece6a3b2..8d699369f3 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 ef9259e5cf..ae5c837ba1 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 135ac0299b..21b7579548 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 08252aac56..f0ec7aab16 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 9cbffefd51..bebd51a69d 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 c5fb0ef102..33bc42729c 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 20d73b2e3f..79677f1c9d 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 4da8563268..f781b9b70c 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 f814371415..e9198608d1 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 b3eac81666..ca3344f9a1 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 eef723a937..19921bcb13 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 c3b93c4895..5707abb502 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 dd35e9a601..acc67523fd 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 8e25f2877b..a77772dc7d 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 012c1a613a..a245175dd0 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 f44aa99104..125e9dd006 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 a493c0d0ee..7edcd0848f 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 10652372ce..c5317bf862 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 755d629aa9..2d5ac4c472 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 1068261dc0..12582ef7ba 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 0465a3a756..327da5e1fb 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 d21b03593b..c87fa2df5d 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 3d22778198..0d8424e242 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 4f322b2359..23e2d67b0d 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 e65ad7c382..af1e1a36e5 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 30aba8d459..fa067a4300 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 161e8c3c71..38b74a42cb 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 93a5149cc7..a31095c916 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 8639231283..b53bc114dc 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 da8628eeb2..d46061c1e1 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 f1227e80a1..880514c665 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 868862a125..96fc3da65b 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 f4f3cf8730..860eda1cb3 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 6ba09f4d23..b251fbb09f 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 63f049cb3f..216d6734df 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 69449bce7b..651eac906b 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 fc870a08ab..1225dcc387 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 387ceded89..c8bf79dca7 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 20ddcd4255..94705ae579 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 60c5917b28..c78013b8d2 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 1929ac8bcd..45c9da4570 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 69502aef36..f4ba62886a 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 55feddef13..8ec3d01df3 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 3d0d334c0b..c6be504471 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 090f668e1f..5391c95fe8 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 906b6c61d4..cd020cbe5f 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 5793ebb860..3b84ab2491 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 0360bcf8bf..1cd5312cba 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 3d458aa574..e85cb598fa 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 a448592294..0d29f189cf 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 a604107c5f..d1fa51a3dc 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 ecbb474b56..c01b4e7fbb 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 ce4d3e8df0..61510034cf 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 6dbad06436..c3ab565ff0 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 d6b92ad555..563da13b5f 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 5c8f2ebe84..3cc4d190d6 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 2e0f57062f..c25a79d5c6 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 b837dffd62..f967b2ed2e 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 9a6b2e1009..eb8c7ab63a 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 51caf393ca..97df9ef547 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 deb1990a5c..6d93201a54 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 cac5e887be..b49235e291 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 367538d5ce..4a23659faa 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 260dc0d55a..48e95cd991 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 2b543058fb..6a7d77ff63 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 bde0b85c2f..57878d4550 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 13b3ead3b9..270a5e73e9 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 329fe39816..7d55469031 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 6aa3f485ca..032f1cdba7 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 b47cae556f..db571ac558 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 2068be5fba..aa5551a8e6 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 58fa995e28..b8e9462885 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 10fc68a4c8..ad609c6ce3 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 4b9b776884..2919c9630c 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 e242da875a..b99bf05a76 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 54abd7dc25..5e0bae5214 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 e5c6438985..35d2b9ede5 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 4ee5d96f20..84bdaf11c6 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 5048505912..3550f70f5d 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 accc18bcca..8662df4df7 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 ade541ac62..a5129a4800 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 266f5f5aad..1fa970bd9c 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 afe7f7f034..1e4a1698db 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 899406dabb..a60398a017 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 295747897f..3323e2db26 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 e4a0ea30df..806b0f7815 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 ea36b74532..0b409ca215 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 e03b74e4a8..500e7ef9e5 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 e2687be5ad..476ab4ef33 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 9278eb5492..38428c14c7 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 1ae5806e09..178a09e015 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 11698aa6ea..04a0506746 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 6596d0030c..8898868196 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 d6027de611..8e4e7eab85 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 daf516d567..301c12a91a 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 8ae3f5e543..eec4546214 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 90dec646aa..aa10aab1be 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 a699c51f27..33badf8642 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 3965cba2f5..049cb98a31 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 e91597bbbb..f97fd15edf 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 3dbef16d98..51d7659983 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 61fc6c4f90..1cf2c6ab55 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 96c5167101..07572ae348 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 58744f5271..c84ebcb1fc 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 9012f935b0..739790248f 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 08176039c3..a3280d9987 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 2af7bd0fea..865c473427 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 117b62afc8..73cdf14d74 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 87ff3e19b0..9d2930e808 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 81453e82b5..ef135c925b 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 c9809ff14c..dc031939e3 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 b8eeb97e69..576a5b714b 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 7ed7b02c1a..468413217b 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 8622e7cc91..c3fa6b6868 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 20732ecba7..bfa2aa1c52 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 c433bbc854..8fa0c248a8 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 0cf7cb2650..4ba1c7c1da 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 6c3a3e3043..3fb0811594 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 5b8602e4c3..6c9685e164 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 625c02b1bd..86f123d954 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 850bfb5036..9284fd1f02 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 1bd94bcb51..dd01e3a163 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 2fea454b5a..3b4005e611 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');; // üäö