GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — lib: make DOMException attributes configurable and enumerable by joyeecheung · Pull Request #22550 · nodejs/node Conversation
Member
The Refs: https://heycam.github.io/webidl/#idl-DOMException Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
TimothyGu
reviewed
|
@TimothyGu Indeed that looks nicer! Thanks for the suggestion, I'll switch to that.
@devsnek |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I have mixed feels about Node throwing DOM exceptions. Update: I mean if we're doing it, then it should be correct, but I can see this being slippery. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit: the configurable: true isn't necessary, as the property is already configurable and Object.defineProperties won't override it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to be explicit here since Object.defineProperties will read inherited properties of descriptors and Node internals aren't run in an isolated realm yet.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
DOMException was created right above this with its prototype having them as own properties, so that is not an issue here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jdalton, it was a conscious decision when the class was added to not expose it globally, precisely because of the "slippery slope" you mentioned. It is instead only used where it's necessary for compatibility with HTML's |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ah, it does 👍 Update: Other thought: I'm not sure if it's implied but at least in Chrome the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh yeah, this probably needs [Symbol.toStringTag]: { configurable: true, value: 'DOMException' } @jdalton Would you be open to approving this PR once that's fixed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yep, this is already out of the bottle. The main reason I held is because it had more than 2 approvals, meaning a merge could be imminent, and I wanted a bit more discussion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't quite understand...do you want more discussion about the enumerability of these existing properties? If not, in general we open new issues or PRs to discuss, instead of trying to fix everything in one PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Following up, I dug up spec bits I think are relevant for the The While it doesn't state having |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jdalton Can you open another PR for the
that you requested? I don't see why those have to be fixed in this particular PR and block this one? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
My requested change is in line with "align DOMException with the Web" and is just an additional line after the 3 properties you've defined. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Does it help if I change the commit title to "lib: make DOMException attributes configurable and enumerable"? I don't mind fixing those myself, but personally even if I fix them in this PR I would not squash them into the first commit when I land the changes, so I'd prefer to have another PR open for that (In general I prefer to squash every commit in one PR whenever possible and keep commits that should be separated in different PR). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM (no matter if we add the toStringTag in this PR or not and no strong opinion about explicitly adding configurable: true)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The `name`, `message` and `code` attributes of the DOMException interface should be enumerable and configurable. Aligning the definition with the Web allows us to use it when running the Web Platform Tests. Refs: https://heycam.github.io/webidl/#idl-DOMException
f1dd395 to
c4d3df8
Compare
|
Rebased and renamed the PR to focus on the enumerability and configurability. I think other compliance issues can be dealt with in another PR - I'll open one next week if no one picks it up. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jdalton Do you insist that this PR fixing the enumerability and configurability cannot land until other attributes get fixed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@joyeecheung Yes please. It's a single additional attribute and I believe a reasonable change request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Per @jdalton 's request this is blocked by #22933 (though I still don't quite understand the reasoning behind |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI is green |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #22933 Refs: #22550 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
|
Landed in 676bd5f, thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The `name`, `message` and `code` attributes of the DOMException interface should be enumerable and configurable. Aligning the definition with the Web allows us to use it when running the Web Platform Tests. Refs: https://heycam.github.io/webidl/#idl-DOMException PR-URL: #22550 Refs: web-platform-tests/wpt@125950d Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #22933 Refs: #22550 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
The `name`, `message` and `code` attributes of the DOMException interface should be enumerable and configurable. Aligning the definition with the Web allows us to use it when running the Web Platform Tests. Refs: https://heycam.github.io/webidl/#idl-DOMException PR-URL: #22550 Refs: web-platform-tests/wpt@125950d Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.