try {
request = db.transaction([osName]).objectStore(osName).add({});
ok(false, "Adding to a readonly transaction should fail!");
} catch (e) {
ok(true, "Adding to a readonly transaction failed");
}
try {
request = db.transaction(osName).objectStore(osName).add({});
ok(false, "Adding to a readonly transaction should fail!");
} catch (e) {
ok(true, "Adding to a readonly transaction failed");
}
try {
request = db.transaction([osName]).objectStore(osName).put({});
ok(false, "Adding or modifying a readonly transaction should fail!");
} catch (e) {
ok(true, "Adding or modifying a readonly transaction failed");
}
try {
request = db.transaction(osName).objectStore(osName).put({});
ok(false, "Adding or modifying a readonly transaction should fail!");
} catch (e) {
ok(true, "Adding or modifying a readonly transaction failed");
}
try {
request = db.transaction([osName]).objectStore(osName).put({}, key1);
ok(false, "Modifying a readonly transaction should fail!");
} catch (e) {
ok(true, "Modifying a readonly transaction failed");
}
try {
request = db.transaction(osName).objectStore(osName).put({}, key1);
ok(false, "Modifying a readonly transaction should fail!");
} catch (e) {
ok(true, "Modifying a readonly transaction failed");
}
try {
request = db.transaction([osName]).objectStore(osName).delete(key1);
ok(false, "Removing from a readonly transaction should fail!");
} catch (e) {
ok(true, "Removing from a readonly transaction failed");
}
try {
request = db.transaction(osName).objectStore(osName).delete(key2);
ok(false, "Removing from a readonly transaction should fail!");
} catch (e) {
ok(true, "Removing from a readonly transaction failed");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.