fix(webapi): correct binding nullability and exception contracts [Codex] - #349
fix(webapi): correct binding nullability and exception contracts [Codex]#349jderochervlk wants to merge 5 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a11e7cfb79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbe9c53735
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
That's a bit unfortunate. Is The other stuff is great. Makes me want to first-class the throws annotation into the compiler itself to actually always know when a JS function throws an exception. |
|
Here's the explanation from Codex: Yes, element->HTMLElement.setHidden(HTMLElement.Hidden)
A variant handles the semantic states, and that is what I added this explanation to the PR description: Hidden property. |
|
Updated this after exploring the alternatives. element->HTMLElement.setHidden(HTMLElement.Hidden)Because We have now removed The updated rationale and usage example are in the |
Summary
@throws(JsExn)where synchronous browser APIs can raise exceptions.HTMLElement.hiddenwith the semantic statesVisible,Hidden, andHiddenUntilFound, without a raw coercion API.HTMLElement.hiddenThe getter and setter use the same semantic type:
Because
setHiddenis an@setexternal, these calls emit direct property assignments such aselement.hidden = true.An earlier version also exposed
hiddenInputandsetHiddenRawto mirror every Web IDL setter input. Those were removed because numbers, arbitrary strings,null, andundefinedonly invoke coercion and do not represent additional states. The binding intentionally restricts writes to the three useful outcomes. See MDN and the HTML Standard.