summaryrefslogtreecommitdiff
path: root/share/server
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-08-08 17:46:48 +0000
committerDamien F. Katz <damien@apache.org>2008-08-08 17:46:48 +0000
commita33cf09319d0b174ec9c509c815da160b7091ab3 (patch)
treec80e75dfba3b7204968ee5a5b938943cfed1a2c1 /share/server
parent986302c54df1bdb4be3dc1d1a4d5a9f34e6af50d (diff)
COUCHDB-103 Fixed incompatibilty with new javascript (1.8) that no longer supports sealing document, making them immutable. The problem is arrays can no longer be sealed, and an error is generated when it is attempted. The fix here is to simply remove the document sealing, and map function placed in the same design document will have to be trustworthy that they don't modify the document (the same document is passed to multiple map functions). Non-trustworthy map functions can be placed in their own design documents, they will be run in isolation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@684023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server')
-rw-r--r--share/server/main.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/share/server/main.js b/share/server/main.js
index ddf2a3af..df184c1c 100644
--- a/share/server/main.js
+++ b/share/server/main.js
@@ -74,7 +74,19 @@ while (cmd = eval(readline())) {
// ]
//
var doc = cmd[1];
+ /*
+ Immutable document support temporarily removed.
+
+ Removed because the seal function no longer works on JS 1.8 arrays,
+ instead returning an error. The sealing is meant to prevent map
+ functions from modifying the same document that is passed to other map
+ functions. However, only map functions in the same design document are
+ run together, so we have a reasonable expectation they can trust each
+ other. Any map fun that can't be trusted can be placed in its own
+ design document, and it cannot affect other map functions.
+
recursivelySeal(doc); // seal to prevent map functions from changing doc
+ */
var buf = [];
for (var i = 0; i < funs.length; i++) {
map_results = [];