summaryrefslogtreecommitdiff
path: root/share/server/loop.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/server/loop.js')
-rw-r--r--share/server/loop.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/share/server/loop.js b/share/server/loop.js
index 84e35dc5..d2a07f61 100644
--- a/share/server/loop.js
+++ b/share/server/loop.js
@@ -20,11 +20,13 @@ function init_sandbox() {
sandbox.sum = Views.sum;
sandbox.log = log;
sandbox.toJSON = Couch.toJSON;
+ sandbox.JSON = JSON;
sandbox.provides = Mime.provides;
sandbox.registerType = Mime.registerType;
sandbox.start = Render.start;
sandbox.send = Render.send;
sandbox.getRow = Render.getRow;
+ sandbox.isArray = isArray;
} catch (e) {
log(e.toSource());
}
@@ -73,7 +75,7 @@ var DDoc = (function() {
if (i+1 == funPath.length) {
fun = point[funPath[i]]
if (typeof fun != "function") {
- fun = Couch.compileFunction(fun);
+ fun = Couch.compileFunction(fun, ddoc);
// cache the compiled fun on the ddoc
point[funPath[i]] = fun
};
@@ -99,6 +101,7 @@ var Loop = function() {
// "view" : Views.handler,
"reset" : State.reset,
"add_fun" : State.addFun,
+ "add_lib" : State.addLib,
"map_doc" : Views.mapDoc,
"reduce" : Views.reduce,
"rereduce" : Views.rereduce