Re: [w3c/IndexedDB] Use StructuredSerialize/StructuredDeserialize (#171)

inexorabletash commented on this pull request.



> @@ -5816,7 +5868,8 @@ follows.
     to=] |key|, then remove the [=object-store/record=] from |store| using the
     steps to [=delete records from an object store=].
 
-4. Store a record in |store| containing |key| as its key and |value|
+4. Store a record in |store| containing |key| as its key and
+    <a abstract-op>StructuredSerialize</a>(|value|)

That should get a `!` sigil. At this point there are several layers of spec fiction happening. It's "safe" because this is operating on the clone made into a user-agent-defined Realm which has only been mutated by the previous steps. 

In Blink, at least, since these steps are running in a process w/o a JS implementation, we actually do a bunch of the work (computing index keys) earlier, and some of the work (injecting generated keys) lazily when the values are later retrieved! Single-process implementations probably work more like the spec does (or have observable behavior differences/bugs), but I haven't looked at the code for any recently.

@domenic - I'll try and grab time with you to discuss some of this in real-time; I think we're hitting the limits of communicating through the peephole of review comments. :) Obviously the specs should be free of assumptions, but getting some advice on approaches for spec fiction would be swell. That wouldn't be in lieu reviews for actual changes, of course.

-- 
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/pull/171#discussion_r107741425

Received on Thursday, 23 March 2017 18:01:39 UTC