summaryrefslogtreecommitdiff
path: root/couchjs/js/state.js
diff options
context:
space:
mode:
authorRobert Newson <robert.newson@cloudant.com>2011-06-13 14:59:55 +0100
committerRobert Newson <robert.newson@cloudant.com>2011-06-13 14:59:55 +0100
commite9a5a6f90a021db1db8a7e55ec797a4c86edcad6 (patch)
tree06d0c28969cfcf54b2f137e7407b097f73aa0f21 /couchjs/js/state.js
parent266ba88ac6ded40087e0211ad9e75e4ce64e66cb (diff)
parent3c1a0d7e2c9adef4f8b20c9df205a86e5c0feefb (diff)
Merge CouchDB 1.1
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");
}
}