couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [33/50] git commit: Allow CommonJS modules to be an empty string.
Date Wed, 26 Oct 2011 18:05:33 GMT
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 <davisp@apache.org>
Authored: Wed Sep 28 01:12:46 2011 +0000
Committer: Paul Joseph Davis <davisp@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, {


Mime
View raw message