let event = yield undefined;
is(event.type, "upgradeneeded", "Expect an upgradeneeded event");
is(event.target, request, "Event should be fired on the request");
ok(event.target.result instanceof IDBDatabase, "Expect a database here");
let db = event.target.result;
is(db.version, 1, "Database has correct version");
db.onupgradeneeded = function () {
ok( false, "our ongoing VERSION_CHANGE transaction should exclude any others!"
);
};
db.createObjectStore("foo");
try {
db.transaction("foo");
ok(false, "Transactions should be disallowed now!");
} catch (e) {
ok(e instanceof DOMException, "Expect a DOMException");
is(e.name, "InvalidStateError", "Expect an InvalidStateError");
is(e.code, DOMException.INVALID_STATE_ERR, "Expect an INVALID_STATE_ERR");
}
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.