Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Allow CommonJS modules to be an empty string.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davisp committed Sep 28, 2011
1 parent 293ae22 commit 2c381d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion share/server/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 2c381d8

Please sign in to comment.