, JSON.stringify(this.actual)
].join(" ");
}
-}
+};
// assert.AssertionError instanceof Error
(!shouldThrow && threw)) {
throw exception;
}
-}
+};
// 11. Expected to throw an error:
// assert.throws(block, Error_opt, message_opt);
stderr += chunk;
if (!killed && stderr.length > options.maxBuffer) {
child.kill(options.killSignal);
- killed = true
+ killed = true;
}
});
+"I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp\n"
+"MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o\n"
+"tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n"
-+"-----END CERTIFICATE-----\n",
-
++"-----END CERTIFICATE-----\n"
];
var sys = require("sys");
}
}
return c;
-}
+};
exports.Credentials = Credentials;
exports.Hash = Hash;
exports.createHash = function(hash) {
return new Hash(hash);
-}
+};
exports.Hmac = Hmac;
exports.createHmac = function(hmac, key) {
return (new Hmac).init(hmac, key);
-}
+};
exports.Cipher = Cipher;
exports.createCipher = function(cipher, key) {
return (new Cipher).init(cipher, key);
-}
+};
exports.createCipheriv = function(cipher, key, iv) {
return (new Cipher).initiv(cipher, key, iv);
-}
+};
exports.Decipher = Decipher;
exports.createDecipher = function(cipher, key) {
return (new Decipher).init(cipher, key);
-}
+};
exports.createDecipheriv = function(cipher, key, iv) {
return (new Decipher).initiv(cipher, key, iv);
-}
+};
exports.Sign = Sign;
exports.createSign = function(algorithm) {
return (new Sign).init(algorithm);
-}
+};
exports.Verify = Verify;
exports.createVerify = function(algorithm) {
return (new Verify).init(algorithm);
-}
+};
exports.RootCaCerts = RootCaCerts;
var sockets = Object.keys(activeWatchers);
for (var i = 0, l = sockets.length; i < l; i++) {
var socket = sockets[i];
- var s = parseInt(socket);
+ var s = parseInt(socket, 10);
channel.processFD( watchers[socket].read ? s : dns.SOCKET_BAD
, watchers[socket].write ? s : dns.SOCKET_BAD
);
}
updateTimer();
-}
+};
function updateTimer() {
var max = 20000;
var timeout = channel.timeout(max);
timer.start(timeout, 0);
-}
+};
var channel = new dns.Channel({SOCK_STATE_CB: function (socket, read, write) {
, write ? socket : dns.SOCKET_BAD
);
updateTimer();
- }
- }
+ };
+ };
watcher.set(socket, read == 1, write == 1);
} else {
throw new Error('Unknown type "' + type + '"');
}
-}
+};
function familyToSym(family) {
family = (family === 6) ? dns.AF_INET6 : dns.AF_INET;
}
return family;
-}
+};
exports.getHostByName = function (domain, family/*=4*/, callback) {
callback = family;
family = undefined;
} else if (family && family !== 4 && family !== 6) {
- family = parseInt(family);
+ family = parseInt(family, 10);
if (family === dns.AF_INET) {
family = 4;
} else if (family === dns.AF_INET6) {
'TXT' : exports.resolveTxt,
'SRV' : exports.resolveSrv,
'PTR' : exports.resolvePtr,
- 'NS' : exports.resolveNs,
+ 'NS' : exports.resolveNs
};
// ERROR CODES
throw new Error(
'Promise has been removed. See '+
'http://groups.google.com/group/nodejs/msg/0c483b891c56fea2 for more information.');
-}
+};
process.Promise = exports.Promise;
this.constructor = constructor;
this.max = max;
this.list = [];
-}
+};
exports.FreeList.prototype.alloc = function () {
if (!i._bytesRead) return;
i.copy(buffer,offset,0,i._bytesRead);
offset += i._bytesRead;
- })
+ });
} else if (buffers.length) {
//buffers has exactly 1 (possibly zero length) buffer, so this should be a shortcut
buffer = buffers[0].slice(0, buffers[0]._bytesRead);
sys.error(writeStreamCloseWarning);
}
return this.end(cb);
-}
+};
WriteStream.prototype.end = function (cb) {
IncomingMessage.prototype._addHeaderLine = function (field, value) {
var dest;
if (this.complete) {
- dest = this.trailers
+ dest = this.trailers;
} else {
- dest = this.headers
+ dest = this.headers;
}
switch (field) {
// Array headers:
}
this._headerSent = true;
}
- this._writeRaw(data, encoding)
-}
+ this._writeRaw(data, encoding);
+};
OutgoingMessage.prototype._writeRaw = function(data, encoding) {
if (this.connection._outgoing[0] === this && this.connection.writable) {
ServerResponse.prototype.writeContinue = function () {
this._writeRaw("HTTP/1.1 100 Continue" + CRLF + CRLF, 'ascii');
this._sent100 = true;
-}
+};
ServerResponse.prototype.writeHead = function (statusCode) {
var reasonPhrase, headers, headerIndex;
Server.prototype.setSecure = function (credentials) {
this.secure = true;
this.credentials = credentials;
-}
+};
exports.Server = Server;
&& continueExpression.test(req.headers['expect'])) {
res._expect_continue = true;
if (self.listeners("checkContinue").length) {
- self.emit("checkContinue", req, res)
+ self.emit("checkContinue", req, res);
} else {
res.writeContinue();
self.emit('request', req, res);
} else if (self.parser.incoming && self.parser.incoming.upgrade) {
var bytesParsed = ret;
self.ondata = null;
- self.onend = null
+ self.onend = null;
var req = self.parser.incoming;
// All that should be required for keep-alive is to not reconnect,
// but outgoingFlush instead.
if (req.shouldKeepAlive) {
- outgoingFlush(self)
- self._outgoing.shift()
- outgoingFlush(self)
+ outgoingFlush(self);
+ self._outgoing.shift();
+ outgoingFlush(self);
} else {
self.end();
}
remove(socket);
socket._idleNext = list._idleNext;
socket._idleNext._idlePrev = socket;
- socket._idlePrev = list
+ socket._idlePrev = list;
list._idleNext = socket;
}
socket._idlePrev._idleNext = socket._idleNext;
socket._idleNext = list._idleNext;
socket._idleNext._idlePrev = socket;
- socket._idlePrev = list
+ socket._idlePrev = list;
list._idleNext = socket;
}
}
}
self._shutdownImpl = function () {
- shutdown(self.fd, 'write')
+ shutdown(self.fd, 'write');
};
if (self.secure) {
this.type = null;
this.secure = false;
- if (parseInt(fd) >= 0) {
+ if (parseInt(fd, 10) >= 0) {
this.open(fd, type);
} else {
setImplmentationMethods(this);
// If client, trigger handshake
this._checkForSecureHandshake();
}
-}
+};
Stream.prototype.verifyPeer = function () {
throw new Error('Stream is not a secure stream.');
}
return this.secureStream.verifyPeer(this.credentials.context);
-}
+};
Stream.prototype._checkForSecureHandshake = function () {
// Do an empty write to see if we need to write out as part of handshake
if (!emptyBuffer) allocEmptyBuffer();
this.write(emptyBuffer);
-}
+};
Stream.prototype.getPeerCertificate = function (credentials) {
throw new Error('Stream is not a secure stream.');
}
return this.secureStream.getPeerCertificate();
-}
+};
Stream.prototype.getCipher = function () {
throw new Error('Stream is not a secure stream.');
}
return this.secureStream.getCurrentCipher();
-}
+};
Stream.prototype.open = function (fd, type) {
this._writeWatcher.set(this.fd, false, true);
this.writable = true;
-}
+};
exports.createConnection = function (port, host) {
len = data.length;
} else {
- assert(typeof data == 'string')
+ assert(typeof data == 'string');
if (!pool || pool.length - pool.used < kMinPoolSpace) {
pool = null;
}
return false;
-}
+};
// Flushes the write buffer out.
};
}
-function toPort (x) { return (x = Number(x)) >= 0 ? x : false }
+function toPort (x) { return (x = Number(x)) >= 0 ? x : false; }
// var stream = new Stream();
self._connecting = true; // set false in doConnect
- var port = toPort(arguments[0])
+ var port = toPort(arguments[0]);
if (port === false) {
// UNIX
self.fd = socket('unix');
self.addListener('listening', lastArg);
}
- var port = toPort(arguments[0])
+ var port = toPort(arguments[0]);
if (port === false) {
// the first argument specifies a path
self.fd = socket('unix');
Server.prototype._doListen = function () {
listen(this.fd, 128);
this._startWatcher();
-}
+};
&& (prev !== "" || keepBlanks)
) {
directories.pop();
- prev = directories.slice(-1)[0]
+ prev = directories.slice(-1)[0];
} else {
if (prev === ".") directories.pop();
directories.push(directory);
exports.existsSync = function (path) {
try {
- process.binding('fs').stat(path)
+ process.binding('fs').stat(path);
return true;
} catch(e){
return false;
this.enabled = output.fd < 3; // Looks like a TTY.
- if (parseInt(process.env['NODE_NO_READLINE'])) {
+ if (parseInt(process.env['NODE_NO_READLINE'], 10)) {
this.enabled = false;
}
// If there is a common prefix to all matches, then apply that
// portion.
var prefix = commonPrefix(
- completions.filter(function(e) { if (e) return e }));
+ completions.filter(function(e) { if (e) return e; }));
if (prefix.length > completeOn.length) {
self._insertString(prefix.slice(completeOn.length));
}
// Turn on ANSI coloring.
exports.writer = function(obj, showHidden, depth) {
return sys.inspect(obj, showHidden, depth, true);
- }
+ };
}
rli.setPrompt(self.prompt);
"false", "finally", "for", "function", "if", "import", "in",
"instanceof", "let", "new", "null", "return", "switch", "this",
"throw", "true", "try", "typeof", "undefined", "var", "void",
- "while", "with", "yield"])
+ "while", "with", "yield"]);
}
} else {
try {
var execWarning;
exports.exec = function () {
if (!execWarning) {
- execWarning = 'sys.exec has moved to the "child_process" module. Please update your source code.'
+ execWarning = 'sys.exec has moved to the "child_process" module. Please update your source code.';
error(execWarning);
}
return require('child_process').exec.apply(this, arguments);
}
}
- if (!readStream.pause) readStream.pause = function () {readStream.emit("pause")};
- if (!readStream.resume) readStream.resume = function () {readStream.emit("resume")};
+ if (!readStream.pause) readStream.pause = function () {readStream.emit("pause");};
+ if (!readStream.resume) readStream.resume = function () {readStream.emit("resume");};
readStream.addListener("data", function (chunk) {
if (writeStream.write(chunk) === false) readStream.pause();
mustEndAbs = mustEndAbs || (source.host && srcPath.length);
- if (mustEndAbs && srcPath[0] !== "") srcPath.unshift("")
+ if (mustEndAbs && srcPath[0] !== "") srcPath.unshift("");
source.pathname = srcPath.join("/");
function removed (reason) {
return function () {
- throw new Error(reason)
- }
+ throw new Error(reason);
+ };
}
process.debug = removed("process.debug() has moved. Use require('sys') to bring it back.");
function index (ext) { return path.join(dir, id, 'index' + ext); }
inDir = [
function () { return exts.map(direct); },
- function () { return exts.map(index); },
+ function () { return exts.map(index); }
];
head = [path.join(dir, id)];
return next();
// Load the main module--the command line argument.
process.mainModule = new Module(".");
process.mainModule.load(process.argv[1]);
- }
+ };
return exports;
})();
var arr = Array.prototype.slice.call(arguments, 1);
process.assert(false, format.apply(this, arr));
}
-}
+};
global.Buffer = module.requireNative('buffer').Buffer;
common = require("../common");
-assert = common.assert
+assert = common.assert;
var dns = require("dns"),
child_process = require("child_process"),
/* XXX Can this test be modified to not call the now-removed wait()? */
common = require("../common");
-assert = common.assert
+assert = common.assert;
console.log('first stat ...');
common = require("../common");
-assert = common.assert
+assert = common.assert;
tcp = require("tcp");
sys = require("sys");
common = require("../common");
-assert = common.assert
+assert = common.assert;
var sys = require("sys"),
fs = require("fs"),
http = require("http"),
// Produce a very large response.
var chargen = http.createServer(function (req, res) {
- var len = parseInt(req.headers['x-len']);
+ var len = parseInt(req.headers['x-len'], 10);
assert.ok(len > 0);
res.writeHead(200, {"transfer-encoding":"chunked"});
for (var i=0; i<len; i++) {
// Proxy to the chargen server.
var proxy = http.createServer(function (req, res) {
- var c = http.createClient(9000, 'localhost')
+ var c = http.createClient(9000, 'localhost');
- var len = parseInt(req.headers['x-len']);
+ var len = parseInt(req.headers['x-len'], 10);
assert.ok(len > 0);
var sent = 0;
common = require("../common");
-assert = common.assert
+assert = common.assert;
var assert = require("assert");
var http = require("http");
common = require("../common");
-assert = common.assert
+assert = common.assert;
http = require("http");
if (err) {
common.print("-");
} else {
- assert.equal(body, content)
+ assert.equal(body, content);
common.print(".");
requests_ok++;
}
common = require("../common");
-assert = common.assert
+assert = common.assert;
var complete = false;
var idle = new process.IdleWatcher();
if (process.title === '') {
console.log('skipping test -- not implemented for the host platform');
- return;
+ //return;
}
// disabled because of two things
common = require("../common");
-assert = common.assert
+assert = common.assert;
var http = require('http');
var sys = require('sys');
// Requires special privlages
common = require("../common");
-assert = common.assert
+assert = common.assert;
var assert = require('assert');
var oldgid = process.getgid();
common = require("../common");
-assert = common.assert
+assert = common.assert;
var sys=require('sys');
var net=require('net');
var fs=require('fs');
common = require("../common");
-assert = common.assert
+assert = common.assert;
var sys=require('sys');
var net=require('net');
common = require("../common");
-assert = common.assert
+assert = common.assert;
common.print("hello world\r\n");