Commit b5ac2d3b authored by Romain Courteaud's avatar Romain Courteaud

idb: naming convention

parent 3996a11f
......@@ -61,7 +61,7 @@
}
this._database_name = "jio:" + description.database;
this._version = description.version;
this._index_keys = description.index_keys || [];
this._index_key_list = description.index_key_list || [];
}
IndexedDBStorage.prototype.hasCapacity = function (name) {
......@@ -130,9 +130,7 @@
function waitForOpenIndexedDB(storage, callback) {
var request,
db_name = storage._database_name,
version = storage._version,
index_keys = storage._index_keys;
db_name = storage._database_name;
function canceller() {
if ((request !== undefined) && (request.result !== undefined)) {
......@@ -142,7 +140,7 @@
function resolver(resolve, reject) {
// Open DB //
request = indexedDB.open(db_name, version);
request = indexedDB.open(db_name, storage._version);
request.onerror = function (error) {
canceller();
if ((error !== undefined) &&
......@@ -171,7 +169,7 @@
// Create DB if necessary //
request.onupgradeneeded = function (evt) {
handleUpgradeNeeded(evt, index_keys);
handleUpgradeNeeded(evt, storage._index_key_list);
};
request.onversionchange = function () {
......
......@@ -74,7 +74,7 @@
context.jio = jIO.createJIO({
type: "indexeddb",
database: "index2_test",
index_keys: ["a", "b"],
index_key_list: ["a", "b"],
});
stop();
expect(2);
......@@ -100,7 +100,7 @@
context.jio = jIO.createJIO({
type: "indexeddb",
database: "index2_test",
index_keys: ["a", "b"],
index_key_list: ["a", "b"],
});
stop();
expect(2);
......@@ -137,7 +137,7 @@
type: "indexeddb",
database: "index2_test",
version: 1,
index_keys: ["a"]
index_key_list: ["a"]
});
stop();
expect(7);
......@@ -158,7 +158,7 @@
type: "indexeddb",
database: "index2_test",
version: 2,
index_keys: ["a", "b", "c"],
index_key_list: ["a", "b", "c"],
});
})
.then(function () {
......@@ -192,7 +192,7 @@
context.jio = jIO.createJIO({
type: "indexeddb",
database: "index2_test",
index_keys: ["a", "c"],
index_key_list: ["a", "c"],
version: 3
});
})
......
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