Browse Source

lib: use triple equals

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
v0.11.13-release
Yuki KAN 11 years ago
committed by Trevor Norris
parent
commit
006d42786e
  1. 4
      lib/_http_client.js
  2. 8
      lib/_http_outgoing.js
  3. 4
      lib/_http_server.js
  4. 2
      lib/url.js
  5. 2
      lib/util.js

4
lib/_http_client.js

@ -386,10 +386,10 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
// but *can* have a content-length which actually corresponds
// to the content-length of the entity-body had the request
// been a GET.
var isHeadResponse = req.method == 'HEAD';
var isHeadResponse = req.method === 'HEAD';
debug('AGENT isHeadResponse', isHeadResponse);
if (res.statusCode == 100) {
if (res.statusCode === 100) {
// restart the parser, as this is a continue message.
delete req.res; // Clear res so that we don't hit double-responses.
req.emit('continue');

8
lib/_http_outgoing.js

@ -228,7 +228,7 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
}
// Date header
if (this.sendDate == true && state.sentDateHeader == false) {
if (this.sendDate === true && state.sentDateHeader === false) {
state.messageHeader += 'Date: ' + utcDate() + CRLF;
}
@ -244,7 +244,7 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
// of creating security liabilities, so suppress the zero chunk and force
// the connection to close.
var statusCode = this.statusCode;
if ((statusCode == 204 || statusCode === 304) &&
if ((statusCode === 204 || statusCode === 304) &&
this.chunkedEncoding === true) {
debug(statusCode + ' response should not use chunked encoding,' +
' closing connection.');
@ -269,8 +269,8 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
}
}
if (state.sentContentLengthHeader == false &&
state.sentTransferEncodingHeader == false) {
if (state.sentContentLengthHeader === false &&
state.sentTransferEncodingHeader === false) {
if (this._hasBody && !this._removedHeader['transfer-encoding']) {
if (this.useChunkedEncodingByDefault) {
state.messageHeader += 'Transfer-Encoding: chunked\r\n';

4
lib/_http_server.js

@ -156,7 +156,7 @@ ServerResponse.prototype.assignSocket = function(socket) {
};
ServerResponse.prototype.detachSocket = function(socket) {
assert(socket._httpMessage == this);
assert(socket._httpMessage === this);
socket.removeListener('close', onServerResponseClose);
socket._httpMessage = null;
this.socket = this.connection = null;
@ -467,7 +467,7 @@ function connectionListener(socket) {
// Usually the first incoming element should be our request. it may
// be that in the case abortIncoming() was called that the incoming
// array will be empty.
assert(incoming.length == 0 || incoming[0] === req);
assert(incoming.length === 0 || incoming[0] === req);
incoming.shift();

2
lib/url.js

@ -610,7 +610,7 @@ Url.prototype.resolveObject = function(relative) {
var up = 0;
for (var i = srcPath.length; i >= 0; i--) {
last = srcPath[i];
if (last == '.') {
if (last === '.') {
srcPath.splice(i, 1);
} else if (last === '..') {
srcPath.splice(i, 1);

2
lib/util.js

@ -338,7 +338,7 @@ function formatValue(ctx, value, recurseTimes) {
base = ' ' + '[Boolean: ' + formatted + ']';
}
if (keys.length === 0 && (!array || value.length == 0)) {
if (keys.length === 0 && (!array || value.length === 0)) {
return braces[0] + base + braces[1];
}

Loading…
Cancel
Save