summaryrefslogtreecommitdiff
path: root/share/server/state.js
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-09-27 20:06:22 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-09-27 20:06:22 +0000
commit7665e449cdfff1e660ed2bbac3de4507cb063a18 (patch)
treea3c7994475d955fce448af9a8c60c202c0e92f6e /share/server/state.js
parent6c6db011c2064597526c6f36878a282238dd2bf2 (diff)
CommonJS support in map functions
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001895 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server/state.js')
-rw-r--r--share/server/state.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/server/state.js b/share/server/state.js
index 9af9e475..e6416382 100644
--- a/share/server/state.js
+++ b/share/server/state.js
@@ -14,6 +14,7 @@ var State = {
reset : function(config) {
// clear the globals and run gc
State.funs = [];
+ State.lib = null;
State.query_config = config || {};
init_sandbox();
gc();
@@ -21,7 +22,11 @@ var State = {
},
addFun : function(newFun) {
// Compile to a function and add it to funs array
- State.funs.push(Couch.compileFunction(newFun));
+ State.funs.push(Couch.compileFunction(newFun, {views : {lib : State.lib}}));
+ print("true");
+ },
+ addLib : function(lib) {
+ State.lib = lib;
print("true");
}
}