You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2011/10/26 20:05:33 UTC

[33/50] git commit: Allow CommonJS modules to be an empty string.

Allow CommonJS modules to be an empty string.

We were making a typical JavaScript mistake testing a module for
truthiness instead of checking that it was undefined.

Fixes COUCHDB-1223



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1176677 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/1319-large-headers-are-corrupted
Commit: 2c381d807eca961b2372adeec69f7b9bab477f54
Parents: 293ae22
Author: Paul Joseph Davis <da...@apache.org>
Authored: Wed Sep 28 01:12:46 2011 +0000
Committer: Paul Joseph Davis <da...@apache.org>
Committed: Wed Sep 28 01:12:46 2011 +0000

----------------------------------------------------------------------
 share/server/util.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2c381d80/share/server/util.js
----------------------------------------------------------------------
diff --git a/share/server/util.js b/share/server/util.js
index 476f283..9991a1a 100644
--- a/share/server/util.js
+++ b/share/server/util.js
@@ -46,7 +46,7 @@ var resolveModule = function(names, mod, root) {
   } else if (root) {
     mod = {current : root};
   }
-  if (!mod.current[n]) {
+  if (mod.current[n] === undefined) {
     throw ["error", "invalid_require_path", 'Object has no property "'+n+'". '+JSON.stringify(mod.current)];
   }
   return resolveModule(names, {