diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-10-07 16:26:44 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-10-07 16:26:44 +0000 |
commit | c9100a152be888507e21a80b8cfcf032fc36c856 (patch) | |
tree | 01272c682d2ccbfb7d242f2c454dd7e43a802ede /share/www/script | |
parent | fdccee2a26b017bd7bf9d78ffb82338e96f57c7a (diff) |
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
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/test/bulk_docs.js | 8 |
1 files changed, 4 insertions, 4 deletions
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"); }; |