Skip to content

Commit

Permalink
Cleanup constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed May 14, 2013
1 parent dae8b85 commit c6314bf
Show file tree
Hide file tree
Showing 28 changed files with 0 additions and 60 deletions.
2 changes: 0 additions & 2 deletions lib/auth/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ exports = module.exports = internals.Scheme = function (server, options) {
Utils.assert(server, 'Server is required');

this.settings = Utils.clone(options); // Options can be reused

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/auth/bewit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ exports = module.exports = internals.Scheme = function (server, options) {

this.settings = Utils.clone(options);
this.settings.hostHeaderName = this.settings.hostHeaderName || 'host';

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/auth/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ exports = module.exports = internals.Scheme = function (server, options) {
if (typeof this.settings.appendNext === 'boolean') {
this.settings.appendNext = (this.settings.appendNext ? 'next' : '');
}

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/auth/hawk.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ exports = module.exports = internals.Scheme = function (server, options) {

this.settings = Utils.clone(options);
this.settings.hostHeaderName = this.settings.hostHeaderName || 'host';

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ exports = module.exports = internals.Auth = function (server) {
name: null,
mode: 'required'
};

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ internals.Collector = function (options, callback) {
this.length = 0;

this.once('finish', callback);

return this;
};

Utils.inherits(internals.Collector, Stream.Writable);
Expand Down
2 changes: 0 additions & 2 deletions lib/composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ exports = module.exports = internals.Composer = function (manifest) {
}

this._packs = [];

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ exports = module.exports = internals.Pack = function (options) {
}

this._cache = new Catbox.Client(cacheOptions); // Common cache (defaults to memory-based)

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ exports = module.exports = internals.Proxy = function (options, route) {
this.settings.isCustomPostResponse = !!options.postResponse;
this.settings.postResponse = options.postResponse || internals.postResponse; // function (request, settings, response, payload)
this.settings.redirects = options.redirects || false;

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ exports = module.exports = internals.Request = function (server, req, res, optio
};

this._log(['received'], about, now); // Must be last for object to be fully constructed

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/response/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ exports = module.exports = internals.Buffer = function (buffer) {
this.varieties.buffer = true;

this._payload.push(buffer);

return this;
};

Utils.inherits(internals.Buffer, Generic);
2 changes: 0 additions & 2 deletions lib/response/cacheable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ exports = module.exports = internals.Cacheable = function () {
Generic.call(this);
this.variety = 'cacheable';
this.varieties.cacheable = true;

return this;
};

Utils.inherits(internals.Cacheable, Generic);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/cached.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ exports = module.exports = internals.Cached = function (item, ttl) {

Utils.merge(this._flags, item.flags);
this._flags.ttl = ttl;

return this;
};

Utils.inherits(internals.Cached, Generic);
2 changes: 0 additions & 2 deletions lib/response/closed.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ exports = module.exports = internals.Closed = function () {

this.variety = 'closed';
this.varieties = { closed: true };

return this;
};
2 changes: 0 additions & 2 deletions lib/response/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ exports = module.exports = internals.Directory = function (paths, options) {
this._index = options.index === false ? false : true; // Defaults to true
this._listing = !!options.listing; // Defaults to false
this._showHidden = !!options.showHidden; // Defaults to false

return this;
};

Utils.inherits(internals.Directory, Cacheable);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ exports = module.exports = internals.Empty = function () {
Cacheable.call(this);
this.variety = 'empty';
this.varieties.empty = true;

return this;
};

Utils.inherits(internals.Empty, Cacheable);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ exports = module.exports = internals.Error = function (options) {
if (options.type) {
this._headers['Content-Type'] = options.type;
}

return this;
};

Utils.inherits(internals.Error, Obj);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ exports = module.exports = internals.File = function (filePath, options) {

this._filePath = Path.normalize(filePath);
this._mode = options ? options.mode : false;

return this;
};

Utils.inherits(internals.File, StreamResponse);
Expand Down
3 changes: 0 additions & 3 deletions lib/response/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ exports = module.exports = internals.Generic = function () {
this._headers = {};

this._preview = new internals.Peek();

return this;
};


Expand Down Expand Up @@ -279,7 +277,6 @@ internals.Generic.prototype.unstate = function (name) {
internals.Peek = function () {

Stream.Writable.call(this);
return this;
};

Utils.inherits(internals.Peek, Stream.Writable);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ exports = module.exports = internals.Obj = function (object, type, encoding) {

this.raw = object; // Can change if reference is modified
this.update(type, encoding);

return this;
};

Utils.inherits(internals.Obj, Cacheable);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/redirection.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ exports = module.exports = internals.Redirection = function (uri, message, type,

this._code = 302; // Defaults to temporary/rewritable
this.uri(uri);

return this;
};

Utils.inherits(internals.Redirection, Text);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ exports = module.exports = internals.Stream = function (stream) {

this._passThrough = {};
this._setStream(stream);

return this;
};

Utils.inherits(internals.Stream, Generic);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ exports = module.exports = internals.Text = function (text, type, encoding) {
this.varieties.text = true;

this.message(text, type, encoding);

return this;
};

Utils.inherits(internals.Text, Cacheable);
Expand Down
2 changes: 0 additions & 2 deletions lib/response/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ module.exports = internals.View = function (manager, template, context, options)
context: context,
options: options
};

return this;
};

Utils.inherits(internals.View, Cacheable);
Expand Down
2 changes: 0 additions & 2 deletions lib/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ exports = module.exports = internals.Route = function (options, server, env) {
else if (this.settings.handler === 'notFound') {
this.settings.handler = internals.notFound();
}

return this;
};


Expand Down
2 changes: 0 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ module.exports = internals.Server = function (/* host, port, options */) {
if (this.info.port) {
this.info.uri = this.info.protocol + '://' + (this._host || Os.hostname() || 'localhost') + ':' + this.info.port;
}

return this;
};

Utils.inherits(internals.Server, Events.EventEmitter);
Expand Down
2 changes: 0 additions & 2 deletions lib/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ exports = module.exports = internals.Manager = function (options) {

self._engines[extension] = engine;
});

return this;
};


Expand Down
5 changes: 0 additions & 5 deletions test/integration/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,6 @@ describe('Response', function () {

this.issue = issue;
this.request = request;

return this;
};

Hapi.utils.inherits(TestStream, Stream.Readable);
Expand Down Expand Up @@ -980,7 +978,6 @@ describe('Response', function () {

Stream.Readable.call(this);
this.headers = { custom: 'header' };
return this;
};

Hapi.utils.inherits(HeadersStream, Stream.Readable);
Expand Down Expand Up @@ -1019,7 +1016,6 @@ describe('Response', function () {

Stream.Readable.call(this);
this.statusCode = 201;
return this;
};

Hapi.utils.inherits(HeadersStream, Stream.Readable);
Expand Down Expand Up @@ -1098,7 +1094,6 @@ describe('Response', function () {
var TimerStream = function () {

Stream.Readable.call(this);
return this;
};

Hapi.utils.inherits(TimerStream, Stream.Readable);
Expand Down

0 comments on commit c6314bf

Please sign in to comment.