Commit 13aa9c7b authored by Romain Courteaud's avatar Romain Courteaud

Lint: do not redefine the same variable

parent 82ac0448
......@@ -140,8 +140,9 @@
that._key, buf);
})
.push(function (coded) {
var blob = new Blob([initializaton_vector, coded], {type: MIME_TYPE});
return that._sub_storage.putAttachment(id, name, blob);
var final_blob = new Blob([initializaton_vector, coded],
{type: MIME_TYPE});
return that._sub_storage.putAttachment(id, name, final_blob);
});
};
......
......@@ -185,7 +185,7 @@
var i,
attachment = {},
id,
new_id,
attachment_list = new DOMParser().parseFromString(
response.target.responseText,
"text/xml"
......@@ -196,11 +196,11 @@
// exclude parent folder and browse
for (i = 1; i < attachment_list.length; i += 1) {
// XXX Only get files for now
id = attachment_list[i].querySelector("D\\:href, href").
new_id = attachment_list[i].querySelector("D\\:href, href").
textContent.split('/').slice(-1)[0];
// XXX Ugly
if ((id !== undefined) && (id !== "")) {
attachment[id] = {};
if ((new_id !== undefined) && (new_id !== "")) {
attachment[new_id] = {};
}
}
return attachment;
......
......@@ -292,9 +292,9 @@
return jIO.util.readBlobAsText(error.target.response);
})
.push(function (evt) {
var err_content = JSON.parse(evt.target.result);
if ((err_content.error['.tag'] === 'path') &&
(err_content.error.path['.tag'] === 'not_found')) {
var err_content2 = JSON.parse(evt.target.result);
if ((err_content2.error['.tag'] === 'path') &&
(err_content2.error.path['.tag'] === 'not_found')) {
throw new jIO.util.jIOError("Cannot find attachment: " +
id + "/, " + name, 404);
}
......
......@@ -70,12 +70,12 @@
expect(2);
stop();
var test = this;
var that = this;
this.jio.put("put1", {"title": "myPut1"})
.then(function (uuid) {
equal(uuid, "put1");
deepEqual(test.jio.__storage._database.put1, {
deepEqual(that.jio.__storage._database.put1, {
attachments: {},
doc: "{\"title\":\"myPut1\"}"
});
......@@ -90,7 +90,7 @@
test("put when document already exists", function () {
var id = "put1",
test = this;
that = this;
this.jio.__storage._database[id] = {
"foo": "bar",
"attachments": {"foo": "bar"},
......@@ -102,7 +102,7 @@
this.jio.put(id, {"title": "myPut2"})
.then(function (uuid) {
equal(uuid, "put1");
deepEqual(test.jio.__storage._database.put1, {
deepEqual(that.jio.__storage._database.put1, {
"foo": "bar",
"attachments": {"foo": "bar"},
doc: "{\"title\":\"myPut2\"}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment