Fix global leaks
This commit is contained in:
Родитель
fbdff52b44
Коммит
a0159b4b29
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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 ...');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert;
|
||||
var common = require('../common');
|
||||
var assert = require('assert');;
|
||||
|
||||
tcp = require("tcp");
|
||||
util = require("util");
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert;
|
||||
var common = require('../common');
|
||||
var assert = require('assert');;
|
||||
|
||||
http = require("http");
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
net = require("net");
|
||||
fs=require("fs");
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var c = require('./b/c');
|
||||
|
||||
common.debug('load fixtures/a.js');
|
||||
console.error('load fixtures/a.js');
|
||||
|
||||
var string = 'A';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
common.debug('load fixtures/b/d.js');
|
||||
console.error('load fixtures/b/d.js');
|
||||
|
||||
var string = 'D';
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
exports.hello = 'world';
|
||||
common.debug('load package/index.js');
|
||||
console.error('load package/index.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');
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require('../common');
|
||||
assert = common.assert;
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var n = parseInt(process.argv[2]);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require('../common');
|
||||
assert = common.assert;
|
||||
var common = require('../common');
|
||||
var assert = require('assert');;
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require('../common');
|
||||
assert = common.assert;
|
||||
var common = require('../common');
|
||||
var assert = require('assert');;
|
||||
net = require('net');
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require('../common');
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
assert = require('assert');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var dns = require("dns");
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.equal(true, process.cwd() !== __dirname);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -56,4 +56,4 @@ var exits = 0;
|
|||
// Check if all child processes exited
|
||||
process.addListener('exit', function () {
|
||||
assert.equal(2, exits);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 = [ ];
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var
|
||||
path = require('path'),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
var
|
||||
path = require('path'),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
common = require("../common");
|
||||
var common = require('../common');
|
||||
var assert = common.assert;
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
common = require("../common");
|
||||
assert = common.assert
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
|
||||
baseFoo = "foo";
|
||||
global.baseBar = "bar";
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче