Re: [heycam/webidl] Exception cleanup (#250)

domenic commented on this pull request.

> I'd be tempted not to export #ecmascript-throw and make everything use #throw instead. (Currently all simple exceptions in the spec reference #ecmascript-throw, which I don't think is the right thing to do.)
We'd then only use the text around #ecmascript-throw in the bindings to describe the behavior of all exceptions (or just simple ones?) in an ES environment. Thoughts?

Sounds good to me. I kind of assumed that was how it worked already. I think the bindings only throw simple errors?

>  and {{DOMException}} which includes just DOMException objects.
 This allows for example an [=operation=]
 to be declared to have a {{DOMException}}
 [=return type=] or an [=attribute=]
 to be of type {{Error!!interface}}.
 
-Exceptions can be <dfn id="dfn-create-exception" for="exception" export>created</dfn> by providing its
-[=error name=].
+[=Simple exceptions=] can be <dfn id="dfn-create-exception" for="exception" export>created</dfn>
+by providing their [=error name=].
+{{DOMException|DOMExceptions}}, by providing their [=error name=] followed by {{DOMException}}.

Grammar is a bit weird. I'd say "DOMExceptions can be created by providing..."

>  
     <blockquote>
-
-        [=Throw=] a TypeError.
-
+        [=Throw=] a <emu-val>TypeError</emu-val>.

So, I think in practice we want specifications to use {{TypeError}}, not `<emu-val>TypeError</emu-val>`. The emu-val is used for the "bindings" sections of specs like Web IDL and ES. So it's a bit confusing since this is the only place in the document that we'd use {{TypeError}}, but I think it makes sense.

-- 
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/250#pullrequestreview-12094984

Received on Thursday, 8 December 2016 19:16:29 UTC