couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1176678 - in /couchdb/branches/1.2.x: ./ etc/default/couchdb share/server/util.js
Date Wed, 28 Sep 2011 01:14:16 GMT
Author: davisp
Date: Wed Sep 28 01:14:16 2011
New Revision: 1176678

URL: http://svn.apache.org/viewvc?rev=1176678&view=rev
Log:
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
Backport of r1176677 from trunk


Modified:
    couchdb/branches/1.2.x/   (props changed)
    couchdb/branches/1.2.x/etc/default/couchdb   (props changed)
    couchdb/branches/1.2.x/share/server/util.js

Propchange: couchdb/branches/1.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 01:14:16 2011
@@ -6,4 +6,4 @@
 /couchdb/branches/list-iterator:782292-784593
 /couchdb/branches/tail_header:775760-778477
 /couchdb/tags/0.10.0:825400
-/couchdb/trunk:1176666
+/couchdb/trunk:1176666,1176677

Propchange: couchdb/branches/1.2.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 01:14:16 2011
@@ -6,5 +6,5 @@
 /couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
 /couchdb/branches/tail_header/etc/default/couchdb:775760-778477
 /couchdb/tags/0.10.0/etc/default/couchdb:825400
-/couchdb/trunk/etc/default/couchdb:1176666
+/couchdb/trunk/etc/default/couchdb:1176666,1176677
 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440

Modified: couchdb/branches/1.2.x/share/server/util.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.2.x/share/server/util.js?rev=1176678&r1=1176677&r2=1176678&view=diff
==============================================================================
--- couchdb/branches/1.2.x/share/server/util.js (original)
+++ couchdb/branches/1.2.x/share/server/util.js Wed Sep 28 01:14:16 2011
@@ -46,7 +46,7 @@ var resolveModule = function(names, mod,
   } 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