diff options
| author | Paul Joseph Davis <davisp@apache.org> | 2009-12-12 23:43:11 +0000 |
|---|---|---|
| committer | Paul Joseph Davis <davisp@apache.org> | 2009-12-12 23:43:11 +0000 |
| commit | f61fbc97b595a52ccd5bddec424d271fe4b8de83 (patch) | |
| tree | de1802761c217b624257c3ff2f62aab9f5e70c93 /share/server/loop.js | |
| parent | 77473d79f5b0d9362fb3b7fb00a5725ad000de12 (diff) | |
Create a new sandbox for each reset.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@890008 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server/loop.js')
| -rw-r--r-- | share/server/loop.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/share/server/loop.js b/share/server/loop.js index ff241eed..33e87c98 100644 --- a/share/server/loop.js +++ b/share/server/loop.js @@ -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 |
