summaryrefslogtreecommitdiff
path: root/share/server/util.js
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-23 16:38:37 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-23 16:38:37 +0000
commitbdc029ff820f44b1c39021298edc53c013fa85b2 (patch)
tree4732dd504a01e353a559a3d2578ba02c382cc89b /share/server/util.js
parentb790bfba46770cd97d4dd6ed5177901b79ad495c (diff)
Merged revision 1038193 from trunk:
Seal documents before passing them to map functions (JavaScript view server only). This prevents one map function from modifying a document before it's passed to another map function. Has no effect on array fields for some Spidermonkey versions (see https://bugzilla.mozilla.org/show_bug.cgi?id=449657). Closes COUCHDB-925. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038195 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server/util.js')
-rw-r--r--share/server/util.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/server/util.js b/share/server/util.js
index 1b57f041..c5e89f3d 100644
--- a/share/server/util.js
+++ b/share/server/util.js
@@ -96,7 +96,13 @@ var Couch = {
},
recursivelySeal : function(obj) {
// seal() is broken in current Spidermonkey
- seal(obj);
+ try {
+ seal(obj);
+ } catch (x) {
+ // Sealing of arrays broken in some SpiderMonkey versions.
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=449657
+ return;
+ }
for (var propname in obj) {
if (typeof obj[propname] == "object") {
arguments.callee(obj[propname]);