This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
What should happen for the following calls? store = db.createObjectStore("mystore", { keyPath: "", autoIncrement: true }); store.add(1); // store an item with key 1 store.add("foo"); // store an item with key "foo" store.add({foo:"bar"}); // throw It seems like if you have a objectStore with an empty keyPath and autoIncrement set to true, you'll either a valid key as the raw value, in which case that value is used as key. Or you'll specify an invalid key as value, in which case we should throw since it's not a valid key. In neither case would we actually use the key generator. It seems to me that the simplest solution is to not allow an empty keyPath and autoIncrement set to true. We would of course still allow no keypath and autoIncrement set to true. I.e. we'd still allow out-of-line keys together with autoIncrement. As well as non-empty keypaths with autoincrement set to true.
Fixed, made it throw.
Section 3.1.5 needs to be updated to reflect the fact that a valid key path can't be an empty string. Currently it says: "A valid key path is either the empty string, a JavaScript identifier, or multiple Javascript identifiers separated by periods"
Empty string is still a valid keyPath, at least for now. You just can't use an empty-string keyPath at the same time as you use a key generator since that is basically useless (see examples in comment 0). The intent of this bug was just to cover the interaction between empty keypaths and autoincrement. If we do end up killing empty keypaths that seems like a separate bug, so closing this for now. If we end up killing empty keypaths i'll open a new bug. Feel free to reopen if you don't agree or if I'm misunderstanding something.