Permalink
Browse files

[dist] JSHint compliance

  • Loading branch information...
1 parent f78a417 commit 62aef12674ee7d466238803e0467fa376f7bc922 @indexzero indexzero committed May 27, 2012
Showing with 19 additions and 15 deletions.
  1. +6 −4 lib/buffered-stream.js
  2. +7 −6 lib/core.js
  3. +1 −1 lib/http-stream.js
  4. +1 −1 lib/index.js
  5. +4 −3 lib/response-stream.js
View
@@ -46,7 +46,7 @@ Object.defineProperty(BufferedStream.prototype, 'buffer', {
set: function (value) {
if (!value && this.chunks) {
var self = this;
- this.chunks.forEach(function (c) { self.emit('data', c) })
+ this.chunks.forEach(function (c) { self.emit('data', c) });
this.size = 0;
delete this.chunks;
}
@@ -56,12 +56,14 @@ Object.defineProperty(BufferedStream.prototype, 'buffer', {
});
BufferedStream.prototype.pipe = function () {
- var self = this;
+ var self = this,
+ dest;
+
if (self.resume) {
self.resume();
}
- var dest = stream.Stream.prototype.pipe.apply(self, arguments);
+ dest = stream.Stream.prototype.pipe.apply(self, arguments);
//
// just incase you are piping to two streams, do not emit data twice.
@@ -73,7 +75,7 @@ BufferedStream.prototype.pipe = function () {
}
process.nextTick(function () {
- self.chunks.forEach(function (c) { self.emit('data', c) })
+ self.chunks.forEach(function (c) { self.emit('data', c) });
self.size = 0;
delete self.chunks;
View
@@ -16,7 +16,8 @@ var http = require('http'),
var core = exports;
core.createServer = function (options) {
- var isArray = Array.isArray(options.after);
+ var isArray = Array.isArray(options.after),
+ credentials;
if (!options) {
throw new Error('options is required to create a server');
@@ -27,11 +28,11 @@ core.createServer = function (options) {
before: options.before,
buffer: options.buffer,
//
- // Remark: without new after is a huge memory leak that
+ // Remark: without new after is a huge memory leak that
// pipes to every single open connection
//
- after: isArray && options.after.map(function (a) {
- return new a;
+ after: isArray && options.after.map(function (After) {
+ return new After;
}),
request: req,
response: res,
@@ -45,7 +46,7 @@ core.createServer = function (options) {
routingStream.target.emit('next');
});
});
-
+
req.pipe(routingStream);
}
@@ -54,7 +55,7 @@ core.createServer = function (options) {
throw new Error('Both `options.https.key` and `options.https.cert` are required.');
}
- var credentials = {
+ credentials = {
key: fs.readFileSync(options.https.key),
cert: fs.readFileSync(options.https.cert)
};
View
@@ -15,7 +15,7 @@ var HttpStream = module.exports = function (options) {
options = options || {};
BufferedStream.call(this, options.limit);
- if (options.buffer == false) {
+ if (options.buffer === false) {
this.buffer = false;
}
View
@@ -11,7 +11,7 @@ var union = exports;
//
// Expose version information through `pkginfo`
//
-require('pkginfo')(module, 'version')
+require('pkginfo')(module, 'version');
//
// Expose core union components
View
@@ -15,7 +15,8 @@ var util = require('util'),
//
//
var ResponseStream = module.exports = function (options) {
- var self = this;
+ var self = this,
+ key;
options = options || {};
HttpStream.call(this, options);
@@ -24,7 +25,7 @@ var ResponseStream = module.exports = function (options) {
this.response = options.response;
if (options.headers) {
- for (var key in options.headers) {
+ for (key in options.headers) {
this.response.setHeader(key, options.headers[key]);
}
}
@@ -59,7 +60,7 @@ var ResponseStream = module.exports = function (options) {
self.emit('header');
}
return self._renderHeaders.call(self.response);
- }
+ };
}
};

0 comments on commit 62aef12

Please sign in to comment.