Re: [heycam/webidl] Throw when not calling interfaces as constructors (#205)

domenic approved this pull request.



>  
 <ol class="algorithm">
     1.  If |I| was not declared with a [{{Constructor}}]
         [=extended attribute=], then
         <a lt="es throw">throw a <emu-val>TypeError</emu-val></a>.
+    1.  If |newTarget| is <emu-val>undefined</emu-val>, then

ES notation is just "NewTarget", not "|newTarget|".

> @@ -10366,13 +10368,11 @@ is the [=interface=]:
         |I|.
 </ol>
 
-If the internal \[[Call]] method
-of the [=interface object=]
-returns normally, then it must
-return an object that implements interface |I|.
+If evaluating the [=function object=] |F| returns normally,
+then it must return an object that implements interface |I|.

Hmm. This requirement is a little strange, both before and after. I think what it is trying to say is instead "If the actions listed in the description of _constructor_ return normally, then they must return an object that implements interface _I_."

>  
-The internal \[[Call]] method
-of the interface object behaves as follows, assuming
-|arg|<sub>0..|n|−1</sub> is the list
-of argument values passed to the constructor, and |I|
-is the [=interface=]:
+Interfaces that do not have a constructor will throw

Maybe "interfaces that are not declared with a [Constructor] extended attribute will throw when called, both as a function and as a constructor."

-- 
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/205#pullrequestreview-5696504

Received on Tuesday, 25 October 2016 17:10:40 UTC