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

domenic commented on this pull request.

I like the asserts. Just minor things left.

>  
-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 are not declared with a [Constructor] extended attribute will throw when called,

Link `[{{Constructor}}]`

> @@ -10361,19 +10363,12 @@ is the [=interface=]:
         [=overload resolution algorithm=].
     1.  Let |R| be the result of performing the actions listed in the description of
         |constructor| with |values| as the argument values.
+    1.  Assert: |R| is an object that implements |I|.

Hmm. I think at this point |R| is a completion value, so this doesn't quite work. You'll want to add a step before the asserts that simply says "ReturnIfAbrupt(R)."

For further clarity, maybe add ", as a [=completion value=]" to the "Let R be the result..." step.

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

Received on Wednesday, 26 October 2016 01:24:02 UTC