fix(core/webidl): warn when partial interface has local dfn#5242
fix(core/webidl): warn when partial interface has local dfn#5242marcoscaceres wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new core/webidl authoring warning for cases where a local <dfn> is used for a WebIDL partial definition, aiming to catch specs that redefine interfaces which are actually defined elsewhere.
Changes:
- Adds warning logic in
defineIdlName()for partial IDL definitions that resolve to a local<dfn>withoutdata-cite. - Uses a regex-based scan of local IDL blocks to suppress the warning when a non-partial definition exists in the same spec.
- Adds a spec test covering the new warning behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/core/webidl.js |
Adds the new partial-definition warning and local non-partial detection logic. |
tests/spec/core/webidl-spec.js |
Adds a regression test asserting that the new warning is emitted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9c95265 to
c1c071e
Compare
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
All three items of feedback are addressed in commit d7018ec:
|
…ata-cite Checks raw IDL source for non-partial definitions to avoid false positives. Only warns when no non-partial definition exists. Closes #3563
…heck The regex for detecting non-partial base definitions required the declaration keyword at start-of-line, missing same-line extended attributes like `[Exposed=Window] interface Foo`. Now allows an optional `]` before the keyword. Add 3 regression tests: non-partial base exists (no warning), data-cite dfn (no warning), extended-attribute-prefixed base (no warning).
d7018ec to
7f2c792
Compare
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
…al check Agent-Logs-Url: https://github.com/speced/respec/sessions/56153fca-bad2-4ace-a20e-628ca0d9e7cd Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
All original feedback is addressed. I also found and fixed one additional issue: the extended-attribute test was named "warns for partial with extended-attribute-prefixed base" but was actually asserting zero warnings — corrected to "does not warn when non-partial base has same-line extended attributes" in commit 5cd835a. |
Closes #3563