From c9100a152be888507e21a80b8cfcf032fc36c856 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Thu, 7 Oct 2010 16:26:44 +0000 Subject: Fix bad JavaScript practices and avoid declaration of 2 global variables. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1005513 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/bulk_docs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/www/script/test/bulk_docs.js b/share/www/script/test/bulk_docs.js index fb0dfc90..9095e6b3 100644 --- a/share/www/script/test/bulk_docs.js +++ b/share/www/script/test/bulk_docs.js @@ -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"); }; -- cgit v1.2.3