summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2011-09-28 01:12:46 +0000
committerPaul Joseph Davis <davisp@apache.org>2011-09-28 01:12:46 +0000
commit2c381d807eca961b2372adeec69f7b9bab477f54 (patch)
tree03155b4e93a36f685b1ba654aa37dade1fe96f24
parent293ae2236859629a6dabc3727d0ccca977b8a8f8 (diff)
downloadcouchdb-2c381d807eca961b2372adeec69f7b9bab477f54.tar.gz
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
-rw-r--r--share/server/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/server/util.js b/share/server/util.js
index 476f283a4..9991a1a80 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, {