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

domenic approved this pull request.

Mostly LGTM as a first step.

> @@ -28,6 +28,12 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
     urlPrefix: dom.html
         type: interface
             text: Document; url: document
+    urlPrefix: infrastructure.html

All of these should link automatically without having to be added here. Are they not?

>      Rethrow any exceptions.
 
+    <details class=note>
+      <summary>Why create a copy of the value?</summary>
+      The value must be serialized when stored. Treating it as a copy
+      here allows other algorithms in this specification to treat it as
+      an ECMAScript value, but implementations may optimize this
+      if the difference in behavior is not observable.
+    </details>

I do think it'd be ideal to operate on the Records in the spec, although it is interesting that Blink doesn't do that.

It would also allow you to get rid of this user-agent-defined Realm business. Part of the motivation for this overhaul was to allow specs to stop doing that sort of thing.

I can understand wanting to land a minimal version that "un-breaks" the spec first though, so working on that as a follow-up seems OK.

> @@ -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|)

What happens if this throws?

-- 
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#pullrequestreview-28579628

Received on Thursday, 23 March 2017 07:03:10 UTC