Permalink
Browse files

Properly handle missing language definitions

  • Loading branch information...
jhs committed Feb 21, 2011
1 parent 08a8fbe commit 2a687d557adaade9171de42dfd5d2531f4e78ee1
Showing with 5 additions and 0 deletions.
  1. +5 −0 audit_couchdb.js
View
@@ -48,6 +48,11 @@ function CouchAudit(url) {
var ddoc_url = lib.join(db_url, ddoc._id);
ddocs_in_db[db_url].push(ddoc);
+ if(typeof ddoc.language === 'undefined') {
+ self.low('No language defined (assuming "javascript"): ' + ddoc_url);
+ ddoc.language = 'javascript';
+ }
+
if(ddoc.language !== info.view_index.language)
throw new Error("Different languages in ddoc vs. index info: " + JSON.stringify(info) + " vs. language = " + JSON.stringify(ddoc.language));

0 comments on commit 2a687d5

Please sign in to comment.