Re: [whatwg/webidl] Normative: Add DOMException cause (PR #1179)

@domenic commented on this pull request.



>  constructor steps are:
 
-1. Set [=this=]'s [=DOMException/name=] to |name|.
-1. Set [=this=]'s [=DOMException/message=] to |message|.
+1.  Set [=this=]'s [=DOMException/message=] to |message|.
+1.  If |options| is a string, then set [=this=]'s [=DOMException/name=] to |options|.
+1.  Otherwise,
+    1.  Set [=this=]'s [=DOMException/name=] to |options|["{{DOMExceptionOptions/name}}"].
+    1.  Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |options|).

You can use `[=this=]` and assume it refers to an ES object. Technically it is defined to refer to an ES object, but in general we have let it be used both ways in some cases like this. (My personal rule is: if the IDL value type is `any` or `object`, then you can assume implicit conversions, since the conversions are trivial. That is why I am less comfortable with `|options|`, since it is a dictionary type and dictionary conversions are not trivial.)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1179#discussion_r962466039
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1179/review/1095833124@github.com>

Received on Monday, 5 September 2022 04:27:47 UTC