summaryrefslogtreecommitdiff
path: root/share/server/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/server/util.js')
-rw-r--r--share/server/util.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/server/util.js b/share/server/util.js
index e4386701..6afb38b6 100644
--- a/share/server/util.js
+++ b/share/server/util.js
@@ -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) {