You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by cm...@apache.org on 2008/08/11 17:05:37 UTC

svn commit: r684770 - in /incubator/couchdb/branches/0.8.x: ./ CHANGES share/server/main.js share/www/script/couch_tests.js

Author: cmlenz
Date: Mon Aug 11 08:05:36 2008
New Revision: 684770

URL: http://svn.apache.org/viewvc?rev=684770&view=rev
Log:
Merged revisions 684023-684091,684093-684762 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/couchdb/trunk

........
  r684023 | damien | 2008-08-08 19:46:48 +0200 (Fr, 08 Aug 2008) | 1 line
  
  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.
........
  r684762 | cmlenz | 2008-08-11 16:44:09 +0200 (Mo, 11 Aug 2008) | 1 line
  
  Updated changelog for r684023, which disabled doc sealing in the JS view server.
........

Modified:
    incubator/couchdb/branches/0.8.x/   (props changed)
    incubator/couchdb/branches/0.8.x/CHANGES
    incubator/couchdb/branches/0.8.x/share/server/main.js
    incubator/couchdb/branches/0.8.x/share/www/script/couch_tests.js

Propchange: incubator/couchdb/branches/0.8.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Aug 11 08:05:36 2008
@@ -1 +1 @@
-/incubator/couchdb/trunk:1-668227,668231-668248,668269-670737,670739-671610,673634-673777,673779-674333,674335-675698,675700-677086,677088-679850,680796-681852
+/incubator/couchdb/trunk:1-668227,668231-668248,668269-670737,670739-671610,673634-673777,673779-674333,674335-675698,675700-677086,677088-679850,680796-681852,684023-684091,684093-684762

Modified: incubator/couchdb/branches/0.8.x/CHANGES
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/0.8.x/CHANGES?rev=684770&r1=684769&r2=684770&view=diff
==============================================================================
--- incubator/couchdb/branches/0.8.x/CHANGES (original)
+++ incubator/couchdb/branches/0.8.x/CHANGES Mon Aug 11 08:05:36 2008
@@ -27,10 +27,11 @@
 
 Javascript View Server:
 
- * Fix for sealing of nested data structure in documents in the Javascript view
-   server.
+ * Sealing of documents has been disabled due to an incompatibility with
+   SpiderMonkey 1.9.
  * Improve error handling for undefined values emitted by map functions.
    (COUCHDB-83)
+ 
 
 Packaging and System Integration:
 

Modified: incubator/couchdb/branches/0.8.x/share/server/main.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/0.8.x/share/server/main.js?rev=684770&r1=684769&r2=684770&view=diff
==============================================================================
--- incubator/couchdb/branches/0.8.x/share/server/main.js [utf-8] (original)
+++ incubator/couchdb/branches/0.8.x/share/server/main.js [utf-8] Mon Aug 11 08:05:36 2008
@@ -74,7 +74,19 @@
         // ]
         //
         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 = [];

Modified: incubator/couchdb/branches/0.8.x/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/0.8.x/share/www/script/couch_tests.js?rev=684770&r1=684769&r2=684770&view=diff
==============================================================================
--- incubator/couchdb/branches/0.8.x/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/branches/0.8.x/share/www/script/couch_tests.js [utf-8] Mon Aug 11 08:05:36 2008
@@ -916,7 +916,7 @@
 
     var doc = {integer: 1, string: "1", array: [1, 2, 3]};
     T(db.save(doc).ok);
-
+/*
     // make sure that attempting to change the document throws an error
     var results = db.query(function(doc) {
       doc.integer = 2;
@@ -929,7 +929,7 @@
       emit(null, doc);
     });
     T(results.total_rows == 0);
-
+*/
     // make sure that a view cannot invoke interpreter internals such as the
     // garbage collector
     var results = db.query(function(doc) {