diff options
author | Robert Newson <robert.newson@cloudant.com> | 2011-09-28 21:19:15 +0100 |
---|---|---|
committer | Robert Newson <robert.newson@cloudant.com> | 2011-09-28 21:20:19 +0100 |
commit | fc0d25038c76a654ba4a093b6f51949a4821488b (patch) | |
tree | 7ac3fe05d0e7faccbc3f23925b1e611128b31b41 /couchjs | |
parent | 24e1156db042fbcb6a054601f2c18f367ed5389e (diff) | |
parent | 89a5c28775f24f2706f443c76afa3edf9df78ce4 (diff) |
Merge 1.1.x because Paul Davis kept his important bug fix super secret while I was slaving away on this merge for two days.
Diffstat (limited to 'couchjs')
-rw-r--r-- | couchjs/js/util.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/couchjs/js/util.js b/couchjs/js/util.js index 65e3bb06..d498ee64 100644 --- a/couchjs/js/util.js +++ b/couchjs/js/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, { @@ -63,6 +63,11 @@ var Couch = { }, compileFunction : function(source, ddoc) { if (!source) throw(["error","not_found","missing function"]); + // Some newer SpiderMonkey's appear to not like evaluating + // an anonymous function at global scope. Simple fix just + // wraps the source with parens so the function object is + // returned correctly. + source = "(" + source + ")"; try { if (sandbox) { if (ddoc) { |