summaryrefslogtreecommitdiff
path: root/couchjs/js/state.js
diff options
context:
space:
mode:
Diffstat (limited to 'couchjs/js/state.js')
-rw-r--r--couchjs/js/state.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/couchjs/js/state.js b/couchjs/js/state.js
index 9af9e475..e6416382 100644
--- a/couchjs/js/state.js
+++ b/couchjs/js/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");
}
}