Re: [heycam/webidl] Add an algorithm to create a platform object. (#635)

domenic commented on this pull request.



> @@ -12349,12 +12363,60 @@ It is the responsibility of specifications using Web IDL to state
 which global environment (or, by proxy, which global object) each platform
 object is associated with.
 
+<div algorithm>
+  To <dfn export lt="new|create|create a new|create an object implementing|create an object
+  implementing the interface">create an object implementing the interface</dfn> |interface| in the
+  Realm |realm|, with optional `new.target` value |newTarget|, perform the following steps:
+
+    1.  Assert: |interface| is [=exposed=] in |realm|.
+    1.  Let prototype be the [=interface prototype object=] for |interface| in
+        |realm|.
+    1.  If |newTarget| is provided, then:
+        1.  Issue: If we just pass {{NewTarget}} through in a constructor, would this not
+            always be defined (sometimes to the [=interface object=] itself)?

I don't quite understand the alternate proposal. Can you explain what would be required of spec authors using the "new" construct in your version?

From my perspective, I'm not very concerned with how hard to follow this algorithm is. I'm concerned about users of this algorithm, and ensuring they don't have to pass any explicit information in constructors, and only have to pass one thing (the realm) in other contexts.

-- 
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/635#discussion_r255600440

Received on Monday, 11 February 2019 17:01:22 UTC