incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: svn commit: r1005513 - /couchdb/trunk/share/www/script/test/bulk_docs.js
Date Fri, 08 Oct 2010 10:09:55 GMT
On Thu, Oct 7, 2010 at 6:26 PM,  <fdmanana@apache.org> wrote:
> Author: fdmanana
> Date: Thu Oct  7 16:26:44 2010
> New Revision: 1005513
>
> URL: http://svn.apache.org/viewvc?rev=1005513&view=rev
> Log:
> Fix bad JavaScript practices and avoid declaration of 2 global variables.
>
> Modified:
>    couchdb/trunk/share/www/script/test/bulk_docs.js
>
> Modified: couchdb/trunk/share/www/script/test/bulk_docs.js
> URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/bulk_docs.js?rev=1005513&r1=1005512&r2=1005513&view=diff
> ==============================================================================
> --- couchdb/trunk/share/www/script/test/bulk_docs.js (original)
> +++ couchdb/trunk/share/www/script/test/bulk_docs.js Thu Oct  7 16:26:44 2010
> @@ -51,12 +51,12 @@ couchTests.bulk_docs = function(debug) {
>   T(results.length == 5);
>   T(results[0].id == "0");
>   T(results[0].error == "conflict");
> -  T(results[0].rev === undefined); // no rev member when a conflict
> +  T(typeof results[0].rev === "undefined"); // no rev member when a conflict
>
>   // but the rest are not
>   for (i = 1; i < 5; i++) {
>     T(results[i].id == i.toString());
> -    T(results[i].rev)
> +    T(results[i].rev);
>     T(db.open(docs[i]._id) == null);
>   }
>
> @@ -93,8 +93,8 @@ couchTests.bulk_docs = function(debug) {
>   // Regression test for failure on update/delete
>   var newdoc = {"_id": "foobar", "body": "baz"};
>   T(db.save(newdoc).ok);
> -  update = {"_id": newdoc._id, "_rev": newdoc._rev, "body": "blam"};
> -  torem = {"_id": newdoc._id, "_rev": newdoc._rev, "_deleted": true};
> +  var update = {"_id": newdoc._id, "_rev": newdoc._rev, "body": "blam"};
> +  var torem = {"_id": newdoc._id, "_rev": newdoc._rev, "_deleted": true};
>   results = db.bulkSave([update, torem]);
>   T(results[0].error == "conflict" || results[1].error == "conflict");
>  };
>
>
>

In my opinion, you don't need the === in this case imo == is enough
since we compare 2 values, doesn't it ?

- benoît

Mime
View raw message