Re: [heycam/webidl] Replace serializers by toJSON and [Default] extended attribute (#323)

domenic commented on this pull request.



> +
+    To invoke the <dfn>collect attribute values</dfn> abstract operation
+    with [=stack=] |stack| and [=ordered map=] |map| as arguments,
+    run the the following steps:
+
+    1.  Let |I| be the result of invoking [=stack/pop=] from |stack|.
+    1.  [=list|For each=] [=implements statements=] where the left-hand side [=identifier=] references |I|:
+        1.  Let |rhs| be the [=interface=] represented by the right-hand side [=identifier=].
+        1.  Let |interfaces| be the result of [=create an inheritance stack|creating an inheritance stack=]
+            for [=interface=] |rhs|.
+        1.  invoke [=collect attribute values=], passing it |interfaces| and |map|.
+    1.  If a “toJSON” operation with a [{{Default}}] [=extended attribute=] is declared on |I|, then
+        [=list|for each=] [=exposed=] [=regular attribute=] |attr|
+        that is an [=interface member=] of |I|, in order:
+        1.  Let |id| be the [=identifier=] of |attr|.
+        1.  Let |value| be the underlying value of |attr|.

It looks like in the latest spec revision includes two steps for getting _value_, one old and one new; so we should fix that.

As for the abstraction: I don't think there's a need for separate let/return steps, or for the interface I. So I'd phrase this as:

> To **get the underlying value** of an attribute _attr_, return the result of performing the actions listed in the description of _attr_ that occur on getting, or those listed in the description of the inherited attribute, if _attr_ is declared to inherit its getter.

But we could leave that for later.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/323#discussion_r116624937

Received on Monday, 15 May 2017 23:31:02 UTC