Re: [heycam/webidl] Define [[OwnPropertyKeys]] of legacy platform objects (#402)

tobie commented on this pull request.



> -1.  Finally, any enumerable own properties or properties from the object’s prototype chain are then enumerated,
-    in no defined order.
-
-Note: Future versions of the ECMAScript specification may define a total order for property enumeration.
+<div algorithm="to invoke the internal [[OwnPropertyKeys]] method of legacy platform objects">
+
+    When the \[[OwnPropertyKeys]] internal method of a [=legacy platform object=] |O| is called,
+    the following steps are taken:
+
+    1.  Let |keys| be a new empty [=list=] of ECMAScript String and Symbol values.
+    1.  If |O| [=support indexed properties|supports indexed properties=], then [=list|for each=] |index| of |O|’s
+        [=supported property indices=], in ascending numerical order, [=list|append=] [=!=] [=ToString=](|index|) to
+        |keys|.
+    1.  If |O| [=support named properties|supports named properties=], then [=list|for each=] |P| of |O|’s
+        [=supported property names=] that is visible according to the [=named property visibility algorithm=],
+        [=list|append=] |P| to |keys|.

Oh, right. That's the order in which they're spec'ed. In one of the [toJSON-related algorithms](https://heycam.github.io/webidl/#collect-attribute-values) we write this as:

```
If a toJSON operation with a [Default] extended attribute is declared on |I|,
then for each exposed regular attribute |attr| that is an interface member of |I|,
in order:
```
Maybe just add `in order, ` before `[=list|append=] |P| to |keys|`?


-- 
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/402#discussion_r131707311

Received on Monday, 7 August 2017 16:54:52 UTC