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

TimothyGu commented on this pull request.



> +
+    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|.
+    1.  [=list|For each=] |P| of |O|’s own property keys that is a String, in ascending chronological order of
+        property creation, [=list|append=] |P| to |keys|.
+    1.  [=list|For each=] |P| of |O|’s own property keys that is a Symbol, in ascending chronological order of
+        property creation, [=list|append=] |P| to |keys|.
+    1.  Assert: |keys| has no duplicate items.

(Assuming you meant ordered set...) ES uses a plain List, and it would actually be a specification error if there are duplicates, since the named property visibility algorithm should filter out any supported property names that are also own properties on the object (or in its prototype chain).

-- 
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_r131628866

Received on Monday, 7 August 2017 11:12:47 UTC