lib: use triple equals
authorYuki KAN <re@pixely.jp>
Sat, 1 Mar 2014 02:09:29 +0000 (11:09 +0900)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 2 Apr 2014 09:12:18 +0000 (02:12 -0700)
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
lib/_http_client.js
lib/_http_outgoing.js
lib/_http_server.js
lib/url.js
lib/util.js

index e0ce29b..50f10d1 100644 (file)
@@ -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');
index 25786ed..3d87702 100644 (file)
@@ -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';
index eab7d64..934a21e 100644 (file)
@@ -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();
 
index 887ac0c..f277da0 100644 (file)
@@ -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);
index 500c1d1..25220e8 100644 (file)
@@ -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];
   }