couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [3/5] git commit: Remove and fix code to be CouchDB-appropriate
Date Mon, 11 Feb 2013 03:29:11 GMT
Remove and fix code to be CouchDB-appropriate


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7d16962d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7d16962d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7d16962d

Branch: refs/heads/1676-feature-console_log
Commit: 7d16962dcc7851e23510cee3a76494c1e0b358fb
Parents: 946fe33
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Mon Feb 11 02:01:59 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Mon Feb 11 02:02:07 2013 +0000

----------------------------------------------------------------------
 share/server/console.js     |    2 +-
 share/server/nodejs_util.js |   75 --------------------------------------
 2 files changed, 1 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d16962d/share/server/console.js
----------------------------------------------------------------------
diff --git a/share/server/console.js b/share/server/console.js
index 8516cda..011a3d4 100644
--- a/share/server/console.js
+++ b/share/server/console.js
@@ -81,7 +81,7 @@ exports.trace = function(label) {
 exports.assert = function(expression) {
   if (!expression) {
     var arr = Array.prototype.slice.call(arguments, 1);
-    require('assert').ok(false, util.format.apply(this, arr));
+    throw new Error(util.format.apply(this, arr));
   }
 };
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d16962d/share/server/nodejs_util.js
----------------------------------------------------------------------
diff --git a/share/server/nodejs_util.js b/share/server/nodejs_util.js
index c19512f..536f992 100644
--- a/share/server/nodejs_util.js
+++ b/share/server/nodejs_util.js
@@ -62,31 +62,6 @@ exports.format = function(f) {
 };
 
 
-// Mark that a method should not be used.
-// Returns a modified function which warns once by default.
-// If --no-deprecation is set, then it is a no-op.
-exports.deprecate = function(fn, msg) {
-  if (process.noDeprecation === true) {
-    return fn;
-  }
-
-  var warned = false;
-  function deprecated() {
-    if (!warned) {
-      if (process.traceDeprecation) {
-        console.trace(msg);
-      } else {
-        console.error(msg);
-      }
-      warned = true;
-    }
-    return fn.apply(this, arguments);
-  }
-
-  return deprecated;
-};
-
-
 exports.print = function() {
   for (var i = 0, len = arguments.length; i < len; ++i) {
     process.stdout.write(String(arguments[i]));
@@ -455,13 +430,6 @@ function objectToString(o) {
 }
 
 
-exports.p = exports.deprecate(function() {
-  for (var i = 0, len = arguments.length; i < len; ++i) {
-    error(exports.inspect(arguments[i]));
-  }
-}, 'util.p: Use console.error() instead.');
-
-
 function pad(n) {
   return n < 10 ? '0' + n.toString(10) : n.toString(10);
 }
@@ -485,49 +453,6 @@ exports.log = function(msg) {
 };
 
 
-exports.exec = exports.deprecate(function() {
-  return require('child_process').exec.apply(this, arguments);
-}, 'util.exec is now called `child_process.exec`.');
-
-
-exports.pump = function(readStream, writeStream, callback) {
-  var callbackCalled = false;
-
-  function call(a, b, c) {
-    if (callback && !callbackCalled) {
-      callback(a, b, c);
-      callbackCalled = true;
-    }
-  }
-
-  readStream.addListener('data', function(chunk) {
-    if (writeStream.write(chunk) === false) readStream.pause();
-  });
-
-  writeStream.addListener('drain', function() {
-    readStream.resume();
-  });
-
-  readStream.addListener('end', function() {
-    writeStream.end();
-  });
-
-  readStream.addListener('close', function() {
-    call();
-  });
-
-  readStream.addListener('error', function(err) {
-    writeStream.end();
-    call(err);
-  });
-
-  writeStream.addListener('error', function(err) {
-    readStream.destroy();
-    call(err);
-  });
-};
-
-
 /**
  * Inherit the prototype methods from one constructor into another.
  *


Mime
View raw message