is(event.target.result, key2, "put gave the same key back");
try {
objectStore.put({});
ok(true, "put with no key should not throw with autoIncrement!");
} catch (e) {
ok(false, "put with no key threw with autoIncrement");
}
try {
objectStore.put({});
ok(true, "put with no key should not throw with autoIncrement!");
} catch (e) {
ok(false, "put with no key threw with autoIncrement");
}
try {
objectStore.delete();
ok(false, "remove with no key should throw!");
} catch (e) {
ok(true, "remove with no key threw");
}
objectStore = db.createObjectStore("bar");
try {
objectStore.add({});
ok(false, "add with no key should throw!");
} catch (e) {
ok(true, "add with no key threw");
}
try {
objectStore.put({});
ok(false, "put with no key should throw!");
} catch (e) {
ok(true, "put with no key threw");
}
try {
objectStore.put({});
ok(false, "put with no key should throw!");
} catch (e) {
ok(true, "put with no key threw");
}
try {
objectStore.delete();
ok(false, "remove with no key should throw!");
} catch (e) {
ok(true, "remove with no key threw");
}
is(event.target.result, key2, "put gave the same key back");
try {
objectStore.put({});
ok(true, "put with no key should not throw with autoIncrement!");
} catch (e) {
ok(false, "put with no key threw with autoIncrement");
}
try {
objectStore.put({});
ok(true, "put with no key should not throw with autoIncrement!");
} catch (e) {
ok(false, "put with no key threw with autoIncrement");
}
try {
objectStore.delete();
ok(false, "remove with no key should throw!");
} catch (e) {
ok(true, "remove with no key threw");
}
try {
objectStore.add({ id: 5 }, 5);
ok(false, "add with inline key and passed key should throw!");
} catch (e) {
ok(true, "add with inline key and passed key threw");
}
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.