You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2009/12/13 00:43:11 UTC
svn commit: r890008 - in /couchdb/trunk/share/server: loop.js state.js
Author: davisp
Date: Sat Dec 12 23:43:11 2009
New Revision: 890008
URL: http://svn.apache.org/viewvc?rev=890008&view=rev
Log:
Create a new sandbox for each reset.
Modified:
couchdb/trunk/share/server/loop.js
couchdb/trunk/share/server/state.js
Modified: couchdb/trunk/share/server/loop.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/server/loop.js?rev=890008&r1=890007&r2=890008&view=diff
==============================================================================
--- couchdb/trunk/share/server/loop.js (original)
+++ couchdb/trunk/share/server/loop.js Sat Dec 12 23:43:11 2009
@@ -12,19 +12,24 @@
var sandbox = null;
-try {
- // if possible, use evalcx (not always available)
- sandbox = evalcx('');
- sandbox.emit = emit;
- sandbox.sum = sum;
- sandbox.log = log;
- sandbox.toJSON = toJSON;
- sandbox.provides = provides;
- sandbox.registerType = registerType;
- sandbox.start = start;
- sandbox.send = send;
- sandbox.getRow = getRow;
-} catch (e) {}
+var init_sandbox = function() {
+ try {
+ // if possible, use evalcx (not always available)
+ sandbox = evalcx('');
+ sandbox.emit = emit;
+ sandbox.sum = sum;
+ sandbox.log = log;
+ sandbox.toJSON = toJSON;
+ sandbox.provides = provides;
+ sandbox.registerType = registerType;
+ sandbox.start = start;
+ sandbox.send = send;
+ sandbox.getRow = getRow;
+ } catch (e) {
+ log(toJSON(e));
+ }
+};
+init_sandbox();
// Commands are in the form of json arrays:
// ["commandname",..optional args...]\n
Modified: couchdb/trunk/share/server/state.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/server/state.js?rev=890008&r1=890007&r2=890008&view=diff
==============================================================================
--- couchdb/trunk/share/server/state.js (original)
+++ couchdb/trunk/share/server/state.js Sat Dec 12 23:43:11 2009
@@ -21,6 +21,7 @@
funs = [];
funsrc = [];
query_config = config;
+ init_sandbox();
gc();
print("true"); // indicates success
},