Re: [w3c/IndexedDB] Simplify "steps for storing a record into an object store"? (#144)

>  ...having IDBCursor.update set _key_ to _kpk_...

This is not needed, as that block is responsible just checking that the extracted _key_ equals _effective key_. If not equal, the steps abort since `update()` is not allowed to modify a key. And_effective key_ is already passed as _key_. 

But agreed, step 1 in "steps for storing a record into an object store" is redundant.

----

> ... according to the key ...

Yep, will fix.

----

> ... value is finite ...

Wow, great catch. We don't appear to have web-platform-tests for this case. Chrome behaves as you suggest. Firefox fails dramatically on the next two puts - first a negative key then ConstraintError. Safari resets the key generator! Note that _finite_ is insufficient; behavior goes weird when above MAX_SAFE_INTEGER. I'll file a separate bug for this to get consensus on behavior.

-----

> ...exception is thrown in inject a key into a value using a key path...

Another good catch. This should never throw; the operation is run asynchronously so it doesn't make sense. The check needs to be pulled out and made explicit.

-----

> ...running the steps to convert a key to a value.

Will fix.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/144#issuecomment-279527618

Received on Monday, 13 February 2017 21:27:54 UTC